Let's Pizza Developersv1.0.0

Get started

Order lifecycle

Every order follows one state machine. A move the table does not allow is refused, and an order never goes back.

The diagram#

The main line runs top to bottom; beside each step are the statuses it may leave to. A tag marks the statuses a partner may report: “kitchen” for POS and kitchen systems, “road” for delivery fleets.

Delivery order
  1. Awaiting paymentpending_payment
    • Payment failedpayment_failedthen pending_payment · cancelled
    • Cancelledcancelledkitchen
  2. Placedplaced
    • Rejectedrejectedkitchen
    • Cancelledcancelledkitchen
  3. Acceptedacceptedkitchen
    • Cancelledcancelledkitchen
  4. Preparingpreparingkitchen
    • Cancelledcancelledkitchen
  5. Readyreadykitchen
    • Cancelledcancelledkitchen
  6. Out for deliveryout_for_deliveryroad
    • Delivery faileddelivery_failedroad
  7. Delivereddeliveredroad
Pickup order
  1. Awaiting paymentpending_payment
    • Payment failedpayment_failedthen pending_payment · cancelled
    • Cancelledcancelledkitchen
  2. Placedplaced
    • Rejectedrejectedkitchen
    • Cancelledcancelledkitchen
  3. Acceptedacceptedkitchen
    • Cancelledcancelledkitchen
  4. Preparingpreparingkitchen
    • Cancelledcancelledkitchen
  5. Readyreadykitchen
    • Not collectednot_collected
    • Cancelledcancelledkitchen
  6. Picked uppicked_upkitchen

Transition table#

StatusNext (delivery)Next (pickup)Partner may report
pending_paymentAwaiting paymentplacedpayment_failedcancelledplacedpayment_failedcancelled—
payment_failedPayment failedpending_paymentcancelledpending_paymentcancelled—
placedPlacedacceptedrejectedcancelledacceptedrejectedcancelled—
acceptedAcceptedpreparingcancelledpreparingcancelledkitchen
preparingPreparingreadycancelledreadycancelledkitchen
readyReadyout_for_deliverycancelledpicked_upnot_collectedcancelledkitchen
out_for_deliveryOut for deliverydelivereddelivery_failed—road
deliveredDeliveredfinalfinalroad
picked_upPicked upfinalfinalkitchen
cancelledCancelledfinalfinalkitchen
rejectedRejectedfinalfinalkitchen
delivery_failedDelivery failedfinalfinalroad
not_collectedNot collectedfinalfinal—

Who reports which status#

Kitchen statuses
acceptedrejectedpreparingreadypicked_upcancelled
Road statuses
out_for_deliverydelivereddelivery_failed

POS, ERP and kitchen systems report kitchen statuses; delivery fleets report road statuses. Your own list is in settings.orders.statuses; any other status is refused.

  • A late or repeated status is ignored; a missed step is filled in (ready before preparing moves the order through both).
  • Cancel and reject apply automatically only before the kitchen starts; after that a branch manager confirms, since the order may be paid and made.
  • Kitchen statuses never move a delivery order to out for delivery or delivered.

Reporting statuses

Who accepts the order#

settings.orders.acceptanceYou get the order atWho accepts
lpacceptedThe Let's Pizza branch board; the order reaches you once accepted.
partnerplacedYour system: it reports accepted or rejected.