Products

:catalogId accepts either the Meta catalog ID or the stringified internal Catalog_Id.

List categories

GET /api/external/catalogs/:catalogId/categories

Auth: Authorization: Bearer ck_<api_key> (required)

Query parameters

FieldRequiredTypeDescription
inStockOnlyNostringDefaults to in-stock only. Pass false or 0 to include out-of-stock products.

Response example

{
  "success": true,
  "catalogId": "900000000000003",
  "categories": [
    { "slug": "apparel", "name": "Apparel", "productCount": 5 }
  ],
  "interactiveListSections": [
    {
      "title": "Categories",
      "rows": [
        { "id": "apparel", "title": "Apparel", "description": "5 products" }
      ]
    }
  ]
}

List products

GET /api/external/catalogs/:catalogId/products

Auth: Authorization: Bearer ck_<api_key> (required)

Query parameters

FieldRequiredTypeDescription
pageNonumberPage number (default 1)
limitNonumberItems per page (default 50)
searchNostringFilter by product name, description, or retailer ID
availabilityNostringFilter by availability (e.g. in stock)
categoryNostringWhen set, returns category-scoped results with resolvedCategory and productRetailerIds

Response example

{
  "success": true,
  "products": [
    {
      "Product_Id": "101",
      "Meta_Product_Id": "ext_1720856400000",
      "Product_Name": "Demo Cotton T-Shirt",
      "Description": "Soft cotton, size M",
      "Retailer_ID": "SKU-DEMO-001",
      "Currency": "INR",
      "Price": 499.00,
      "Image_URL": "https://example.com/demo-shirt.jpg",
      "Product_URL": "https://example.com/products/demo-shirt",
      "Availability": "in stock",
      "Category": "Apparel",
      "Brand": "ChatYug Demo",
      "Inventory": 100
    }
  ],
  "pagination": { "page": 1, "limit": 50, "total": 1, "pages": 1 }
}

Create product

POST /api/external/catalogs/:catalogId/products

Auth: Authorization: Bearer ck_<api_key> (required)

Request parameters

FieldRequiredTypeDescription
productNameYesstringProduct title
priceYesnumberPrice in currency units (e.g. 499 for ₹499)
descriptionNostringProduct description
currencyNostringDefault INR
imageUrlNostringPublic image URL
productUrlNostringProduct page URL
availabilityNostringDefault in stock
retailerIdNostringSKU / retailer ID. Auto-generated as SKU-{timestamp} if omitted.
categoryNostringProduct category
brandNostringBrand name
inventoryNonumberStock count

Response example

{
  "success": true,
  "message": "Product created successfully",
  "data": {
    "productId": "101",
    "metaProductId": "ext_1720856400000",
    "retailerId": "SKU-DEMO-001",
    "productName": "Demo Cotton T-Shirt",
    "price": 499,
    "currency": "INR"
  }
}

Update product

PUT /api/external/catalogs/:catalogId/products/:retailerId

Auth: Authorization: Bearer ck_<api_key> (required)

Request parameters

Same fields as create — all optional in the body. :retailerId in the path identifies the product.

FieldRequiredTypeDescription
productNameNostringUpdated title
descriptionNostringUpdated description
priceNonumberUpdated price
currencyNostringCurrency code
imageUrlNostringUpdated image URL
productUrlNostringUpdated product URL
availabilityNostringAvailability status
categoryNostringCategory
brandNostringBrand
inventoryNonumberStock count

Response example

{
  "success": true,
  "message": "Product updated successfully",
  "data": { "productId": "101", "retailerId": "SKU-DEMO-001" }
}

Code samples — create product

curl -X POST https://chatyug.com/api/external/catalogs/900000000000003/products \
  -H "Authorization: Bearer ck_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "productName": "Demo Cotton T-Shirt",
    "price": 499,
    "currency": "INR",
    "retailerId": "SKU-DEMO-001",
    "availability": "in stock"
  }'
const axios = require('axios');

await axios.post('https://chatyug.com/api/external/catalogs/900000000000003/products', {
  productName: 'Demo Cotton T-Shirt',
  price: 499,
  currency: 'INR',
  retailerId: 'SKU-DEMO-001',
  availability: 'in stock'
}, { headers: { Authorization: 'Bearer ck_your_api_key_here' } });
import requests

requests.post('https://chatyug.com/api/external/catalogs/900000000000003/products', json={
    'productName': 'Demo Cotton T-Shirt',
    'price': 499,
    'currency': 'INR',
    'retailerId': 'SKU-DEMO-001',
    'availability': 'in stock'
}, headers={'Authorization': 'Bearer ck_your_api_key_here'})
$client = new GuzzleHttp\Client();
$client->post('https://chatyug.com/api/external/catalogs/900000000000003/products', [
    'headers' => ['Authorization' => 'Bearer ck_your_api_key_here'],
    'json' => [
        'productName' => 'Demo Cotton T-Shirt',
        'price' => 499,
        'currency' => 'INR',
        'retailerId' => 'SKU-DEMO-001',
        'availability' => 'in stock'
    ]
]);