Get countries
Returns the list of available countries. Query this endpoint to obtain the correct values for fields such as citizenship, birth_country, and country when submitting the onboarding.
GET
/v1/countriesRequest
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Not applicable: Path Parameters, Query Parameters, Body.
Response
2XX Success
| Field | Type | Description |
|---|---|---|
citizenship | string | Value to use in nationality fields (citizenship) in Submit onboarding |
name | string | Value to use in country fields (birth_country, country, registration_country) in Submit onboarding |
isoAlpha2 | string | ISO Alpha-2 country code. Used as the country parameter in Get provinces |
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" \
-H "Authorization: Bearer ACCESS_TOKEN"
const response = await fetch('https://b2b.allaria.dev/v1/countries', {
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',
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',
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN'
}
}
);
console.log(response.data);
2XX Success
[
{
"citizenship": "Argentina",
"name": "Argentina",
"isoAlpha2": "AR"
},
{
"citizenship": "Estadounidense",
"name": "Estados Unidos",
"isoAlpha2": "US"
}
]