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

# Product Info

> Fetch product details for the embed checkout widget.

Retrieve product information to display in your embedded checkout widget. Returns pricing, stock, images, store details, and tax settings.

## Get Product

<Note>
  This is a public endpoint. It requires the `X-Embed-Key` header but no customer authentication.
</Note>

```
GET /api/embed/product/{productId}
```

### Path Parameters

| Parameter   | Type    | Description                    |
| ----------- | ------- | ------------------------------ |
| `productId` | integer | The ID of the product to fetch |

### Headers

| Header        | Required | Description                   |
| ------------- | -------- | ----------------------------- |
| `X-Embed-Key` | Yes      | Your store's embed public key |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://embed.rmz.gg/api/embed/product/42" \
    -H "X-Embed-Key: your_embed_public_key" \
    -H "Accept: application/json"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://embed.rmz.gg/api/embed/product/42", {
    headers: {
      "X-Embed-Key": "your_embed_public_key",
      "Accept": "application/json"
    }
  });

  const { data } = await response.json();
  console.log(data.name, data.actual_price);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://embed.rmz.gg/api/embed/product/42",
      headers={
          "X-Embed-Key": "your_embed_public_key",
          "Accept": "application/json"
      }
  )

  data = response.json()["data"]
  print(data["name"], data["actual_price"])
  ```

  ```php PHP theme={null}
  $response = Http::withHeaders([
      'X-Embed-Key' => 'your_embed_public_key',
  ])->get('https://embed.rmz.gg/api/embed/product/42');

  $data = $response->json()['data'];
  echo $data['name'] . ' - ' . $data['actual_price'];
  ```
</CodeGroup>

### Success Response (200)

```json theme={null}
{
  "success": true,
  "data": {
    "id": 42,
    "name": "Premium Digital Course",
    "description": "A comprehensive guide to...",
    "price": 199.00,
    "discount_price": 149.00,
    "actual_price": 149.00,
    "is_discounted": true,
    "image": "https://cdn.rmz.gg/products/abc123.jpg",
    "extra_images": [
      "https://cdn.rmz.gg/products/img2.jpg",
      "https://cdn.rmz.gg/products/img3.jpg"
    ],
    "stock": 50,
    "in_stock": true,
    "type": "code",
    "min_qty": 1,
    "max_qty": 10,
    "store": {
      "id": 7,
      "name": "My Digital Store",
      "logo": "https://cdn.rmz.gg/stores/logo.png",
      "currency": "SAR",
      "language": "ar"
    },
    "tax_enabled": true,
    "tax_rate": 15.0
  }
}
```

### Response Fields

| Field            | Type           | Description                                                                                |
| ---------------- | -------------- | ------------------------------------------------------------------------------------------ |
| `id`             | integer        | Product ID                                                                                 |
| `name`           | string         | Product display name                                                                       |
| `description`    | string         | Product description (may contain HTML)                                                     |
| `price`          | float          | Original listed price                                                                      |
| `discount_price` | float \| null  | Discounted price, or `null` if no discount                                                 |
| `actual_price`   | float          | The effective price the customer pays (discount price if active, otherwise original price) |
| `is_discounted`  | boolean        | Whether a discount is currently active                                                     |
| `image`          | string \| null | Primary product image URL via CDN                                                          |
| `extra_images`   | array          | Additional product image URLs                                                              |
| `stock`          | integer        | Number of items available                                                                  |
| `in_stock`       | boolean        | Whether stock is greater than zero                                                         |
| `type`           | string         | Product type: `code`, `file`, `subscription`, `service`, `card`                            |
| `min_qty`        | integer        | Minimum purchase quantity                                                                  |
| `max_qty`        | integer        | Maximum purchase quantity (capped at stock for `code` products, max 10)                    |
| `store.id`       | integer        | Store ID                                                                                   |
| `store.name`     | string         | Store display name                                                                         |
| `store.logo`     | string         | Store logo URL                                                                             |
| `store.currency` | string         | Store currency code (e.g., `SAR`, `USD`)                                                   |
| `store.language` | string         | Store language (`ar`, `en`)                                                                |
| `tax_enabled`    | boolean        | Whether tax is enabled for this store                                                      |
| `tax_rate`       | float          | Tax rate as a percentage (e.g., `15.0` for 15% VAT)                                        |

### Error Responses

**Product not found (404)**

```json theme={null}
{
  "success": false,
  "message": "Product not found"
}
```

<Tip>
  Only active products (status = enabled) are returned. Disabled or draft products will return a 404 response.
</Tip>
