Accept, preparing, ready
The kitchen's taps move the customer's live tracking and tell the rider when to come in. Three calls, always forward.
#The flow
| Kitchen tap | Call | Order status after |
|---|---|---|
| Accept | POST /v1/orders/{id}/accept | confirmed |
| Start cooking | POST /v1/orders/{id}/preparing | processing |
| Packed | POST /v1/orders/{id}/ready | handover |
Moves only go forward. Repeating one, or calling it on an order that is already further, answers 200 with "changed": false, so a retry after a network drop is safe.
#Accept
POST /v1/orders/104812/accept
{ "prep_minutes": 15, "your_order_ref": "KOT 48" }
200
{ "data": { "order_id": 104812, "action": "accept", "status": "confirmed",
"changed": true, "prep_minutes": 15 } }prep_minutes (1 to 600) is how long the kitchen needs. Without it we use the store's usual prep time. your_order_ref (1 to 64 characters) is your bill or KOT number: we echo it in the order, in order events and in payout.paid, so your books match. A scheduled order cannot be accepted before its time: 409 scheduled_not_active.
#When the rider confirms first
For some delivery orders a Laayo rider confirms first. order.updated with type rider_assigned (and rider_accepted) arrives when a rider takes the delivery offer; that is not the confirmation yet. Until the rider confirms, accept, preparing and ready return 409 rider_confirms_first. The confirmation arrives as order.updated with type accepted (order status confirmed): the order is accepted then, so go on with preparing and ready. Takeaway orders, and stores with their own delivery, are accepted by the restaurant as usual.
#Preparing
POST /v1/orders/104812/preparing
200
{ "data": { "order_id": 104812, "action": "preparing", "status": "processing", "changed": true } }Send prep_minutes again here if the time changed.
#Ready
POST /v1/orders/104812/ready
200
{ "data": { "order_id": 104812, "action": "ready", "status": "handover", "changed": true,
"rider": { "name": "Ram", "arrived_at_store": false, "eta_minutes": 4 } } }The customer sees it at once. When a rider is assigned, the answer carries their name and how far away they are; show it on the KOT screen so the counter knows who to hand it to.
#Rejecting an order
Rejecting orders from the POS is coming. In v1, POST /v1/orders/{id}/reject always answers 501 not_implemented. The restaurant denies an order in the Laayo vendor app.
#When a move is refused
- 409 accept_first: preparing or ready before accept. Accept first.
- 409 order_closed: the order is delivered, cancelled or refunded. Stop cooking if it was cancelled.
- 409 order_changed: someone moved it at the same moment. Read the order and retry if it still makes sense.
- 409 needs_laayo_app: this order needs a step only the Laayo app can do. Ask the restaurant to move it there.
- 409 owner_takeover: the owner is using Laayo's own controls. Order moves wait until the time in the message.
After ready, order.updated events follow the rider and the delivery. You do not need to send anything. Taps in the Laayo vendor app move the same order, and you get those events too. See Events.