Skip to main content
This guide walks through how a customer order moves from your app or web channel into Fire spark and then into the merchant kitchen.

The journey in plain terms

  1. Browse — The customer picks a store, channel, and fulfillment id, then loads the composed menu for that combination.
  2. Customize — Use @fire-spark/storefront createSession / toOrderLines to turn a customized product into priced OrderLine rows.
  3. Open cart — Call Create order with scope (and usually empty lines). 201 is a new cart; 202 is the existing OPEN cart for that scope — use the returned id.
  4. Sync cart — Debounce local line changes and Update order with lines + totals.
  5. Validate — Before checkout, call Validate order (or order.validateOrder() in @fire-spark/storefront) so prices and availability are checked against a fresh menu.
  6. Pay, then place — Save tenders with Save payment intent (order.setTenders) or pass a single method on place. Then call Place order (order.placeOrder()). Pass intent_id to lock that draft. Omit it to build one real tender from payment.type plus one REDEMPTION tender per redeem payment_id. There is no cash default: without intent_id or payment.type, place fails with PAYMENT_REQUIRED unless the redeems cover the total (then only REDEMPTION tenders). The cart becomes CLOSED and fulfillment starts.
  7. Track — Subscribe with realtime.listenOrder({ orderId }) (see Issue realtime token) or poll Get order fulfillment for checkout_state, visited states, and current_node_ids. On history, use List order fulfillments instead of one GET per order. Get order still exposes fulfillment_status. How the overlay waits is configured on the fulfillment workflow.

Prerequisites

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

Then PATCH 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

On 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 new OPEN 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.

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