> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.littglobal.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.littglobal.com/_mcp/server.

# Get States

POST TBD/api/v2/get-states

This API is used to fetch the list of countries. After you provide the ID of the specific country you want information about, the API will return a list of states for that country along with the corresponding ISO2 and country codes.

### Request Body

- `country_id` (integer): The unique ID of the country for which you want to fetch information.
    

### Response

The response is an array of objects, each containing information about a state from the specified country.

- `state_id` (integer): The unique ID assigned to the state.
    
- `state_name` (string): The official name of the state.
    
- `iso2` (string): The ISO2 code assigned to the state.
    
- `country_code` (string): The ISO2 code associated with the country the state belongs to.

Reference: https://docs.littglobal.com/litt-white-label/api-reference/system-settings/get-states

## Request

### Query parameters

- `api_token` (string, optional)

## Response

### 200

Get States

- `message` (string, optional)
- `api` (string, optional)
- `status` (string, optional)
- `data` (list of ApiV2GetStatesPostResponsesContentApplicationJsonSchemaDataItems, optional)

## Types

### ApiV2GetStatesPostResponsesContentApplicationJsonSchemaDataItems

- `state_id` (integer, optional)
- `state_name` (string, optional)
- `iso2` (string, optional)
- `country_code` (string, optional)

## Examples

**Response**

```json
{
  "message": "Success",
  "api": "get-states",
  "status": "success",
  "data": [
    {
      "state_id": 3907,
      "state_name": "Australian Capital Territory",
      "iso2": "ACT",
      "country_code": "AU"
    },
    {
      "state_id": 3909,
      "state_name": "New South Wales",
      "iso2": "NSW",
      "country_code": "AU"
    },
    {
      "state_id": 3910,
      "state_name": "Northern Territory",
      "iso2": "NT",
      "country_code": "AU"
    },
    {
      "state_id": 3905,
      "state_name": "Queensland",
      "iso2": "QLD",
      "country_code": "AU"
    },
    {
      "state_id": 3904,
      "state_name": "South Australia",
      "iso2": "SA",
      "country_code": "AU"
    },
    {
      "state_id": 3908,
      "state_name": "Tasmania",
      "iso2": "TAS",
      "country_code": "AU"
    },
    {
      "state_id": 3903,
      "state_name": "Victoria",
      "iso2": "VIC",
      "country_code": "AU"
    },
    {
      "state_id": 3906,
      "state_name": "Western Australia",
      "iso2": "WA",
      "country_code": "AU"
    }
  ]
}
```

**SDK Code**

```python System Settings_getStates_example
import requests

url = "https://tbd/api/v2/get-states"

querystring = {"api_token":"{{token}}"}

response = requests.post(url, params=querystring)

print(response.json())
```

```javascript System Settings_getStates_example
const url = 'https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go System Settings_getStates_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby System Settings_getStates_example
require 'uri'
require 'net/http'

url = URI("https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java System Settings_getStates_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D")
  .asString();
```

```php System Settings_getStates_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D');

echo $response->getBody();
```

```csharp System Settings_getStates_example
using RestSharp;

var client = new RestClient("https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift System Settings_getStates_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://tbd/api/v2/get-states?api_token=%7B%7Btoken%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```