GEThttps://api.spirestock.com/api/v1/secondary-sales#
Sales a distributor made to its retailers, newest sale day first with id as the tie-break.
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
distributor_idnumber- One distributor; a value that is not a positive integer is 400
date_fromstring- First sale day, YYYY-MM-DD only
date_tostring- Last sale day (inclusive), YYYY-MM-DD only; a start after the end is 400
pagenumber- Page number; junk or a value below 1 reads as 1 Default
1. limitnumber- Page size, default 20, max 100 (larger values are clamped)
curl "https://api.spirestock.com/api/v1/secondary-sales?distributor_id=1201&date_from=2024-06-01&date_to=2024-06-30" \
-H "X-API-Key: YOUR_API_KEY"{
"response_code": 200,
"data": [
{
"id": 9,
"organization_id": 6,
"distributor_id": 1201,
"distributor_name": "Demo Distributor A",
"retailer_id": null,
"retailer_name": "Retailer One",
"retailer_store": "Store One",
"product_variant_id": null,
"product_variant_name": "Toned Milk 500 ml",
"quantity": 10,
"rate": 22,
"amount": 220,
"sale_date": "2024-06-10",
"recorded_by": 1001,
"createdAt": "2024-06-10T05:30:00.000Z",
"updatedAt": "2024-06-10T05:30:00.000Z"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 20,
"total_pages": 1
}
}