Product

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, string
  • object (nested objects are supported)
  • list containing 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:

AttributeTypeRequiredContent
idint or strRequiredThe product ID.
namestrRequiredThe product name.
descriptionstrRequiredThe product description.
pricefloatRequiredThe product current selling price.
list_pricefloatOptionalThe product original list price.
imagestrRequiredThe full URL for the product image. This will be used for thumbnails when displaying products. We recommend a maximum image size of 200x200px.
urlstrRequiredThe full URL for the product page.
categorieslist of int or strRequiredA list of the category IDs for the product categories.
created_atunix timestampRequiredUnix timestamp for when the product was created.
brandstrOptionalThe product brand as a string.
skustrOptionalThe product SKU (Stock Keeping Unit).
stockintOptionalStock count of this product.
on_saleboolOptionaltrue if this product is on sale, else false.
genderstrOptionalIs the product for a specific gender? Add that information.
color / colorsstr or list of strOptionalColor information about the product.
keywordsstr or list of strOptionalKeywords or synonyms that should be searchable for the product.
index

If false, the product will not be indexed and thus not shown in any results. It will still be kept in the database as historic data so results like alternatives and personal recommendations can be based on it.

If true, the product will be indexed as normal.

Defaults to true if not sent.

[
  {
    "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
  }
]