Order Flow Diagram
Order Status Codes
| Status ID | Status Name | Description | Actions Available |
|---|---|---|---|
| 1 | Sipariş Geldi | New order received | Accept, Cancel |
| 2 | Hazırlanıyor | Order confirmed and preparing | On The Way, Cancel |
| 16 | Restoran Kuryeye Verildi | Out for delivery (restaurant courier) | Complete, Cancel |
| 5 | Teslim Edildi | Order delivered successfully | - |
| 6 | İptal Edildi | Order canceled | - |
Status history is automatically managed by database triggers. You don’t need to manually update it.
Complete Lifecycle Flow
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. 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. 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)
Alternative Flow: Cancellation
Cancel Reasons Reference
| Reason ID | Description | When to Use |
|---|---|---|
| 1 | Ürün tükendi | Product out of stock |
| 2 | Adres bulunamıyor | Address not found |
| 3 | Yoğunluk nedeniyle | Too busy to handle |
| 4 | Müşteri iptal etti | Customer requested cancellation |
| 5 | Teknik sorun | Technical issue |
| 6 | Çok uzak teslimat adresi | Delivery address too far |
| 7 | Ödeme problemi | Payment problem |
| 8 | Diğer | Other reason |
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:| Payment Method | Description | When to Collect |
|---|---|---|
| Nakit (CASH) | Cash payment | On delivery |
| Kredi Kartı (CREDIT_CARD) | Credit card | Already paid |
| Banka Kartı (DEBIT_CARD) | Debit card | Already paid |
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.