# Products

## Get all products

GET `/stores/{store_id}/products?`

This endpoint lets you get all products for a store.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Products retrieved successfully",
    "data": {
        "products": [
            {
                "inventory": {
                    "trackQuantity": false,
                    "quantity": 0,
                    "allowBackorder": false
                },
                "_id": "69259344f67aff7e9fe0bb2e",
                "name": "Hi-Fi DAC",
                "description": "resolution digital-to-analog converter with headphone amp. Supports 32-bit/384kHz and DSD256.",
                "brand": "AudioPhile",
                "country": "US",
                "currency": "USD",
                "storeName": "My Awesome Store",
                "featured": true,
                "userStore": "692565f432118c6197abf2ec",
                "ships_to_countries": [],
                "category": null,
                "subcategory": null,
                "pros": [],
                "cons": [],
                "keywords": [],
                "imageEmbedding": [],
                "textEmbedding": [],
                "slug": "hi-fi-dac",
                "variants": [
                    {
                        "color": "Black",
                        "stock": 15,
                        "sku": "DAC-AMP-BLK"
                    },
                    {
                        "color": "Silver",
                        "stock": 10,
                        "sku": "DAC-AMP-SLV"
                    }
                ],
                "price": 249.99,
                "storeOrder": 0,
                "priceHistory": [
                    {
                        "price": 249.99,
                        "date": "2025-11-25T11:30:12.805Z",
                        "_id": "69259344f67aff7e9fe0bb2f"
                    }
                ],
                "discountPercentage": 0,
                "discount": 0,
                "discountVal": 0,
                "status": "active",
                "averageRating": 0,
                "reviewCount": 0,
                "tags": [],
                "published_at": "2025-11-25T11:30:12.805Z",
                "last_updated": "2025-11-25T11:54:20.473Z",
                "source": "agora-store-builder",
                "images": [
                    "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=800"
                ],
                "url": "/products/hi-fi-dac-amplifier",
                "isActive": true,
                "creator": {
                    "_id": "692560a0f3b17397ede28cae",
                    "firstname": "Hanzala",
                    "lastname": "Javed",
                    "email": "hanzalaoc211@gmail.com",
                    "id": "692560a0f3b17397ede28cae"
                },
                "available": true,
                "viewCount": 0,
                "orderCount": 0,
                "options": [],
                "metafields": [],
                "__v": 0,
                "createdAt": "2025-11-25T11:30:12.825Z",
                "updatedAt": "2025-11-27T10:04:35.241Z"
            }
        ],
        "pagination": {
            "currentPage": 1,
            "totalPages": 1,
            "totalProducts": 1,
            "hasNextPage": false,
            "hasPrevPage": false
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Get specific product

GET /stores/{store\_id}/products/{product\_id}

This endpoint lets you get information about a specific product.&#x20;

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Product retrieved successfully",
    "data": {
        "inventory": {
            "trackQuantity": false,
            "quantity": 0,
            "allowBackorder": false
        },
        "_id": "69259344f67aff7e9fe0bb2e",
        "name": "Hi-Fi DAC",
        "description": "resolution digital-to-analog converter with headphone amp. Supports 32-bit/384kHz and DSD256.",
        "brand": "AudioPhile",
        "country": "US",
        "currency": "USD",
        "storeName": "My Awesome Store",
        "featured": true,
        "userStore": "692565f432118c6197abf2ec",
        "ships_to_countries": [],
        "category": null,
        "subcategory": null,
        "pros": [],
        "cons": [],
        "keywords": [],
        "imageEmbedding": [],
        "textEmbedding": [],
        "slug": "hi-fi-dac",
        "variants": [
            {
                "color": "Black",
                "stock": 15,
                "sku": "DAC-AMP-BLK"
            },
            {
                "color": "Silver",
                "stock": 10,
                "sku": "DAC-AMP-SLV"
            }
        ],
        "price": 249.99,
        "storeOrder": 0,
        "priceHistory": [
            {
                "price": 249.99,
                "date": "2025-11-25T11:30:12.805Z",
                "_id": "69259344f67aff7e9fe0bb2f"
            }
        ],
        "discountPercentage": 0,
        "discount": 0,
        "discountVal": 0,
        "status": "active",
        "averageRating": 0,
        "reviewCount": 0,
        "tags": [],
        "published_at": "2025-11-25T11:30:12.805Z",
        "last_updated": "2025-11-25T11:54:20.473Z",
        "source": "agora-store-builder",
        "images": [
            "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=800"
        ],
        "url": "/products/hi-fi-dac-amplifier",
        "isActive": true,
        "creator": {
            "_id": "692560a0f3b17397ede28cae",
            "firstname": "Hanzala",
            "lastname": "Javed",
            "email": "hanzalaoc211@gmail.com",
            "id": "692560a0f3b17397ede28cae"
        },
        "available": true,
        "viewCount": 0,
        "orderCount": 0,
        "options": [],
        "metafields": [],
        "__v": 0,
        "createdAt": "2025-11-25T11:30:12.825Z",
        "updatedAt": "2025-11-27T10:04:35.241Z"
    }
}
```

{% endtab %}
{% endtabs %}

## Create product

POST `/stores/{store_id}/products`

This endpoint lets you create a new product.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Request body**

```json
{
  "products": [
    {
      "name": "Hi-Fi DAC",
      "description": "resolution digital-to-analog converter with headphone amp. Supports 32-bit/384kHz and DSD256.",
      "brand": "AudioPhile",
      "price": 249.99,
      "featured": true,
      "category": "507f1f77bcf86cd799439011",
      "subcategory": "507f1f77bcf86cd799439012",
      "images": [ // images and variants[].images accept: image URLs (http/https), base64 data URLs (data:image/), or binary files (formData/multipart)
        "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=800" 
      ],
      "inventory": {
        "trackQuantity": false,
        "quantity": 0,
        "allowBackorder": false
      },
      "variants": [
        {
          "color": "Black",
          "stock": 15,
          "sku": "DAC-AMP-BLK",
          "images": [// images and variants[].images accept: image URLs (http/https), base64 data URLs (data:image/), or binary files (formData/multipart)
            "https://example.com/images/variant-black-1.jpg",
            "https://example.com/images/variant-black-2.jpg"
          ]
        }
      ]
    }
  ]
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "1 product created successfully",
    "data": {
        "products": [
            {
                "name": "Hi-Fi DAC",
                "description": "resolution digital-to-analog converter with headphone amp. Supports 32-bit/384kHz and DSD256.",
                "brand": "AudioPhile",
                "country": "US",
                "currency": "USD",
                "storeName": "My Awesome Store",
                "featured": true,
                "userStore": "692565f432118c6197abf2ec",
                "ships_to_countries": [],
                "category": "507f1f77bcf86cd799439011",
                "subcategory": "507f1f77bcf86cd799439012",
                "pros": [],
                "cons": [],
                "keywords": [],
                "imageEmbedding": [],
                "textEmbedding": [],
                "slug": "hi-fi-dac-1",
                "variants": [
                    {
                        "color": "Black",
                        "stock": 15,
                        "sku": "DAC-AMP-BLK",
                        "images": [
                            "https://example.com/images/variant-black-1.jpg",
                            "https://example.com/images/variant-black-2.jpg"
                        ]
                    }
                ],
                "price": 249.99,
                "storeOrder": 0,
                "priceHistory": [
                    {
                        "price": 249.99,
                        "date": "2025-11-27T17:24:59.371Z",
                        "_id": "6928896b8a13ca447bd83ac2"
                    }
                ],
                "discountPercentage": 0,
                "discount": 0,
                "discountVal": 0,
                "inventory": {
                    "trackQuantity": false,
                    "quantity": 0,
                    "allowBackorder": false
                },
                "status": "active",
                "averageRating": 0,
                "reviewCount": 0,
                "tags": [],
                "published_at": "2025-11-27T17:24:59.371Z",
                "last_updated": "2025-11-27T17:24:59.371Z",
                "source": "agora-store-builder",
                "images": [
                    "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=800"
                ],
                "url": "/products/hi-fi-dac-1",
                "isActive": true,
                "creator": "692560a0f3b17397ede28cae",
                "available": true,
                "viewCount": 0,
                "orderCount": 0,
                "_id": "6928896b8a13ca447bd83ac1",
                "options": [],
                "metafields": [],
                "__v": 0,
                "createdAt": "2025-11-27T17:24:59.389Z",
                "updatedAt": "2025-11-27T17:24:59.389Z"
            }
        ],
        "count": 1
    }
}
```

{% endtab %}
{% endtabs %}

## Update product

PUT `/stores/{store_id}/products/{product_id}`

This endpoint lets you update a product.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Body request**

```json
{
    "name": "Hi-Fi",
    "description": "resolution digital-to-analog converter with headphone amp. Supports 32-bit/384kHz and DSD256.",
    "brand": "AudioPhile",
    "price": 249.99,
    "featured": true,
    "category": "507f1f77bcf86cd799439011",
    "subcategory": "507f1f77bcf86cd799439012",
    "images": [ // images and variants[].images accept: image URLs (http/https), base64 data URLs (data:image/), or binary files (formData/multipart)
        "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=800"
    ],
    "inventory": {
        "trackQuantity": false,
        "quantity": 0,
        "allowBackorder": false
    },
    "variants": [
        {
            "color": "Black",
            "stock": 15,
            "sku": "DAC-AMP-BLK",
            "images": [ // images and variants[].images accept: image URLs (http/https), base64 data URLs (data:image/), or binary files (formData/multipart)
                "https://example.com/images/variant-black-1.jpg",
                "https://example.com/images/variant-black-2.jpg"
            ]
        }
    ]
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Product updated successfully",
    "data": {
        "inventory": {
            "trackQuantity": false,
            "quantity": 0,
            "allowBackorder": false
        },
        "_id": "6928896b8a13ca447bd83ac1",
        "name": "Hi-Fi",
        "description": "resolution digital-to-analog converter with headphone amp. Supports 32-bit/384kHz and DSD256.",
        "brand": "AudioPhile",
        "country": "US",
        "currency": "USD",
        "storeName": "My Awesome Store",
        "featured": true,
        "userStore": "692565f432118c6197abf2ec",
        "ships_to_countries": [],
        "category": null,
        "subcategory": null,
        "pros": [],
        "cons": [],
        "keywords": [],
        "imageEmbedding": [],
        "textEmbedding": [],
        "slug": "hi-fi",
        "variants": [
            {
                "color": "Black",
                "stock": 15,
                "sku": "DAC-AMP-BLK",
                "images": [
                    "https://example.com/images/variant-black-1.jpg",
                    "https://example.com/images/variant-black-2.jpg"
                ]
            }
        ],
        "price": 249.99,
        "storeOrder": 0,
        "priceHistory": [
            {
                "price": 249.99,
                "date": "2025-11-27T17:24:59.371Z",
                "_id": "6928896b8a13ca447bd83ac2"
            }
        ],
        "discountPercentage": 0,
        "discount": 0,
        "discountVal": 0,
        "status": "active",
        "averageRating": 0,
        "reviewCount": 0,
        "tags": [],
        "published_at": "2025-11-27T17:24:59.371Z",
        "last_updated": "2025-11-27T17:28:14.793Z",
        "source": "agora-store-builder",
        "images": [
            "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=800"
        ],
        "url": "/products/hi-fi-dac-1",
        "isActive": true,
        "creator": {
            "_id": "692560a0f3b17397ede28cae",
            "firstname": "Hanzala",
            "lastname": "Javed",
            "email": "hanzalaoc211@gmail.com",
            "id": "692560a0f3b17397ede28cae"
        },
        "available": true,
        "viewCount": 0,
        "orderCount": 0,
        "options": [],
        "metafields": [],
        "__v": 0,
        "createdAt": "2025-11-27T17:24:59.389Z",
        "updatedAt": "2025-11-27T17:28:14.793Z"
    }
}
```

{% endtab %}
{% endtabs %}

## Delete product

DEL `/stores/{store_id}/products/{product_id}`

This endpoint lets you delete a product.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success": true,
    "message": "Product deleted successfully"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.searchagora.com/store-builder/products.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
