Admin: Orders & Delivery

The order lifecycle

Every order moves through: placed → packing → on_the_way → delivered, with cancelled available at any point. In the UI these appear with friendly labels:

StatusLabel shownMeaning
placedOrder PlacedPayment succeeded (or COD chosen); waiting for the store to start packing.
packingBeing PackedItems are being picked and packed.
on_the_wayOn the WayHanded to the rider; out for delivery.
deliveredDeliveredHanded over. COD orders are automatically marked paid at this moment.
cancelledCancelledOrder voided; excluded from all revenue reports.

Filter chips

Across the top of /admin/orders sit filter chips: All · Order Placed · Being Packed · On the Way · Delivered · Cancelled. Click one to see only orders in that state (the newest 200). "Order Placed" is effectively your to-do list of orders nobody has started packing yet.

The inline status dropdown

Each row in the orders table (and the Recent Orders table on the Dashboard) ends with a status dropdown. Pick a new status and it saves instantly — an HTMX request fires on change and swaps the control back in with its new color; there is no separate Save button. This dropdown is how deliveries progress: Order Placed → Being Packed → On the Way → Delivered.

The customer's tracking page polls every 5 seconds, so each change you make here appears on their screen within moments.

Order detail page

Click an order number to open /admin/orders/<id>. It shows the customer (name and phone), when the order was placed, the delivery address, the payment method and status, every line item with unit, quantity and price, and the full bill breakdown (subtotal, delivery, handling, total). The same status dropdown sits at the top right, so you can advance the order without leaving the page.

Payment behaviour and statuses

  • COD auto-paid on delivery: when you set a Cash on Delivery order to Delivered, its payment status flips to paid automatically — cash was collected at the door.
  • Prepaid (UPI/Card) orders arrive already paid if the QuickPay sandbox payment succeeded, or failed if it didn't (the customer can retry from their order page).
Payment statusMeaning
pendingNo successful payment yet — the normal state of a COD order before delivery.
paidMoney received: gateway success, or COD marked Delivered.
failedThe gateway attempt failed; the customer sees a Retry Payment button.
refundedMoney returned to the customer. The schema reserves this status for refund bookkeeping (e.g. a cancelled prepaid order); the demo does not set it automatically.