The States API provides a list of all states of the countries enabled for you.
GET /countries/{{countryCode}}/states
curl --location --request GET '{{url}}/{{countryCode}}/states' \
--header 'X-Client-Id: {{client_id}}' \
--header 'X-Client-Secret: {{client_secret}}' \
--header 'Content-Type: application/json'
[
{
"code": "CA",
"country": "US",
"name": "California"
}
]
GET /countries/{{countryCode}}/states
/{{stateCode}}
curl --location --request GET 'https://v4test.machpay.com/v4/countries/{{countryCode}}/states/{{stateCode}}' \
--header 'X-Client-Id: {{client_id}}' \
--header 'X-Client-Secret: {{client_secret}}' \
--header 'Content-Type: application/json'
{
"code": "CA",
"country": "US",
"name": "California"
}