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 corresponds to a product attribute name, attribute value.

All attribute names must be strings and values can be either bool, int, float, string or a list of the former.

A product can have any number of attributes but must at least contain the following marked as Required:

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.

age

int

Optional

The number of days since the product was created.

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 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
  }
]