E-commerce

Product Listing JSON Example

A ready-to-use JSON example for a product listing object — includes SKU, pricing, inventory, images, and categories. Perfect for e-commerce catalog APIs. Copy-ready structure.

{
  "id": "prod_A1B2C3D4",
  "sku": "TSHIRT-BLU-L",
  "name": "Classic Cotton T-Shirt",
  "slug": "classic-cotton-t-shirt",
  "brand": "UrbanThreads",
  "description": "100% combed cotton crew-neck T-shirt, pre-shrunk and machine washable.",
  "currency": "INR",
  "basePrice": 599,
  "salePrice": 499,
  "onSale": true,
  "stockQuantity": 143,
  "inStock": true,
  "categories": [
    "Clothing",
    "Men",
    "T-Shirts"
  ],
  "tags": [
    "cotton",
    "casual",
    "summer"
  ],
  "images": [
    {
      "url": "https://cdn.example.com/products/tshirt-blue-front.jpg",
      "alt": "Front view",
      "isPrimary": true
    },
    {
      "url": "https://cdn.example.com/products/tshirt-blue-back.jpg",
      "alt": "Back view",
      "isPrimary": false
    }
  ],
  "variants": [
    {
      "id": "var_S",
      "attribute": "size",
      "value": "S",
      "stockQuantity": 30
    },
    {
      "id": "var_M",
      "attribute": "size",
      "value": "M",
      "stockQuantity": 45
    },
    {
      "id": "var_L",
      "attribute": "size",
      "value": "L",
      "stockQuantity": 40
    },
    {
      "id": "var_XL",
      "attribute": "size",
      "value": "XL",
      "stockQuantity": 28
    }
  ],
  "weight": {
    "value": 0.22,
    "unit": "kg"
  },
  "dimensions": {
    "length": 30,
    "width": 25,
    "height": 2,
    "unit": "cm"
  },
  "rating": {
    "average": 4.5,
    "count": 382
  },
  "createdAt": "2024-06-01T00:00:00Z",
  "updatedAt": "2025-04-20T12:00:00Z"
}

Field Reference

idstringrequiredUnique product identifier with prod_ prefix
skustringrequiredStock Keeping Unit — unique per variant combination
basePricenumberrequiredRegular selling price before any sale discount
salePricenumberoptionalDiscounted price shown when onSale is true
stockQuantityintegerrequiredCurrent available units across all warehouses
categoriesarray<string>requiredHierarchical category breadcrumb for the product
variantsarray<object>optionalSize, color, or other attribute variants with per-variant stock
ratingobjectoptionalAggregate review rating with score and review count

Variants

MinimalBare-minimum product record with only ID, name, price, and stock.
{
  "id": "prod_Z9Y8X7W6",
  "sku": "NOTEBOOK-A5",
  "name": "A5 Spiral Notebook",
  "slug": "a5-spiral-notebook",
  "currency": "INR",
  "basePrice": 149,
  "salePrice": null,
  "onSale": false,
  "stockQuantity": 500,
  "inStock": true,
  "categories": [
    "Stationery"
  ],
  "createdAt": "2025-01-15T00:00:00Z",
  "updatedAt": "2025-01-15T00:00:00Z"
}
ExtendedFull product with variants, SEO metadata, related products, and shipping class.
Extended
{
  "id": "prod_A1B2C3D4",
  "sku": "TSHIRT-BLU-L",
  "name": "Classic Cotton T-Shirt",
  "slug": "classic-cotton-t-shirt",
  "brand": "UrbanThreads",
  "description": "100% combed cotton crew-neck T-shirt, pre-shrunk and machine washable.",
  "currency": "INR",
  "basePrice": 599,
  "salePrice": 499,
  "onSale": true,
  "stockQuantity": 143,
  "inStock": true,
  "categories": [
    "Clothing",
    "Men",
    "T-Shirts"
  ],
  "tags": [
    "cotton",
    "casual",
    "summer"
  ],
  "images": [
    {
      "url": "https://cdn.example.com/products/tshirt-blue-front.jpg",
      "alt": "Front view",
      "isPrimary": true
    },
    {
      "url": "https://cdn.example.com/products/tshirt-blue-back.jpg",
      "alt": "Back view",
      "isPrimary": false
    }
  ],
  "variants": [
    {
      "id": "var_S",
      "attribute": "size",
      "value": "S",
      "stockQuantity": 30
    },
    {
      "id": "var_M",
      "attribute": "size",
      "value": "M",
      "stockQuantity": 45
    },
    {
      "id": "var_L",
      "attribute": "size",
      "value": "L",
      "stockQuantity": 40
    },
    {
      "id": "var_XL",
      "attribute": "size",
      "value": "XL",
      "stockQuantity": 28
    }
  ],
  "weight": {
    "value": 0.22,
    "unit": "kg"
  },
  "dimensions": {
    "length": 30,
    "width": 25,
    "height": 2,
    "unit": "cm"
  },
  "rating": {
    "average": 4.5,
    "count": 382
  },
  "seo": {
    "metaTitle": "Classic Cotton T-Shirt | UrbanThreads",
    "metaDescription": "Shop the Classic Cotton T-Shirt from UrbanThreads. Pre-shrunk, machine washable, available in S–XL.",
    "canonicalUrl": "https://shop.example.com/products/classic-cotton-t-shirt"
  },
  "relatedProductIds": [
    "prod_E5F6G7H8",
    "prod_K1L2M3N4"
  ],
  "shippingClass": "standard",
  "createdAt": "2024-06-01T00:00:00Z",
  "updatedAt": "2025-04-20T12:00:00Z"
}

Common Use Cases

  • Powering a product detail page (PDP) via a GET /products/:id API response
  • Indexing product data into a search engine like Elasticsearch or Algolia
  • Generating structured data (schema.org/Product) for Google Shopping
productcatalogSKUinventorye-commerce

Validate or format this JSON

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

Frequently Asked Questions

For small catalogs, nesting variants inside the product JSON is simpler. For large catalogs with hundreds of SKU combinations, separate /variants endpoints reduce payload size and improve cacheability.

Keep the product record active but set inStock: false and stockQuantity: 0. This preserves SEO URLs and lets you show 'notify me' CTAs rather than 404ing the page.

Store prices as numbers and currency as an ISO 4217 code (INR, USD, EUR). Format the display string client-side using Intl.NumberFormat to respect the user's locale.

Related JSON Examples