> For the complete documentation index, see [llms.txt](https://dev.ucommerce.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ucommerce.net/readme/headless/reference/countries.md).

# Countries

## Prerequisites

* `access_token` from [Headless API Authentication](/readme/headless/headless-api-authentication.md)

## Get Countries

### Optional Parameters

* `filterOnStore`, limits the result to Countries with available Shipping or Payment Methods available for the authenticated store [Headless API Authentication](/readme/headless/headless-api-authentication.md)
* `maxItems`, limits the number of results returned. in [Pagination](/readme/headless/pagination.md)
* `nextPagingToken`, required to fetch the next page. Read more in [Pagination](/readme/headless/pagination.md)

### Request

```bash
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

```json
{
    "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

```json
{
"errors":
    [
        {
            "error-description": "The token is expired.",
            "error": "Unauthorized"
        }
    ]
}
```

## Related Articles

{% content-ref url="/pages/OKRcu1Dp3gn5Y38w55HD" %}
[Error Handling](/readme/headless/error-handling.md)
{% endcontent-ref %}
