> ## 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/carts/:id

> Read a single cart with its line items, totals, and customer details.

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

## Endpoint

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

## Required scope

`ecommerce:carts:read`

## Headers

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

## Path parameters

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

## Example request

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

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

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

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

## Response

### 200 OK

```json theme={null}
{
  "cart": {
    "_id": "65c2d3e4f5a6b7c8d9e0f1a2",
    "source": "shopify",
    "integration_id": "65b1c2d3e4f5a6b7c8d9e0f1",
    "external_id": "gid://shopify/Cart/abc123",
    "customer_id": "65a1f2b3c4d5e6f7a8b9c0d1",
    "customer_name": "Juan Pérez",
    "customer_email": "juan@example.com",
    "customer_phone": "+56912345678",
    "items": [
      {
        "product_id": "65d3e4f5a6b7c8d9e0f1a2b3",
        "product_name": "Zapatilla Runner Pro",
        "sku": "SKU-1234",
        "quantity": 1,
        "unit_price": 5990000,
        "subtotal": 5990000,
        "modifiers_summary": "Talla 42",
        "comment": "Regalo, envolver"
      }
    ],
    "total": 5990000,
    "currency": "CLP",
    "recovery_status": "contacted",
    "recovery_url": "https://tienda.example.com/cart/recover/abc123",
    "abandoned_at": "2026-05-02T14:31:07.221Z",
    "created_at": "2026-05-02T13:58:02.100Z",
    "updated_at": "2026-05-02T15:02:18.900Z"
  }
}
```

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

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

### 404 Not Found

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

### 502 Bad Gateway

The ecommerce service could not answer.

## Operational notes

* **`total` is not necessarily the sum of the line subtotals.** Delivery, service fees, and tips are added on top and are not broken out in this payload.
* **`product_id` is absent on items that never matched a Keebai product** — common on integration carts where the platform sent a line item Keebai has not synced. `product_name` and `sku` are always there.
* **A cart is not a draft sale.** There is no link between this record and anything under [`/v1/ecommerce/sales`](/dev/endpoints/ecommerce-sales-list); match on the customer if you need to correlate them.


## OpenAPI

````yaml GET /v1/ecommerce/carts/{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/carts/{id}:
    get:
      tags:
        - ecommerce
      summary: Obtener detalle de un carrito
      operationId: PublicEcommerceController_getCart
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicCartEnvelopeDto'
      security:
        - PAT: []
components:
  schemas:
    PublicCartEnvelopeDto:
      type: object
      properties:
        cart:
          $ref: '#/components/schemas/PublicCartResponseDto'
      required:
        - cart
    PublicCartResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: ObjectId del carrito
        source:
          type: string
          description: Origen del carrito
        integration_id:
          type: string
          description: ObjectId de la integración de origen
        external_id:
          type: string
          description: Identificador en el sistema externo
        customer_id:
          type: string
          description: ObjectId del contacto
        customer_name:
          type: string
        customer_email:
          type: string
        customer_phone:
          type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/PublicCartItemDto'
        total:
          type: number
        currency:
          type: string
        recovery_status:
          type: string
          description: pending | contacted | recovered | discarded
        recovery_url:
          type: string
          description: URL para que el cliente retome el carrito
        abandoned_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - _id
        - source
        - items
        - total
        - currency
        - recovery_status
        - created_at
        - updated_at
    PublicCartItemDto:
      type: object
      properties:
        product_id:
          type: string
          description: ObjectId del producto en Keebai
        product_name:
          type: string
        sku:
          type: string
        quantity:
          type: number
        unit_price:
          type: number
        subtotal:
          type: number
        modifiers_summary:
          type: string
        comment:
          type: string
      required:
        - product_name
        - quantity
        - unit_price
        - subtotal
  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`.

````