Products
Products, variants, options, categories, and collections.
A product is what a buyer browses. A variant is what they buy: each line in a cart or order points to a variant, and each variant has its own SKU, prices, and stock.
Products and variants
- A product has options (for example Size and Color), each with a list of values.
- A variant picks one value for every option of its product. No two variants of a product share the same combination.
- A product with no real options still has one variant.
- Prices and stock belong to variants, never to the product. See Pricing and Inventory.
Status
| Status | Visible on store routes |
|---|---|
draft | No |
proposed | No |
published | Yes |
rejected | No |
Store routes only return published products that are in one of the sales channels of the publishable API key.
Organising the catalog
| Concept | Rules |
|---|---|
| Category | A tree. A product can be in many categories. Store routes hide categories that are inactive or marked internal. |
| Collection | A flat group. A product is in at most one collection. |
| Type | One per product, for example "Fasteners". |
| Tag | Free labels. A product can have many. |
All four can be used as promotion conditions.
Reading products in a storefront
Variant prices aren't returned by default. Sending region_id adds calculated_price on its own. You can also ask for *variants.calculated_price in fields; the region then comes from region_id, from the cart if you send cart_id, or else from the store's default region. Add country_code for amounts with tax.
curl "http://localhost:9000/store/products?region_id=reg_...&fields=*variants.calculated_price,+variants.inventory_quantity" \
-H "x-publishable-api-key: pk_..."Send the customer's token too. A signed-in customer gets their customer group prices, which is how company prices reach the storefront.
- List products and get a product (store)
- List categories and collections (store)
- Create a product and import products (admin)