Countries

Prerequisites

Get Countries

Optional Parameters

  • filterOnStore, limits the result to Countries with available Shipping or Payment Methods available for the authenticated store Headless API Authentication

  • maxItems, limits the number of results returned. in Pagination

  • nextPagingToken, 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

ErrorDescription

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"
        }
    ]
}
Error Handling

Last updated