Countries
Prerequisites
access_token
from Headless API Authentication
Get Countries
Optional Parameters
filterOnStore
, limits the result to Countries with available Shipping or Payment Methods available for the authenticated store Headless API AuthenticationmaxItems
, limits the number of results returned. in PaginationnextPagingToken
, required to fetch the next page. Read more in Pagination
Request
curl -D- -X POST <base_url>/api/v1/countries?filterOnStore=false&maxItems=<maxItems>&nextPagingToken=<nextPagingToken> \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-H 'Content-Type: application/json' \
Response
{
"countries": [
{
"cultureCode": "{cultureCode}",
"id": "{countryId}",
"name": "{countryName}"
}
],
"nextPagingToken": "{nextPagingToken | null}"
}
Error Handling
Error
Description
Unauthorized (401)
The token is expired.
Forbidden (403)
The token does not have access to this endpoint.
Error Response Example
{
"errors":
[
{
"error-description": "The token is expired.",
"error": "Unauthorized"
}
]
}
Related Articles
Last updated
Was this helpful?