Orders API
Account order operations covering fetch, detail, acceptance, rejection, and settlement flows.
Base Path
https://api.niyantha.in/api/v1/sessionAuthentication
Authorization: Bearer <token>
Use these routes to power account order dashboards, store-specific order views, and downstream fulfillment workflows. The same operations are available via S2S for backend-to-backend integrations.
/ordersFetch account orders with pagination and status filters.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | int | No | Defaults to 1. |
| count | int | No | Defaults to 10. |
| status | string | No | created, accepted, rejected, completed, failed. |
| is_pending_acknowledgement | bool | No | Fetch orders still awaiting account action. |
{
"items": [
{
"id": 991,
"store_id": 12,
"status": "created",
"payment_status": "paid",
"total_amount": 145,
"delivery_method": "home_delivery"
}
],
"page": 1,
"count": 1
}/orders/:idFetch the full order detail, including items and locations.
{
"id": 991,
"buyer_id": 5,
"store_id": 12,
"status": "created",
"payment_status": "paid",
"delivery_method": "home_delivery",
"items": [
{
"id": 77,
"store_product_id": 501,
"quantity": 2,
"price_per_unit": 40
}
]
}/orders/:id/acceptAccept an order and optionally declare estimated delivery time.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| estimated_delivery_minutes | int | No | Estimated delivery SLA in minutes. |
{
"estimated_delivery_minutes": 35
}{
"id": 991,
"status": "accepted",
"estimated_delivery_minutes": 35
}/orders/:id/declineDecline an order with a reason.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| reason | string | Yes | Human-readable decline reason. |
{
"reason": "Out of stock"
}{
"id": 991,
"status": "rejected",
"reason": "Out of stock"
}/orders/:id/mark-paid-and-deliveredMark the order settled and delivered.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| payment_reference | string | No | Settlement reference. |
| delivered_at | int64 | No | Unix delivery timestamp. |
{
"payment_reference": "razorpay_abc",
"delivered_at": 1736764200
}{
"id": 991,
"status": "completed",
"payment_status": "paid"
}Notes
Use /stores/:store_id/orders when you want store-scoped dashboards or multi-store account views.
The same routes are exposed under /api/v1/s2s/accounts/orders for server-side partner integrations.