# Catalogs

## Prerequisites

* `access_token` from [Headless API Authentication](/readme/headless/headless-api-authentication.md)
* `cultureCode`, e.g. `en-US` (string)
* `priceGroupId` from the cart or from [Price Groups](/readme/headless/reference/price-groups.md)

## Get Catalogs

### Optional Parameters

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

<pre class="language-bash"><code class="lang-bash">curl -D- -X GET &#x3C;base_url>/api/v1/catalogs?cultureCode=&#x3C;cultureCode>&#x26;priceGroupId=&#x3C;priceGroupId>&#x26;maxItems=&#x3C;maxItems>&#x26;nextPagingToken=&#x3C;nextPagingToken> \
<strong>    -H 'Authorization: Bearer &#x3C;ACCESS_TOKEN>'
</strong>    -H 'Content-Type: application/json' \
</code></pre>

### Response

```json
{
    "nextPagingToken": "{pagingToken | null}",
    "catalogs": [
        {
            "id": "{catalogId}",
            "name": "{catalogName}"
        }
    ]
}
```

## Error Handling

| Error              | Description                                      |
| ------------------ | ------------------------------------------------ |
| BadRequest (400)   | Invalid Price Group; Invalid cultureCode.        |
| Unauthorized (401) | The token is expired.                            |
| Forbidden (403)    | The token does not have access to this endpoint. |

Error Response Example

```json
{
"errors":
    [
        {
            "error-description": "Invalid Price Group.",
            "error": "BadRequest"
        }
    ]
}
```

## Related Articles

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ucommerce.net/readme/headless/reference/catalogs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
