Get provinces
Returns the list of available provinces for a country. Query this endpoint to obtain the correct values for fields such as state and registration_province when submitting the onboarding.
The country parameter is the ISO Alpha-2 country code, obtained from the isoAlpha2 field returned by Get countries.
GET
/v1/countries/{country}/provincesRequest
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
country | string | Yes | ISO Alpha-2 country code (e.g. AR, US). Obtained from the isoAlpha2 field in Get countries |
Not applicable: Query Parameters, Body.
Response
2XX Success
| Field | Type | Description |
|---|---|---|
name | string | Value to use in province fields (state, registration_province) in Submit onboarding |
isoAlpha2 | string | ISO Alpha-2 province code |
Error Codes
| Status | Description |
|---|---|
401 | Unauthorized — invalid or missing token |
403 | Forbidden — unauthorized client |
422 | Validation Error — submitted parameters are invalid |
500 | Internal Server Error — internal server error |
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X GET "https://b2b.allaria.dev/v1/countries/AR/provinces" \
-H "Authorization: Bearer ACCESS_TOKEN"
const response = await fetch('https://b2b.allaria.dev/v1/countries/AR/provinces', {
method: 'GET',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN'
}
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'https://b2b.allaria.dev/v1/countries/AR/provinces',
headers={
'Authorization': 'Bearer ACCESS_TOKEN'
}
)
data = response.json()
print(data)
const axios = require('axios');
const response = await axios.get(
'https://b2b.allaria.dev/v1/countries/AR/provinces',
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN'
}
}
);
console.log(response.data);
2XX Success
[
{
"name": "Buenos Aires",
"isoAlpha2": "AR-B"
},
{
"name": "CABA",
"isoAlpha2": "AR-C"
}
]