How Products are represented in Clerk.io
A product is represented as a product object. A product object is a JSON object where each key-value pair represents a product attribute name and attribute value.
All attribute names must be strings. Attribute values can be:
bool,int,float,stringobject(nested objects are supported)listcontaining any of the above types
Note: object values cannot be used for filtering.
A product can have any number of attributes but must include these Required fields:
| Attribute | Type | Required | Content |
|---|---|---|---|
id | int or str | Required | The product ID. |
name | str | Required | The product name. |
description | str | Required | The product description. |
price | float | Required | The product current selling price. |
list_price | float | Optional | The product original list price. |
image | str | Required | The full URL for the product image. This will be used for thumbnails when displaying products. We recommend a maximum image size of 200x200px. |
url | str | Required | The full URL for the product page. |
categories | list of int or str | Required | A list of the category IDs for the product categories. |
created_at | unix timestamp | Required | Unix timestamp for when the product was created. |
brand | str | Optional | The product brand as a string. |
sku | str | Optional | The product SKU (Stock Keeping Unit). |
stock | int | Optional | Stock count of this product. |
on_sale | bool | Optional | true if this product is on sale, else false. |
gender | str | Optional | Is the product for a specific gender? Add that information. |
color / colors | str or list of str | Optional | Color information about the product. |
keywords | str or list of str | Optional | Keywords or synonyms that should be searchable for the product. |
index | If If Defaults to |
[
{
"id": 135,
"name": "Green Lightsaber",
"description": "Antique Rebel Lightsaber",
"price": 99995.95,
"image": "https://galactic-empire-merch.com/images/a-r-lightsaber.jpg",
"url": "https://galactic-empire-merch.com/antique-rebel-lightsaber",
"brand": "Je’daii",
"categories": [987, 654],
"created_at": 1199145600
},
{
"id": 261,
"name": "Death Star Deluxe",
"description": "Death Star - Guaranteed idiot proof",
"price": 99999999999999.95,
"image": "https://galactic-empire-merch.com/images/death-star.jpg",
"url": "https://galactic-empire-merch.com/death-star",
"brand": "Imperial Inc.",
"categories": [345678],
"created_at": 1197565600
}
]