Skip to content

API

Catalogue and stock

Everything a customer asks before they buy: what is sold, in which sizes and colours, at what price, whether it is in stock and how many are left, and what it looks like.

Browse and search products

GET/catalog/products

Active products, alphabetically, each with all of its variants. Search matches the product’s name, SKU and description, and each variant’s SKU, barcode, name and option values — so search=red finds every product that comes in red.

Query parameters

searchstring
Up to 100 characters. Blank lists everything.
categorystring
A category’s id, slug or name. Includes its sub-categories, so apparel also returns T-shirts filed under it.
brandstring
A brand’s id, slug or name.
in_stockboolean
true returns only products with at least one variant available to order now.
limitinteger
1–50, default 20.
offsetinteger
Products to skip, default 0. Keep paging while has_more is true.
curl "https://www.chatcom.in/api/v1/urbanchat/catalog/products?search=t-shirt&in_stock=true&limit=20" \
  -H "X-API-KEY: $UC_API_KEY"
200 OK
{
  "data": [
    {
      "product_id": "cmg4x2k1p0001qz8h3j5v7n2a",
      "sku": "TSHIRT",
      "name": "Cotton T-shirt",
      "description": "180 GSM combed cotton, regular fit.",
      "category": {
        "id": "cmg4x1c0a0001",
        "name": "T-shirts",
        "slug": "t-shirts",
        "parent": "Apparel"
      },
      "brand": {
        "id": "cmg4x1b0a0001",
        "name": "Acme"
      },
      "unit": "PCS",
      "hsn_code": "6109",
      "tax_rate": "5",
      "currency": "INR",
      "price_range": {
        "min": "499.00",
        "max": "549.00"
      },
      "options": {
        "size": [
          "M",
          "L"
        ],
        "colour": [
          "Red",
          "Blue"
        ]
      },
      "available": "18",
      "available_total": "31",
      "in_stock": true,
      "image_url": "https://…/object/sign/product-images/…?token=…",
      "variants": [
        {
          "variant_id": "cmg4x2k1p0002qz8h9w3e4r5t",
          "sku": "TSHIRT-RED-M",
          "barcode": "8901234567890",
          "name": "Red / M",
          "attributes": {
            "colour": "Red",
            "size": "M"
          },
          "selling_price": "499.00",
          "mrp": "699.00",
          "available": "12",
          "available_total": "20",
          "in_stock": true,
          "image_url": "https://…/object/sign/product-images/…?token=…"
        },
        {
          "variant_id": "cmg4x2k1p0003qz8hq2w8e7r6",
          "sku": "TSHIRT-BLU-L",
          "barcode": null,
          "name": "Blue / L",
          "attributes": {
            "colour": "Blue",
            "size": "L"
          },
          "selling_price": "549.00",
          "mrp": "749.00",
          "available": "6",
          "available_total": "11",
          "in_stock": true,
          "image_url": "https://…/object/sign/product-images/…?token=…"
        }
      ]
    }
  ],
  "count": 1,
  "total": 1,
  "limit": 20,
  "offset": 0,
  "has_more": false
}

The product object

product_idstring
The product’s id.
skustring
The product’s own SKU. Not orderable by itself — order a variant.
name, descriptionstring
As the company wrote them. description may be null.
categoryobject | null
id, name, slug and the parent category’s name, if any.
brandobject | null
id and name.
unitstring
The selling unit, e.g. PCS, KG.
hsn_codestring | null
The GST HSN code.
tax_ratedecimal string
GST percentage, e.g. "5". Prices already include it.
price_rangeobject
Lowest and highest variant selling_price.
optionsobject
Each option and its values across variants, e.g. { "size": ["M", "L"], "colour": ["Red", "Blue"] }. Empty for a product with no options. Ask the customer to choose one value of each, then pick the variant whose attributes match.
availabledecimal string
Units available to order now, across all variants.
available_totaldecimal string
Units across every warehouse and store, including ones orders do not ship from.
in_stockboolean
Whether any variant can be ordered now.
image_urlstring | null
The main photo. A signed link valid for 10 minutes — fetch it, do not store it.
variantsarray
Every active variant, described below.

The variant object

variant_idstring
The variant’s id. Also accepted by POST /orders.
skustring
What to send as items[].product_id when ordering.
barcodestring | null
EAN/UPC, if the company recorded one. Also accepted when ordering.
namestring
A label for the variant, e.g. Red / M.
attributesobject
This variant’s option values, e.g. { "colour": "Red", "size": "M" }.
selling_pricedecimal string
Price per unit in INR, GST included. What the customer pays.
mrpdecimal string
Maximum retail price, for showing a discount.
availabledecimal string
Units that can be ordered now: stock at the location WhatsApp orders ship from, minus what confirmed orders have already reserved. Never negative.
available_totaldecimal string
The same across every location.
in_stockboolean
available is above zero.
image_urlstring | null
This variant’s own photo if it has one, else the product’s.

One product in full

GET/catalog/products/{id}

{id} is whatever you hold: the product’s id or SKU, or any of its variants’ SKU, id or barcode. The response is the product object plus:

matched_variant_idstring | null
When the id named one variant, which one — so a scanned barcode lands on the right size.
imagesarray
Every photo: url (valid 10 minutes), alt, and variant_id when a photo belongs to one variant.
curl "https://www.chatcom.in/api/v1/urbanchat/catalog/products/TSHIRT-RED-M" \
  -H "X-API-KEY: $UC_API_KEY"
200 OK
{
  "data": {
    "product_id": "cmg4x2k1p0001qz8h3j5v7n2a",
    "sku": "TSHIRT",
    "name": "Cotton T-shirt",
    "description": "180 GSM combed cotton, regular fit.",
    "category": {
      "id": "cmg4x1c0a0001",
      "name": "T-shirts",
      "slug": "t-shirts",
      "parent": "Apparel"
    },
    "brand": {
      "id": "cmg4x1b0a0001",
      "name": "Acme"
    },
    "unit": "PCS",
    "hsn_code": "6109",
    "tax_rate": "5",
    "currency": "INR",
    "price_range": {
      "min": "499.00",
      "max": "549.00"
    },
    "options": {
      "size": [
        "M",
        "L"
      ],
      "colour": [
        "Red",
        "Blue"
      ]
    },
    "available": "18",
    "available_total": "31",
    "in_stock": true,
    "image_url": "https://…/object/sign/product-images/…?token=…",
    "variants": [
      {
        "variant_id": "cmg4x2k1p0002qz8h9w3e4r5t",
        "sku": "TSHIRT-RED-M",
        "barcode": "8901234567890",
        "name": "Red / M",
        "attributes": {
          "colour": "Red",
          "size": "M"
        },
        "selling_price": "499.00",
        "mrp": "699.00",
        "available": "12",
        "available_total": "20",
        "in_stock": true,
        "image_url": "https://…/object/sign/product-images/…?token=…"
      },
      {
        "variant_id": "cmg4x2k1p0003qz8hq2w8e7r6",
        "sku": "TSHIRT-BLU-L",
        "barcode": null,
        "name": "Blue / L",
        "attributes": {
          "colour": "Blue",
          "size": "L"
        },
        "selling_price": "549.00",
        "mrp": "749.00",
        "available": "6",
        "available_total": "11",
        "in_stock": true,
        "image_url": "https://…/object/sign/product-images/…?token=…"
      }
    ],
    "matched_variant_id": "cmg4x2k1p0002qz8h9w3e4r5t",
    "images": [
      {
        "url": "https://…/object/sign/product-images/…?token=…",
        "alt": "Front",
        "variant_id": null
      },
      {
        "url": "https://…/object/sign/product-images/…?token=…",
        "alt": "Red, front",
        "variant_id": "cmg4x2k1p0002qz8h9w3e4r5t"
      }
    ]
  }
}

An unknown id, an inactive product or another company’s product is 404 not_found.

Categories and brands

GET/catalog/categories

What the company sells, in outline — for “what do you have?”. Each category has its parent_id (null at the top level) and the number of active products filed directly under it; each brand has its product count. Pass a slug to /catalog/products?category= or ?brand=.

curl "https://www.chatcom.in/api/v1/urbanchat/catalog/categories" \
  -H "X-API-KEY: $UC_API_KEY"
200 OK
{
  "data": {
    "categories": [
      {
        "id": "cmg4x1c0a0000",
        "name": "Apparel",
        "slug": "apparel",
        "parent_id": null,
        "product_count": 4
      },
      {
        "id": "cmg4x1c0a0001",
        "name": "T-shirts",
        "slug": "t-shirts",
        "parent_id": "cmg4x1c0a0000",
        "product_count": 12
      }
    ],
    "brands": [
      {
        "id": "cmg4x1b0a0001",
        "name": "Acme",
        "slug": "acme",
        "product_count": 16
      }
    ]
  }
}