The state API provides a list of all states in the origination country which is enabled for you.
Get a list of all available states
curl -X GET '{{url}}/v2/states' \
-H 'Accept: application/json' \
-H 'X-Client-Id: clientid' \
-H 'X-Client-Secret: clientsecret'
{
"result": [
{
"id": 1,
"name": "California",
"code": "CA",
"country_id": 23,
}
]
}
curl -X GET '{{url}}/v2/countries/?countryCode=IND' \
-H 'Accept: application/json' \
-H 'X-Client-Id: clientid' \
-H 'X-Client-Secret: clientsecret'
{
"result": [
{
"id": 1,
"name": "California",
"code": "CA",
"country_id": 23,
}
]
}
curl -X GET '{{url}}/v2/countries/states/{{stateId}} \
-H 'Accept: application/json' \
-H 'X-Client-Id: clientid' \
-H 'X-Client-Secret: clientsecret'
{
"result": [
{
"id": 1,
"name": "California",
"code": "CA",
"country_id": 23,
}
]
}