> ## 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.

# Check Product Details

> Get detailed pricing, denominations, and stock for a specific product

## Overview

Returns product types/denominations with real-time pricing and stock availability.

<Warning>
  Prices are personalized to your account. **Remove `cost` before showing to
  users.**
</Warning>

## Path Parameters

<ParamField path="productId" type="string" required>
  Product ID from `/catalog` endpoint
</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="types" type="array">
      Array of product type/denomination objects

      <Expandable title="type object">
        <ResponseField name="id" type="string">
          Type ID (use when placing orders)
        </ResponseField>

        <ResponseField name="name" type="string">
          Type/denomination name (e.g., "100 DA", "1000 DA")
        </ResponseField>

        <ResponseField name="price" type="number">
          Your price (includes discount)
        </ResponseField>

        <ResponseField name="quantity" type="number">
          Available stock (0 = out of stock)
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Examples

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

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

  // Filter in-stock items
  const available = data.types.filter((t) => t.quantity > 0);
  ```

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

  # Filter available
  available = [t for t in types if t['quantity'] > 0]
  ```

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

  // Filter available
  $available = array_filter($types, function($t) {
      return $t['quantity'] > 0;
  });
  ?>
  ```
</CodeGroup>

### Response Example

```json theme={null}
{
  "success": true,
  "data": {
    "productId": "507f1f77bcf86cd799439011",
    "productTitle": "PlayStation Network",
    "types": [
      {
        "id": "type_001",
        "name": "PSN 500 DA",
        "price": 490,
        "quantity": 150
      },
      {
        "id": "type_002",
        "name": "PSN 1000 DA",
        "price": 980,
        "quantity": 87
      },
      {
        "id": "type_003",
        "name": "PSN 2000 DA",
        "price": 1960,
        "quantity": 0
      }
    ]
  },
  "meta": {
    "timestamp": "2025-10-29T01:00:00.000Z"
  },
  "requestId": "req_1730163600_xyz789"
}
```

## Apply Your Markup

```javascript theme={null}
function applyMarkup(types, markupPercent = 5) {
  return types
    .filter((t) => t.quantity > 0)
    .map((t) => ({
      id: t.id,
      name: t.name,
      price: Math.ceil(t.price * (1 + markupPercent / 100)),
      available: true,
    }));
}

// Usage
const customerPrices = applyMarkup(data.types, 5); // 5% markup
```

## Best Practices

<CardGroup cols={2}>
  <Card title="Check Stock" icon="warehouse">
    Verify `quantity > 0` before displaying
  </Card>

  <Card title="Apply Markup" icon="percent">
    Add your profit margin to `price`
  </Card>

  <Card title="Hide Price" icon="eye-slash">
    Never show wholesale `price` to customers
  </Card>

  <Card title="Update Regularly" icon="arrows-rotate">
    Refresh stock periodically
  </Card>
</CardGroup>

## Related

<CardGroup cols={2}>
  <Card title="Get Catalog" icon="list" href="/en/api-reference/gift-cards/get-catalog">
    Browse all products
  </Card>

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