Order Flow Diagram
Order Status Codes
Status history is automatically managed by database triggers. You don’t need to manually update it.
Complete Lifecycle Flow
1
1. Order Received (status_id: 1)
What happens:Next steps:
- Customer places order
- Order appears in
/orders/get-currentresponse - Order repeats in subsequent calls until acknowledged
- Display order in POS
- Staff reviews order
- Decision: Accept or Cancel
2
2. Order Confirmed (status_id: 2)
What happens:Next steps:
- Restaurant accepts the order
- Preparation time is set
- Kitchen starts preparing
- Kitchen prepares food
- Monitor preparation progress
- When ready, mark as out for delivery
3
3. Out for Delivery (status_id: 16)
What happens:Next steps:
- Food is ready
- Courier picks up order
- Order is on the way to customer
- Courier delivers order
- Customer receives food
- Payment collected (if cash)
4
4. Order Complete (status_id: 5)
What happens:Result:
- Order successfully delivered
- Payment confirmed
- Order lifecycle ends
- Order removed from active orders
- Transaction complete
Alternative Flow: Cancellation
1
Get Cancel Reasons
2
Cancel Order
3
Result
- Order status → CANCELED (status_id: 6)
- Customer notified
- Refund processed (if paid)
Cancel Reasons Reference
Order Repetition Behavior
How Order Repetition Works
How Order Repetition Works
Courier Types
Orders can have different courier types that affect the workflow:- restaurant
- fuudy
- come_get
Restaurant’s Own Courier
- You manage the entire delivery
- Must call
/onthewayand/complete - Full control over delivery timing
Payment Types
Orders can have different payment methods:All completed orders are marked as
COMPLETE_WITH_PAYMENT regardless of payment type.Scheduled Orders
Some orders may be scheduled for future delivery:Best Practices
Always Acknowledge Orders
Always Acknowledge Orders
Call
/orders/success immediately after importing an order into your POS to prevent duplicate notifications.Use payment_key for API Calls
Use payment_key for API Calls
Always use the
payment_key (UUID) for operational endpoints, not the id (integer).Handle All Status Transitions
Handle All Status Transitions
Ensure your POS can handle orders in any status, including edge cases.
Validate Courier Type
Validate Courier Type
Check
courier_type before calling /ontheway and /complete. These are only valid for "restaurant" type.Set Realistic Prep Times
Set Realistic Prep Times
Consider kitchen load, order complexity, and time of day when setting
preparing_time.Handle Cancellations Gracefully
Handle Cancellations Gracefully
Always provide a meaningful
reason_id when canceling orders.Troubleshooting
Order keeps appearing in get-current
Order keeps appearing in get-current
Cause: Order hasn’t been acknowledged.Solution: Call
/orders/success/{payment_key} after processing.Can't call /ontheway on order
Can't call /ontheway on order
Cause: Order courier_type is not “restaurant”.Solution: Check
courier_type field. Only restaurant couriers can use this endpoint.Order disappeared after acknowledge
Order disappeared after acknowledge
Cause: Order was acknowledged and status didn’t change.Solution: This is expected behavior. Order will reappear when status changes.
Using wrong order ID
Using wrong order ID
Cause: Using
id (integer) instead of payment_key (UUID).Solution: Always use payment_key for API operations.Related Resources
Get Current Orders
API reference for fetching orders
Accept Order
Accept order endpoint details
Best Practices
Integration best practices
Error Handling
Handle errors gracefully