Skip to content

Shop-to-order flow (web) ​

One journey from the store picker to a paid order. It starts with two calls: the storefront loads its brand key, then selects a hub.

Play the flow ​

Two paths: a signed-in customer, and a guest, who places the order through a different endpoint and gets a customer token back from it.

1 / 14
shop.example.com/
shop · rewards · scan
choose a store
stock, prices and payment options depend on the store
Mission Stpickup · 0.8 mi›
Delivery to 94105delivery›
Ship anywhereshipment›

Page not designed yet — drawn from what the documented flow requires.

States ​

What happens to the order after PLACED — fulfilment steps, cancellation, which types can be cancelled when — is the order's own lifecycle, on Orders and checkout.

API calls by stage ​

StageActionAPI callAccess
1Storefront loadsPOST /api/v1/tenantOrigin
2Choose a storePUT /api/v1/set-hub — hubId, roomId, type, all requiredOrigin + Brand key
3BrowseGET /api/v1/user/available-catalog · guest: GET /api/v1/available-catalogOrigin + Brand key + Hub selected (+ Customer)
4Product pageGET /api/v1/getproduct/:slugOrigin + Brand key
5Add to bag, change quantityPUT /api/v1/user/syncBag · guest: PUT /api/v1/syncBag — the whole bag[] every timeOrigin + Brand key + Hub selected (+ Customer)
6Create the orderPOST /api/v1/user/createOrder · guest: POST /api/v1/user/create-orderOrigin + Brand key + Hub selected (+ Customer)
7Payment optionsGET /api/v1/payment/gatewaysOrigin + Brand key + Hub selected
8PayPOST /api/v1/user/payment/link/:paymentGatewayId — orderId, currencyOrigin + Brand key + Hub selected + Customer
9Provider returnsNot a storefront call: the provider redirects to the backend, which updates the order—
10Order pageGET /api/v1/user/order/:orderIdOrigin + Customer

The hosted link is one of several ways to pay. The storefront can instead collect a card or bank token itself and send it to a gateway's own endpoint — Stripe, Square, NMI, Authorize.Net, Apple Pay or AeroPay — each of which moves the order to PLACED on success.

What carries this flow ​

  • The hub key replaces the brand key. set-hub returns a new apiKey; send that as api-key on every call marked Hub selected. Stock, prices and payment gateways all come from the hub the key carries.
  • syncBag is the whole cart. There is no add-line or get-cart call: send the complete bag, draw what comes back.
  • The order exists before the money does. createOrder runs when the customer leaves the details step. A prepaid order with something to pay waits in PAYMENT_PENDING until the provider calls back; the order-placed and payment-pending notifications are sent accordingly.
  • A guest order returns a customer token. create-order reuses a customer matching the email or phone, or creates one, and the response carries a token for that customer. The payment link is customer-only, so a guest pays with that token.
  • An address is required for every order type except PICKUP.

Batch platform, Shopify app and API documentation