Guides

How an order works

The path from a question to a collected order, the status an order is in at each step, and the names that identify things along the way.

View as Markdown

#The five steps

  1. Ask. The buyer says what they want and roughly where they are.
  2. Review. The assistant finds a shop that is open, builds the cart and shows the items, prices, tax and total.
  3. Approve. Nothing is bought until the buyer approves. Each approval covers one exact cart: if the cart changes, the buyer approves again. See Approval.
  4. Hold. The order is placed and the card is held for the total. It is not charged yet. See Payment.
  5. Pick up. The shop prepares the order and marks it ready. The buyer says their pickup code at the counter, and the card is charged when the shop hands the order over. See Pickup.

#Which tool does what

StepToolChanges anything?
Findproduct_search, price_compareNo
Buildcart_build, or cart_create and cart_addA cart. Nothing is reserved or charged.
Read backcart_getNo
Ask the buyercart_approveAsks. The buyer answers.
Ordercheckout_createCreates the order, holds stock and holds the card.
Followuser.orders.statusNo

#Order statuses

user.orders.status reports each open order's status and a ready-to-send sentence in status_text.

StatusWhat it meansWhat to tell the buyer
acceptedThe order was sent to the shop and nobody there has started it. It is not an approval by the shop."Your order was sent to the shop." Never "the shop approved it".
preparingSomeone at the shop has started the order.It is being prepared. Free cancellation has ended.
ready_for_pickupThe shop marked it ready.Go to the shop and say your pickup code.

An order also ends as collected, cancelled or disputed. An order can stay open for up to 48 hours; keep_polling says whether there is still anything to watch.

#The clocks

ClockLengthWhat happens when it runs out
The shop answers a new order10 minutesThe order is cancelled automatically, the hold is released and nothing is charged.
The buyer decides about a missing item10 minutesThe order goes ahead without the missing item. See Missing items.
Reporting a problem after pickup24 hoursThe window closes and the shop's payout is no longer held.

#Names you will see

NameWhat it identifies
shop_id, merchant_idA shop, from a search result.
product_idOne offer at one shop.
cart_idA cart. One cart holds one shop.
line_idOne line of a cart, when the same item appears twice with different options.
order_idAn order, after checkout_create.
pickup_codeThe 4-digit code the buyer says at the counter.
approval_urlThe page where the buyer approves, signed in as themselves.

Treat every identifier as an opaque string. Use the one returned for the current step; do not rebuild one from an earlier answer.

#Read state, never remember it

Call the tool again instead of answering from an earlier reply. A card that was missing a minute ago may be on file now, and a price may have moved.