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:
| Status | Label shown | Meaning |
|---|---|---|
placed | Order Placed | Payment succeeded (or COD chosen); waiting for the store to start packing. |
packing | Being Packed | Items are being picked and packed. |
on_the_way | On the Way | Handed to the rider; out for delivery. |
delivered | Delivered | Handed over. COD orders are automatically marked paid at this moment. |
cancelled | Cancelled | Order 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
paidautomatically — cash was collected at the door. - Prepaid (UPI/Card) orders arrive already
paidif the QuickPay sandbox payment succeeded, orfailedif it didn't (the customer can retry from their order page).
| Payment status | Meaning |
|---|---|
pending | No successful payment yet — the normal state of a COD order before delivery. |
paid | Money received: gateway success, or COD marked Delivered. |
failed | The gateway attempt failed; the customer sees a Retry Payment button. |
refunded | Money 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. |