---
title: "List categories"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cardzone.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List categories

Path: Cardzone B2B API › Catalog

`GET /api/b2b/v1/categories`

Requires an active API credential with the `catalog:read` permission. Lists the categories of products you can order now. Pass `include_unavailable=true` to also include the categories of out-of-stock and unavailable products, as the Products endpoint does with the same parameter; every category in the default list is still included. Sandbox credentials return the static `sandbox` category. Use the Products endpoint with a sandbox key to find scenario product IDs.

## Authentication

- `BearerAuth`, http, header `Authorization`

## Query parameters

- `include_unavailable` (`listCategories.query.include_unavailable`; boolean, optional) — Also list products that cannot be ordered right now (`status` `out_of_stock` or `unavailable`).
  - default `false`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://cardzone.ai/api/b2b/v1/categories \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://cardzone.ai/api/b2b/v1/categories';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://cardzone.ai/api/b2b/v1/categories"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Categories

#### Example

```json
{
  "categories": [
    {
      "id": "pubg",
      "name": "PUBG Mobile"
    }
  ]
}
```

- `categories` (`listCategories.response.200.categories`; array<object>, required)
  - `id` (`listCategories.response.200.categories.id`; string, required) — Category slug
    - example `"pubg"`
  - `name` (`listCategories.response.200.categories.name`; string, required) — Category name
  - `status` (`listCategories.response.200.categories.status`; string, required) — The best `status` among the category's listed products: `available` if any is available, otherwise `out_of_stock` if any is out of stock, otherwise `unavailable`. A category with no listed products is `available`. Always `available` unless `include_unavailable=true`.
    - one of `"available"`, `"out_of_stock"`, `"unavailable"`

### 401

Missing, revoked, or unknown API key. A live key also gets this while its store is inactive, or until the store's business verification is approved and its primary user's email is verified.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "product_status": "out_of_stock"
  }
}
```

- `error` (`listCategories.response.401.error`; object, required)
  - `code` (`listCategories.response.401.error.code`; string, required)
  - `message` (`listCategories.response.401.error.message`; string, required)
  - `details` (`listCategories.response.401.error.details`; unknown, optional) — Optional field-level validation details
  - `product_status` (`listCategories.response.401.error.product_status`; string, optional) — Present on `404` product errors when the product exists but cannot be ordered: `out_of_stock` or `unavailable`, with the same meaning as the catalog `status`. Absent when the product id is unknown or deleted.
    - one of `"out_of_stock"`, `"unavailable"`

### 403

`forbidden` when the API credential lacks the required permission, or `insufficient_store_wallet_balance` when a live key's store does not meet the wallet requirement.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "product_status": "out_of_stock"
  }
}
```

- `error` (`listCategories.response.403.error`; object, required)
  - `code` (`listCategories.response.403.error.code`; string, required)
  - `message` (`listCategories.response.403.error.message`; string, required)
  - `details` (`listCategories.response.403.error.details`; unknown, optional) — Optional field-level validation details
  - `product_status` (`listCategories.response.403.error.product_status`; string, optional) — Present on `404` product errors when the product exists but cannot be ordered: `out_of_stock` or `unavailable`, with the same meaning as the catalog `status`. Absent when the product id is unknown or deleted.
    - one of `"out_of_stock"`, `"unavailable"`


Source: https://docs.cardzone.ai/reference/categories/list/index.md
