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

# Get Product Catalog

> Get all available gift cards and digital products grouped by category

## Overview

Returns complete catalog of gift cards and digital products organized by categories (Gaming, Streaming, etc.).

<Tip>
  **Cache this data** for at least 24 hours. Catalog changes infrequently.
</Tip>

## Response

<ResponseField name="success" type="boolean" required>
  Request status
</ResponseField>

<ResponseField name="totalCategories" type="integer">
  Total number of categories in the catalog
</ResponseField>

<ResponseField name="totalProducts" type="integer">
  Total number of products across all categories
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable title="properties">
    <ResponseField name="categories" type="array">
      Array of category objects with products

      <Expandable title="category object">
        <ResponseField name="title" type="string">
          Category name (e.g., "PSN", "Game Stores", "iTunes")
        </ResponseField>

        <ResponseField name="products" type="array">
          Array of product objects

          <Expandable title="product object">
            <ResponseField name="id" type="string">
              Unique product ID (use with `/check-product`)
            </ResponseField>

            <ResponseField name="title" type="string">
              Product display name
            </ResponseField>

            <ResponseField name="enabled" type="boolean">
              Available via API
            </ResponseField>

            <ResponseField name="region" type="string">
              Geographic region code (e.g., "germany", "united-states-america")
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  <Expandable title="properties">
    <ResponseField name="timestamp" type="string">
      Response timestamp in ISO 8601 format
    </ResponseField>
  </Expandable>
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.oneclickdz.com/v3/gift-cards/catalog \
    -H "X-Access-Token: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.oneclickdz.com/v3/gift-cards/catalog",
    {
      headers: { "X-Access-Token": "YOUR_API_KEY" },
    }
  );
  const { data } = await response.json();

  // Filter enabled products
  const enabledProducts = data.categories.flatMap((cat) =>
    cat.products.filter((p) => p.enabled)
  );
  ```

  ```python Python theme={null}
  response = requests.get(
      'https://api.oneclickdz.com/v3/gift-cards/catalog',
      headers={'X-Access-Token': 'YOUR_API_KEY'}
  )
  catalog = response.json()['data']

  # Filter by category
  gaming = next(c for c in catalog['categories'] if c['name'] == 'Gaming Cards')
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.oneclickdz.com/v3/gift-cards/catalog');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Access-Token: YOUR_API_KEY']);
  $response = json_decode(curl_exec($ch), true);
  $categories = $response['data']['categories'];
  ?>
  ```
</CodeGroup>

### Response Example

````json theme={null}
### Response Example

```json
{
  "success": true,
  "totalCategories": 14,
  "totalProducts": 62,
  "data": {
    "categories": [
      {
        "title": "PSN",
        "products": [
          {
            "id": "6126393c6f57860f925a1983",
            "title": "PSN Germany",
            "enabled": true,
            "region": "germany"
          },
          {
            "id": "612619816f57860f9259eee3",
            "title": "PSN UK",
            "enabled": true,
            "region": "united-kingdom"
          },
          {
            "id": "60111eba751a26110ab5b209",
            "title": "PSN US",
            "enabled": true,
            "region": "united-states-america"
          }
        ]
      },
      {
        "title": "Game Stores",
        "products": [
          {
            "id": "6037a862b8d036107c61d312",
            "title": "Steam USD",
            "enabled": true,
            "region": "united-states-america"
          },
          {
            "id": "6038ffd52a60b8107c134e39",
            "title": "Steam EUR",
            "enabled": true,
            "region": "european-union"
          },
          {
            "id": "60b6f304ad371a16a4347e11",
            "title": "Roblox",
            "enabled": true
          }
        ]
      }
    ]
  },
  "meta": {
    "timestamp": "2025-10-29T00:36:52.615Z"
  }
}
````

````

## Building Product UI

```javascript
// Example: Building a category-based UI
function renderCatalog(catalog) {
  return catalog.categories.map((category) => ({
    categoryName: category.name,
    products: category.products
      .filter((p) => p.enabled)
      .map((p) => ({
        id: p.id,
        name: p.title,
        imageUrl: `/images/products/${p.id}.png`,
      })),
  }));
}
````

## Caching Strategy

<CodeGroup>
  ```javascript Node.js theme={null}
  // Cache for 24 hours
  const cache = {
    data: null,
    timestamp: 0,
    ttl: 24 * 60 * 60 * 1000, // 24 hours
  };

  async function getCatalog() {
    const now = Date.now();

    if (cache.data && now - cache.timestamp < cache.ttl) {
      return cache.data;
    }

    const response = await fetch(
      "https://api.oneclickdz.com/v3/gift-cards/catalog",
      {
        headers: { "X-Access-Token": process.env.API_KEY },
      }
    );

    cache.data = await response.json();
    cache.timestamp = now;

    return cache.data;
  }
  ```

  ```python Python theme={null}
  from datetime import datetime, timedelta
  import requests

  class CatalogCache:
      def __init__(self):
          self.data = None
          self.timestamp = None
          self.ttl = timedelta(minutes=10)

      def get(self):
          if self.data and datetime.now() - self.timestamp < self.ttl:
              return self.data

          response = requests.get(
              'https://api.oneclickdz.com/v3/gift-cards/catalog',
              headers={'X-Access-Token': 'YOUR_API_KEY'}
          )

          self.data = response.json()
          self.timestamp = datetime.now()

          return self.data

  catalog_cache = CatalogCache()
  ```
</CodeGroup>

## Best Practices

<CardGroup cols={2}>
  <Card title="Cache Catalog" icon="database">
    Cache for 10+ minutes to reduce API calls
  </Card>

  <Card title="Filter Enabled" icon="filter">
    Only show products where `enabled: true`
  </Card>

  <Card title="Check Region" icon="earth-americas">
    Filter by region if targeting specific markets
  </Card>

  <Card title="Organize by Category" icon="folder-tree">
    Use categories for better UX
  </Card>
</CardGroup>

## Next Steps

After getting the catalog:

<Steps>
  <Step title="Display Products">
    Show products to users organized by category
  </Step>

  <Step title="Check Product Details">
    Use `/checkProduct/:id` to get pricing and stock
  </Step>

  <Step title="Place Order">
    Use `/placeOrder` to purchase selected product
  </Step>
</Steps>

## Related

<CardGroup cols={2}>
  <Card title="Check Product" icon="magnifying-glass" href="/en/api-reference/gift-cards/check-product">
    Get pricing and stock
  </Card>

  <Card title="Place Order" icon="cart-shopping" href="/en/api-reference/gift-cards/place-order">
    Purchase product
  </Card>
</CardGroup>
