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

# 📦 Ecommerce

> Manage and query product data within your assistant experiences. These endpoints allow for upserting new product definitions and retrieving individual products by ID.

## 🔽 `POST /api/public/product/upsert/{promptBlockId}` – Upsert Products

Creates a list of products and their embeddings for a specific prompt block. Any product **not included in the payload will be deleted**, making this endpoint ideal for full refreshes.

Click to expand full details

### 🔹 URL

```
POST /api/public/product/upsert/{promptBlockId}
```

***

### 🔹 Path Parameters

| Name            | Type   | Required | Description                               |
| --------------- | ------ | -------- | ----------------------------------------- |
| `promptBlockId` | string | ✅        | ID of the prompt block using the products |

***

### 🔹 Headers

| Name        | Type   | Required | Description                     |
| ----------- | ------ | -------- | ------------------------------- |
| `x-api-key` | string | ✅        | Your API key for authentication |

***

### 🔹 Body Parameters

Send a list of product objects to define the current catalog. Each object typically contains:

<CodeGroup>
  ```bash bash theme={null}
  [
    {
      "id": "product_001",
      "name": "AI Coffee Mug",
      "description": "Ceramic mug with your assistant’s logo",
      "price": 12.99,
      "currency": "USD",
      "tags": ["mug", "merch", "coffee"]
    },
    {
      "id": "product_002",
      "name": "Smart T-Shirt",
      "description": "Black T-shirt with AI-powered design",
      "price": 24.50,
      "currency": "USD"
    }
  ]
  ```
</CodeGroup>

***

### 🔹 Example Request

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
    'https://iris-backend-production.up.railway.app/api/public/product/upsert/prompt_abc123' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: YOUR_API_KEY' \
    --data-raw '[
      {
        "id": "product_001",
        "name": "AI Coffee Mug",
        "description": "Ceramic mug with your assistant’s logo",
        "price": 12.99,
        "currency": "USD"
      }
    ]'
  ```
</CodeGroup>

***

### 🔹 Responses

| Code | Description                    |
| ---- | ------------------------------ |
| 201  | Products upserted successfully |
| 400  | Bad request (malformed body)   |
| 401  | Unauthorized (missing key)     |

***

## 🔽 `GET /api/public/order/{id}/product` – Get Product by Order ID

Retrieves product information tied to a specific order.

Click to expand full details

### 🔹 URL

```
GET /api/public/order/{id}/product
```

***

### 🔹 Path Parameters

| Name | Type   | Required | Description                           |
| ---- | ------ | -------- | ------------------------------------- |
| `id` | string | ✅        | Order ID to retrieve the product from |

***

### 🔹 Example Request

<CodeGroup>
  ````bash bash curl --request GET \ theme={null}
  'https://api.vambe.me/api/public/order/abc123/product' ```
  </CodeGroup>

  ---

  ### 🔹 Success Response

  <CodeGroup>
  ```bash bash
  {
    "id": "product_001",
    "name": "Custom T-Shirt",
    "description": "White cotton, printed front and back",
    "price": 29.99,
    "currency": "USD",
    "tags": ["tshirt", "clothing", "custom"]
  }
  ````
</CodeGroup>

***

### 🔹 Response Codes

| Code | Meaning   | Description                          |
| ---- | --------- | ------------------------------------ |
| 200  | OK        | Product found                        |
| 404  | Not Found | No product found for the given order |

***

[👨🏽‍💻 Integration Guide](/docs/integration-to-the-api)

[🔁 Pipelines](/docs/create-pipeline)

Ask AI

* [Table of Contents](#)

* * [🔽 POST /api/public/product/upsert/\{promptBlockId} – Upsert Products](#-post-apipublicproductupsertpromptblockid--upsert-products)
  * [🔽 GET /api/public/order/\{id}/product – Get Product by Order ID](#-get-apipublicorderidproduct--get-product-by-order-id)
