Orders
GET
Authentication: Optional For orders from the app
/orders
For a single order
/orders/<id>
For orders that need to be synced to Tally
/orders_tally
Query Params
| Field | Description | Example Value |
|---|---|---|
| name | Customer Name for filtering | Jacob |
| route_id | Route ID of the customer for filtering | 5 |
| order_number | Order number of the order | SAL123 |
| customer_id | Customer ID of the customer | 5 |
| start_date | Start date for filtering | 2025-01-01 |
| end_date | End date for filtering | 2025-01-10 |
| is_redeemed | Filter for redeemed or unredeemed orders | true |
| is_cleared | Filter for cleared or uncleared orders | true |
POST
This API can only be used by admins
Authentication: Required For app orders
/orders
JSON Example
Values and types can be inferred from the example
{
"latitude": 8.352255354345,
"longitude": 3.34845475536,
"items": [
{
"product_id": 1,
"quantity": 1
},
{
"product_id": 2,
"quantity": 1
}
]
}
For tally orders
/orders_tally
JSON Example
Values and types can be inferred from the example
{
"customer_id": 1,
"items": [
{
"product_id": 1,
"quantity": 1
},
{
"product_id": 2,
"quantity": 1
}
]
}
PATCH
This API can only be used by admins
Authentication: Required
The payment will be cash by default
/orders/<id>/accept
JSON Example
No JSON needed
/orders/<id>/reject
JSON Example
No JSON needed
DELETE
This API can only be used by admins
Authentication: Required
/orders/<id>