The journey in plain terms
- Browse — The customer picks a store, channel, and fulfillment id, then loads the composed menu for that combination.
- Customize — Use
@fire-spark/storefrontcreateSession/toOrderLinesto turn a customized product into pricedOrderLinerows. - Open cart — Call Create order with scope (and usually empty
lines).201is a new cart;202is the existingOPENcart for that scope — use the returnedid. - Sync cart — Debounce local line changes and Update order with
lines+totals. - Validate — Before checkout, call Validate order (or
order.validateOrder()in@fire-spark/storefront) so prices and availability are checked against a fresh menu. - Pay, then place — Save tenders with Save payment intent (
order.setTenders) or pass a single method on place. Then call Place order (order.placeOrder()). Passintent_idto lock that draft. Omit it to build one real tender frompayment.typeplus oneREDEMPTIONtender per redeempayment_id. There is no cash default: withoutintent_idorpayment.type, place fails withPAYMENT_REQUIREDunless the redeems cover the total (then onlyREDEMPTIONtenders). The cart becomesCLOSEDand fulfillment starts. - Track — Subscribe with
realtime.listenOrder({ orderId })(see Issue realtime token) or poll Get order fulfillment forcheckout_state, visited states, andcurrent_node_ids. On history, use List order fulfillments instead of one GET per order. Get order still exposesfulfillment_status. How the overlay waits is configured on the fulfillment workflow.
Prerequisites
- Customer registered and authenticated via Token exchange
- Store, channel, and fulfillment ids from List stores and List fulfillment
- Menu loaded for the same store, channel, and fulfillment triple
Step 1 — Build priced lines from customization
Step 2 — Choose ids before create
Assign the order id on your server before calling POST. This makes retries safe if the client loses connectivity.Step 3 — Create then update the order
lines and totals as the cart changes. The headless Order class in @fire-spark/storefront debounces those updates for you.
Step 4 — Validate before checkout
422, use details.issues and details.lines to update the cart UI. See Validate order for every issue code.
Step 5 — Place the order
placeOrder() without intent_id saves the draft and places with it. placeOrder({ payment }) is the single-method shortcut. A rejected cart sync surfaces as OrderSyncRejectedError and nothing is placed; with no real tender it throws OrderPaymentRequiredError. 201 starts fulfillment. 202 means a place is already running. 409 means the order was already placed.
Step 6 — Show status to the customer
Poll Get order fulfillment for visited states (entered_at), current_node_ids, and milestone progress. For a list of closed orders, call List order fulfillments once. Get order still exposes fulfillment_status.
Kitchen and POS advance the walker with Update order status.
Step 7 — Cancel or refund
If the customer cancels before fulfillment, call Cancel order. That interrupts a running fulfillment workflow. On a kiosk, Cancel during the checkout-release wait calls Reopen order: unpaid tenders are voided and a newOPEN order comes back. Optional order_id can be any id from genId (genOrderId is one option and still returns ord-<store>-<hash>); omit it to keep the generated id. genId().hash(length, format) uses a hash of at least 8 characters (default 12; alphanumeric, numeric, or alphabetic). genId().literal("BB21921").hash(8, "numeric").build() is an id like BB2192100000001. After the order is fulfilled, Refund order is available for 24 hours. A single tender is refunded with Refund tender.
Related endpoints
Create order
Open an order with scope
Update order
Sync lines and totals
Validate order
Check lines against a fresh menu
Place order
Close the cart and start fulfillment
Save payment intent
Tenders before place
Reopen order
Void unpaid tenders and start a new cart
Cancel order
Stop fulfillment before the order is fulfilled
Reorder
Clone a fulfilled order into an OPEN cart
Refund order
Refund a fulfilled order within 24 hours
Get fulfillment
Visited states and milestones
List fulfillments
History without N+1 requests
List orders
Order history
Orders concept
Commercial overview