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

# GET /v1/ecommerce/products/:id

> Read a single product, with its variants, images, and stock.

Returns one product by id. Use [`GET /v1/ecommerce/products`](/dev/endpoints/ecommerce-products-list) to find the id first.

## Endpoint

```
GET https://api.keebai.com/v1/ecommerce/products/{id}
```

## Required scope

`ecommerce:products:read`

## Headers

| Header          | Required | Value                    |
| --------------- | -------- | ------------------------ |
| `Authorization` | Yes      | `Bearer kbai_pk_<token>` |

## Path parameters

| Field | Type     | Required | Description                |
| ----- | -------- | -------- | -------------------------- |
| `id`  | `string` | Yes      | `ObjectId` of the product. |

## Example request

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.keebai.com/v1/ecommerce/products/65a1f2b3c4d5e6f7a8b9c0d1 \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```js JavaScript theme={null}
  const response = await fetch(
    `https://api.keebai.com/v1/ecommerce/products/${productId}`,
    { headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` } },
  );
  const { product } = await response.json();
  ```

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

  resp = requests.get(
      f"https://api.keebai.com/v1/ecommerce/products/{product_id}",
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      timeout=10,
  )
  resp.raise_for_status()
  product = resp.json()["product"]
  ```
</CodeGroup>

## Response

### 200 OK

```json theme={null}
{
  "product": {
    "_id": "65a1f2b3c4d5e6f7a8b9c0d1",
    "name": "Zapatilla Runner Pro",
    "slug": "zapatilla-runner-pro",
    "description": "Zapatilla de running con amortiguación reactiva",
    "sku": "SKU-1234",
    "price": 5990000,
    "currency": "CLP",
    "stock": 24,
    "stock_managed": true,
    "type": "shopify",
    "external_id": "gid://shopify/Product/7891234567890",
    "variants": [
      { "external_id": "42", "name": "Talla 42", "price": 5990000, "is_available": true },
      { "external_id": "43", "name": "Talla 43", "price": 5990000, "is_available": false }
    ],
    "image_urls": ["https://cdn.example.com/products/runner-pro.jpg"],
    "landing_url": "https://tienda.example.com/zapatilla-runner-pro",
    "is_active": true,
    "created_at": "2026-04-18T09:12:44.010Z",
    "updated_at": "2026-05-02T14:31:07.221Z"
  }
}
```

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `ecommerce:products:read` scope.

### 404 Not Found

No product with that id, or it belongs to a different company.

### 502 Bad Gateway

The ecommerce service could not answer.

## Operational notes

* **Variants carry their own price**, which may differ from the product's `price`. When a customer picks a size or a colour, quote the variant.
* **`is_available` on a variant is not the same as `stock`.** A variant can be unavailable while the product still shows stock, typically because the platform marked that specific option as sold out.
* **`external_id` is the platform's id, in the platform's format.** Shopify uses a `gid://` URI, other platforms use plain numbers. Do not parse it — pass it through.


## OpenAPI

````yaml GET /v1/ecommerce/products/{id}
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/ecommerce/products/{id}:
    get:
      tags:
        - ecommerce
      summary: Obtener detalle de un producto
      operationId: PublicEcommerceController_getProduct
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProductEnvelopeDto'
      security:
        - PAT: []
components:
  schemas:
    PublicProductEnvelopeDto:
      type: object
      properties:
        product:
          $ref: '#/components/schemas/PublicProductResponseDto'
      required:
        - product
    PublicProductResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: ObjectId del producto
        name:
          type: string
        slug:
          type: string
        description:
          type: string
        sku:
          type: string
        price:
          type: number
        base_price:
          type: number
          description: Precio base antes de variantes
        currency:
          type: string
        stock:
          type: number
        stock_managed:
          type: boolean
          description: true cuando el stock se descuenta al vender
        type:
          type: string
          description: Origen del producto
        category_id:
          type: string
          description: ObjectId de la categoría
        external_id:
          type: string
          description: Identificador en el sistema externo
        variants:
          type: array
          items:
            $ref: '#/components/schemas/PublicProductVariantDto'
        image_urls:
          type: array
          items:
            type: string
        landing_url:
          type: string
        is_active:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - _id
        - name
        - price
        - currency
        - stock
        - stock_managed
        - type
        - variants
        - image_urls
        - is_active
        - created_at
        - updated_at
    PublicProductVariantDto:
      type: object
      properties:
        external_id:
          type: string
        name:
          type: string
        price:
          type: number
        is_available:
          type: boolean
      required:
        - external_id
        - name
        - price
        - is_available
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````