Skip to content
Kaizena FlowDocs
Search

Search the docs

Storefront API

Read a store's catalogue as one of its markets shows it, keep a cart and hand it to the store's own checkout.

Every call goes to https://kaizenaflow.com/api/storefront/v1/{store}/…, {store} the store's slug. The OpenAPI 3.1 document of the same routes is /api/storefront/v1/openapi.json.

A token is public by design and opens only what any visitor of its market sees; prices, stock and quantity rules are the storefront's own. Nothing is ordered or paid through this API.

Authentication

Send a storefront token (kfs_…, made for one market in the store's Apps and API settings) in the X-Storefront-Token header on every call. It opens only what any visitor of its market sees, so it may sit in a site's own code. Rate limits says how many calls a minute it may make (1,200).

Catalogue

Products, a product's page and the categories, as the token's market shows them.

OperationWhat it does
GET /productsProducts as the token's market lists them: category, tag, sort and limit (at most 48).
GET /products/{handle}One product's page: its variants with their prices, stock and quantity rules.
GET /categoriesThe store's product categories and tags.

Carts

A cart's price now, a cart the store keeps, and the hand-over to the store's own checkout.

OperationWhat it does
POST /cartWhat lines kept on your site cost now, without keeping a cart: { lines: [{ variantId, quantity }] }.
POST /checkoutMakes a cart of the lines given and answers the one-time address of the store's checkout.
POST /cartsMakes a cart the store keeps: { lines? }. Answers its key (cart), which only you hold: keep it secret.
GET /carts/{cart}What the cart holds and costs now: each line's price, available, fitted and status, and a subtotal.
POST /carts/{cart}/linesAdds units of a variant: { variantId, quantity }, put right by the variant's quantity rule and cut to what is available.
PATCH /carts/{cart}/lines/{variantId}Sets a line to exactly { quantity }; 0 removes it. A quantity the rule does not allow is refused.
DELETE /carts/{cart}/lines/{variantId}Removes a line.
POST /carts/{cart}/checkoutHands the cart to the store's checkout: a one-time address for fifteen minutes. The key opens nothing after this.

Made from the API contract, version 1.57This page as Markdown

Was this page helpful?