Exports API

Generate delivery challans, truck sheets, packing lists and sales reports as files, and download them once they are ready.

5 endpointsBase URL https://api.spirestock.com/api/v1

Every request needs an API key or a session token. Last updated .

On this page (5)

GEThttps://api.spirestock.com/api/v1/exports/orders

Export orders as XLSX or PDF. Supports status and date range filters.

Access: API key read scope; staff need Orders (8) — export.

Parameters

formatstring
Export format: xlsx (default) or pdf
statusnumber
Filter by order status (1-4)
date_fromstring
Start date (YYYY-MM-DD)
date_tostring
End date (YYYY-MM-DD)
production_unit_idnumber
Filter by production unit
Example request
curl "https://api.spirestock.com/api/v1/exports/orders?format=xlsx&date_from=2026-05-01&date_to=2026-05-31" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -o orders-export.xlsx
Example response
Binary file download (XLSX or PDF).
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename="orders-2026-05.xlsx"

GEThttps://api.spirestock.com/api/v1/exports/users

Export user list as XLSX or PDF with optional type and status filters.

Parameters

formatstring
Export format: xlsx (default) or pdf
typestring
Filter by user type: admin, employee, distributor
statusnumber
Filter by status: 1 (active), 0 (inactive)
Example request
curl "https://api.spirestock.com/api/v1/exports/users?format=pdf&type=distributor" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -o users-export.pdf
Example response
Binary file download (XLSX or PDF).
Content-Type: application/pdf
Content-Disposition: attachment; filename="users-distributors.pdf"

GEThttps://api.spirestock.com/api/v1/exports/sales

Export sales report as XLSX or PDF. Includes revenue breakdown by product class and trends.

Access: API key read scope; staff need Sales Report (45) — export.

Parameters

formatstring
Export format: xlsx (default) or pdf
date_fromstring
Start date (YYYY-MM-DD)
date_tostring
End date (YYYY-MM-DD)
Example request
curl "https://api.spirestock.com/api/v1/exports/sales?format=xlsx&date_from=2026-01-01&date_to=2026-05-31" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -o sales-report.xlsx
Example response
Binary file download (XLSX or PDF).
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename="sales-report-2026.xlsx"

GEThttps://api.spirestock.com/api/v1/exports/activity

The activity log as XLSX (default) or PDF, newest first. At most 50,000 rows: when the cap is hit the response carries X-Export-Truncated: true and X-Export-Row-Cap: 50000, so narrow the range and export again. date_from and date_to are compared as UTC days.

Access: API key read scope; staff need Log In Activity Log Report (53) — export.

Parameters

formatstring
xlsx or pdf Default xlsx.
date_fromstring
YYYY-MM-DD
date_tostring
YYYY-MM-DD (inclusive)
Example request
curl -OJ "https://api.spirestock.com/api/v1/exports/activity?date_from=2024-06-01&date_to=2024-06-30" \
  -H "X-API-Key: YOUR_API_KEY"
Example response
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
X-Export-Truncated: true
X-Export-Row-Cap: 50000

(binary file; the two X-Export headers appear only when the 50,000-row cap was reached)

GEThttps://api.spirestock.com/api/v1/exports/scan-logs

QR scan logs as XLSX (default) or PDF, newest first, with scan type, result and who scanned. At most 50,000 rows, flagged with X-Export-Truncated: true and X-Export-Row-Cap: 50000 when the cap is hit.

Access: API key read scope; staff need any report sub-module (the /reports/* catch-all) — export.

Parameters

formatstring
xlsx or pdf Default xlsx.
scan_typestring
Scan type
scan_resultstring
Scan result
fromstring
Start date/time (ISO 8601)
tostring
End date/time (ISO 8601)
Example request
curl -OJ "https://api.spirestock.com/api/v1/exports/scan-logs?from=2024-06-01" \
  -H "X-API-Key: YOUR_API_KEY"
Example response
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

(binary file; X-Export-Truncated: true and X-Export-Row-Cap: 50000 are added when the cap was reached)