States
Read on populating states enabled for you
The States API provides a list of all states of the countries enabled for you.

Get states in a country

GET /countries/{{countryCode}}/states

Details
Request Sample
Response Sample
Name
Required
Type
Description
countryCode
Yes
String
Two char ISO code of the country
1
curl --location --request GET '{{url}}/{{countryCode}}/states' \
2
--header 'X-Client-Id: {{client_id}}' \
3
--header 'X-Client-Secret: {{client_secret}}' \
4
--header 'Content-Type: application/json'
Copied!
1
[
2
{
3
"code": "CA",
4
"country": "US",
5
"name": "California"
6
}
7
]
Copied!

Get states by code

GET /countries/{{countryCode}}/states/{{stateCode}}

Details
Request Sample
Response Sample
Name
Required
Type
Description
countryCode
Yes
String
Two char ISO code of the country
stateCode
Yes
String
State code
1
curl --location --request GET 'https://v4test.machpay.com/v4/countries/{{countryCode}}/states/{{stateCode}}' \
2
--header 'X-Client-Id: {{client_id}}' \
3
--header 'X-Client-Secret: {{client_secret}}' \
4
--header 'Content-Type: application/json'
Copied!
1
{
2
"code": "CA",
3
"country": "US",
4
"name": "California"
5
}
Copied!