GEThttps://api.spirestock.com/api/v1/orders#
List orders with the order filters. Each row carries flat_incentive, bulkpack_incentive and invoice_amount (order total minus incentives). Dates are calendar days in the API server's local time zone (production runs in IST); with no usable date the list defaults to today. Staff only see orders of their own plants.
Access: API key read scope; staff need Orders (8) — list.
Pagedpage and limit (max 100), id as the final sort key. How pagination works
Parameters
pagenumber- Page number Default
1. limitnumber- Items per page (default 20, max 100)
statusnumber- 1 initiated, 2 forwarded, 3 approved, 4 delivered
order_datestring- One day, dd/mm/yyyy or YYYY-MM-DD (overrides the range)
date_fromstring- Range start, dd/mm/yyyy or YYYY-MM-DD
date_tostring- Range end (inclusive)
production_unit_idnumber- Plant
route_idnumber- Route
town_idnumber- Town
user_idnumber- Customer
user_sap_idstring- Customer SAP id (exact)
user_typestring- e.g. Distributor
town_namestring- Town name contains
route_namestring- Route name contains
searchstring- Order code, customer name or SAP id contains
scanned_by_driverstring- true/1 or false/0
sort_bystring- order_date (default), order_total_amount, order_code, created_at
sort_orderstring- ASC or DESC (default)
curl "https://api.spirestock.com/api/v1/orders?order_date=10/06/2024&production_unit_id=17&status=3&limit=20" \
-H "X-API-Key: YOUR_API_KEY"{
"response_code": 200,
"data": [
{
"id": 339254,
"organization_id": 6,
"order_code": "ORD0001008",
"user_id": 44658,
"user_sap_id": "CUST-003",
"user_name": "Sample User AQ",
"user_type": "Distributor",
"town_id": 436,
"town_name": "Town G",
"route_id": 78,
"route_name": "Route H",
"transporter_name": "",
"transporter_details": "Driver Name: Sample Driver",
"vehicle_no": "AB01CD1014",
"utr_no": null,
"order_date": "2024-06-10T13:26:11.000Z",
"order_status": 3,
"order_shift_id": 10,
"order_shift_name": "Morning",
"order_scheme_id": null,
"order_total_amount": 7707.6,
"order_items_count": 4,
"mode_of_payment": "UPI",
"amount_to_be_paid": 7707,
"revised_amount": null,
"outstanding_amount": 0,
"production_unit_id": 17,
"production_unit_name": "North Plant",
"indent_status": 1,
"dispatch_order_status": 0,
"delivery_date": null,
"delivery_proof_name": null,
"delivery_proof_phone": null,
"delivery_proof_relation": null,
"delivery_proof_condition": null,
"delivery_proof_note": null,
"delivery_proof_signature": null,
"delivery_proof_photo": null,
"delivery_proof_recorded_at": null,
"tcs_value": null,
"qr_data": null,
"qr_code_url": null,
"scanned_by_driver": false,
"source": "imported",
"sales_user_id": null,
"client_sync_id": null,
"updated_date": "2024-06-10T13:26:11.000Z",
"createdAt": "2024-06-10T13:26:12.000Z",
"updatedAt": "2024-06-11T11:26:10.000Z",
"flat_incentive": 0,
"bulkpack_incentive": 0,
"invoice_amount": 7707.6
}
],
"pagination": {
"total": 73,
"page": 1,
"limit": 1,
"total_pages": 73
}
}