Products API

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

2 endpointsBase URL https://api.spirestock.com/api/v1

Every request needs an API key or a session token. Last updated .

On this page (2)

GEThttps://api.spirestock.com/api/v1/products

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

Parameters

pagenumber
Page number (default: 1)
limitnumber
Items per page (default: 20, max: 100)
searchstring
Search by product name
statusnumber
Filter by status: 1 (active), 0 (inactive)
Example request
curl "https://api.spirestock.com/api/v1/products?search=milk&status=1" \
  -H "Authorization: Bearer YOUR_TOKEN"
Example response
{
  "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
  }
}

POSThttps://api.spirestock.com/api/v1/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

product_namestringrequired
Product name (unique)
product_class_idnumberrequired
Product class id
product_descriptionstring
Description (alias description)
container_idnumber
Container (alias product_container_id)
packaging_type_idnumber
Packaging type
product_color_codestring
Colour code
product_hsnstring
HSN code; only used when the class has none
Example request
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
{
  "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
  }
}