---
title: "Products API — SpireStock REST API"
description: "Read and manage the product catalogue, including variants, SKUs, pricing and the master data that orders reference."
source: https://developers.spirestock.com/api-reference/products
---

# Products API

Read and manage the product catalogue, including variants, SKUs, pricing and the master data that orders reference.

Base URL: `https://api.spirestock.com/api/v1`. Every request needs an API key (`X-API-Key`) or a session token (`Authorization: Bearer`); see https://developers.spirestock.com/api-reference/auth.

## Endpoints

- [GET /products](https://developers.spirestock.com/api-reference/products#get-products)
- [POST /products](https://developers.spirestock.com/api-reference/products#post-products)

## GET /products

List all products in the catalog with optional search filter. Products include their class and variants.

**Parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | number | no | Page number (default: 1) |
| `limit` | number | no | Items per page (default: 20, max: 100) |
| `search` | string | no | Search by product name |
| `status` | number | no | Filter by status: 1 (active), 0 (inactive) |

**Example request**

```bash
curl "https://api.spirestock.com/api/v1/products?search=milk&status=1" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

**Example response**

```json
{
  "response_code": 200,
  "data": [
    {
      "id": 1,
      "organization_id": 6,
      "product_name": "Full Cream Milk",
      "product_class_id": 1,
      "product_hsn": "0401",
      "product_color_code": "#FFFFFF",
      "product_description": "Fresh full cream milk",
      "container_id": null,
      "packaging_type_id": null,
      "product_image": null,
      "status": 1,
      "product_class_name": "Milk",
      "description": "Toned milk in pouches",
      "order_of": null,
      "createdAt": "2023-02-15T09:48:43.000Z",
      "updatedAt": "2023-02-15T09:48:43.000Z",
      "sp_product_class": {
        "id": 42,
        "product_class": "Milk",
        "unit": "L"
      },
      "variants": [
        {
          "id": 526,
          "organization_id": 6,
          "product_id": 233,
          "item_sku_code": "SKU-001",
          "variant_name": "Toned Milk 400ML",
          "variant_size": "0.4",
          "variant_quantity": 400,
          "mrp": "15.00",
          "sp": "8.50",
          "container_quantity": 24,
          "packaging_quantity": 0,
          "is_bulk_pack": false,
          "production_unit_id": 18,
          "barcode_value": null,
          "barcode_format": "EAN13",
          "status": 1,
          "product_name": "Toned Milk",
          "product_class_id": 42,
          "container_id": 43,
          "container_name": "CRATE",
          "packaging_type_id": 43,
          "packaging_type_name": "PCS",
          "variant_unit_id": 18,
          "variant_unit_name": "ML",
          "largest_unit_name": "L",
          "order_of": null,
          "no_of_pouch": 24,
          "container_size": "9.60 L/CRATE",
          "included_in_scheme": null,
          "container_mrp": "360.00",
          "sp_distributor": "8.50",
          "container_sp_distributor": "204.00",
          "sp_superstockist": "8.50",
          "container_sp_superstockist": "204.00",
          "sp_employee": "8.50",
          "container_sp_employee": "204.00",
          "valid_from": "2023-02-16",
          "valid_to": "2024-02-29",
          "gst": 5,
          "is_allow_in_packaging": 1,
          "is_allow_in_container": 1,
          "tally_export_type": 1,
          "is_tally_export_uom": 1,
          "sap_code": "MAT-001",
          "production_unit_ids": "18",
          "createdAt": "2023-02-16T07:19:20.000Z",
          "updatedAt": "2023-02-16T07:19:20.000Z"
        }
      ]
    }
  ],
  "pagination": {
    "total": 65,
    "page": 1,
    "limit": 20,
    "total_pages": 4
  }
}
```

## POST /products

Add a product to the catalogue. product_class_name and product_hsn are copied from the product class (a product_hsn you send is used only when the class has none). Variants are created separately with POST /products/{id}/variants; a variants array in this body is ignored. Product names are unique (409 Product name already exists).

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `product_name` | string | yes | Product name (unique) |
| `product_class_id` | number | yes | Product class id |
| `product_description` | string | no | Description (alias description) |
| `container_id` | number | no | Container (alias product_container_id) |
| `packaging_type_id` | number | no | Packaging type |
| `product_color_code` | string | no | Colour code |
| `product_hsn` | string | no | HSN code; only used when the class has none |

**Example request**

```bash
curl -X POST https://api.spirestock.com/api/v1/products \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product_name": "Toned Milk",
    "product_class_id": 42,
    "product_description": "Toned milk in pouches"
  }'
```

**Example response**

```json
{
  "response_code": 201,
  "message": "Record has been saved successfully.",
  "data": {
    "organization_id": 6,
    "id": 66,
    "product_name": "Toned Milk",
    "product_description": "Toned milk in pouches",
    "description": "Toned milk in pouches",
    "product_class_id": 1,
    "product_class_name": "Milk",
    "product_hsn": "0401",
    "status": 1,
    "updatedAt": "2026-10-22T09:02:36.707Z",
    "createdAt": "2026-10-22T09:02:36.707Z",
    "product_color_code": null,
    "container_id": null,
    "packaging_type_id": null,
    "product_image": null,
    "order_of": null
  }
}
```
