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

> List the product catalog, with full-text search and filters by origin and category.

Returns a paginated list of products sorted by name. Covers both products created in the Keebai portal and those synced from an integration.

Results cover the whole **company**, not just the project your token belongs to.

## Endpoint

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

## Required scope

`ecommerce:products:read`

## Headers

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

## Query parameters

| Field      | Type      | Required | Description                                                    |
| ---------- | --------- | -------- | -------------------------------------------------------------- |
| `search`   | `string`  | No       | Full-text search across the catalog.                           |
| `type`     | `string`  | No       | Product origin: internal, or the identifier of an integration. |
| `category` | `string`  | No       | `ObjectId` of the category.                                    |
| `limit`    | `integer` | No       | Page size, `1`–`200`. Defaults to 50.                          |
| `offset`   | `integer` | No       | Records to skip. Defaults to 0.                                |

## Example request

<CodeGroup>
  ```bash curl theme={null}
  curl -G https://api.keebai.com/v1/ecommerce/products \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    --data-urlencode "search=zapatilla" \
    --data-urlencode "limit=50"
  ```

  ```js JavaScript theme={null}
  const params = new URLSearchParams({ search: "zapatilla", limit: "50" });

  const response = await fetch(
    `https://api.keebai.com/v1/ecommerce/products?${params}`,
    { headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` } },
  );
  const { data, total } = await response.json();
  ```

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

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

## Response

### 200 OK

```json theme={null}
{
  "data": [
    {
      "_id": "65a1f2b3c4d5e6f7a8b9c0d1",
      "name": "Zapatilla Runner Pro",
      "slug": "zapatilla-runner-pro",
      "description": "Zapatilla de running con amortiguación reactiva",
      "sku": "SKU-1234",
      "price": 5990000,
      "base_price": 5990000,
      "currency": "CLP",
      "stock": 24,
      "stock_managed": true,
      "type": "internal",
      "category_id": "65b1c2d3e4f5a6b7c8d9e0f1",
      "variants": [
        { "external_id": "42", "name": "Talla 42", "price": 5990000, "is_available": true }
      ],
      "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"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
```

### 400 Bad Request

`limit` above 200, negative `offset`, or an unknown query parameter.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

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

### 502 Bad Gateway

The ecommerce service could not answer.

## Operational notes

* **Prices are integers in the currency's minor unit.** `5990000` with `"currency": "CLP"` is \$59,900 — Chilean pesos have no decimals, so the value is already whole pesos scaled by the platform's factor. Read `currency` before formatting, and never hardcode two decimals.
* **`stock` only means something when `stock_managed` is `true`.** On products synced from an integration it reflects the last sync, not a live read of the platform.
* **`offset` is rounded down to a page boundary.** The catalog paginates by page upstream, so keep `offset` a multiple of `limit`; the usual `offset += limit` loop is always correct.
* **Inactive products are included.** Filter on `is_active` yourself if you only want what is sellable.


## OpenAPI

````yaml GET /v1/ecommerce/products
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:
    get:
      tags:
        - ecommerce
      summary: Listar productos del catálogo
      description: >-
        Devuelve los productos de la company del token, ordenados por nombre.
        Incluye tanto los cargados en Keebai como los sincronizados desde una
        integración.
      operationId: PublicEcommerceController_listProducts
      parameters:
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 200
            default: 50
            type: number
        - name: offset
          required: false
          in: query
          schema:
            minimum: 0
            default: 0
            type: number
        - name: search
          required: false
          in: query
          description: Búsqueda full-text sobre el catálogo
          schema:
            type: string
        - name: type
          required: false
          in: query
          description: 'Origen del producto: interno o el de una integración'
          schema:
            type: string
        - name: category
          required: false
          in: query
          description: ObjectId de la categoría
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProductListResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicProductListResponseDto:
      type: object
      properties:
        total:
          type: number
        limit:
          type: number
        offset:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/PublicProductResponseDto'
      required:
        - total
        - limit
        - offset
        - data
    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`.

````