Coming soon

The Storefront API isn’t open to developers yet. This is a preview of the docs, and details may change before launch.

Guides

Cart and checkout

Carts

Guests: keep the cart in the browser (variant IDs and quantities only) and price it with a quote. The SDK's GuestCart does the storage:

const cart = new GuestCart(localStorage);
cart.add(variantId, 1);
const quote = await client.cart.quote({ items: cart.items() });

Logged-in shoppers: PATCH /v1/me/cart { items: [{ variant_id, quantity }] } sets quantities (0 removes); GET /v1/me/cart returns the priced cart. This is the same cart the shopper sees on the store's own website. Items that became unavailable are listed in unavailable_variant_ids and left out of the totals.

Quotes

POST /v1/cart/quote prices any list of items with the store's real prices, tax, coupons and shipping:

{ "items": [{ "variant_id": "var_…", "quantity": 2 }],
  "coupon_codes": ["DIWALI10"],
  "country_code": "IN", "state_code": "KL", "pincode": "682001",
  "shipping_option_id": "ship_…", "cash_on_delivery": false }

The response has items (each with unit_price, subtotal, discount, tax, total), subtotal, discount, tax, shipping, cash_on_delivery_fee, total, the coupon (and whether it applies), shipping_options and unavailable_variant_ids. Send an address to see shipping options and prices. Logged-in shoppers can pass address_id instead.

Guest quotes need the store's guest checkout to be on (GET /v1/store → checkout.guest_checkout_enabled).

Checkout

POST /v1/checkouts creates the order. Send an Idempotency-Key header (the SDK does).

Guest:

{ "items": [{ "variant_id": "var_…", "quantity": 2 }],
  "email": "priya@example.com", "phone": "9876543210",
  "address": { "name": "Priya", "phone": "9876543210", "line": "12 MG Road", "city": "Kochi",
               "state_code": "KL", "country_code": "IN", "pincode": "682001" },
  "shipping_option_id": "ship_…", "coupon_codes": ["DIWALI10"],
  "cash_on_delivery": false, "return_url": "https://shop.example.com/order/return" }

Logged-in shopper (with X-Customer-Token): their saved cart is checked out; send address_id plus the optional fields above.

Storepecker re-prices everything, reserves stock and sets up the payment. The response:

{ "order": { "id": "ord_…", "number": 1042, "status": "payment_pending", "total": { "amount": 109800, "currency": "INR" }, "…": "…" },
  "payment": { "razorpay": { "order_id": "order_N…", "key_id": "rzp_live_…", "amount": 109800, "currency": "INR" },
               "stripe": null, "phonepe": null },
  "order_access_token": "eyJ…" }

Taking the payment

Open the gateway's own widget with the details in payment; card and UPI data never touch your code.

GatewayWhat to do
razorpayLoad https://checkout.razorpay.com/v1/checkout.js, then new Razorpay({ key: key_id, order_id, amount, currency, handler }).open()
stripeRedirect to payment_link_url, or confirm client_secret with Stripe.js using publishable_key
phonepeRedirect to redirect_url
none (cash on delivery)Show the order

return_url (for redirecting gateways) must be on your app's allowed websites.

Confirming the order

Storepecker marks the order paid when the gateway confirms it, not when the widget says so. Show the order from:

GET /v1/orders/{id}       with X-Order-Token: <order_access_token>   (guests, valid 30 days)
                          or X-Customer-Token                         (the shopper who placed it)

While paid is false and status is payment_pending, poll every few seconds. Statuses: payment_pending, paid, confirmed, packed, shipped, delivered, cancelled, returned, refunded, failed.

Not available yet

Product customisation inputs, pre-orders, service bookings, digital downloads, and cancelling or returning an order through the API.