Exports API

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

3 endpoints. Every request needs an API key or a session token — see Authentication. To send one of these calls from the browser, use the interactive reference.

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

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

Parameters

  • format (string)Export format: xlsx (default) or pdf
  • status (number)Filter by order status (1-4)
  • date_from (string)Start date (YYYY-MM-DD)
  • date_to (string)End date (YYYY-MM-DD)
  • production_unit_id (number)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

  • format (string)Export format: xlsx (default) or pdf
  • type (string)Filter by user type: admin, employee, distributor
  • status (number)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.

Parameters

  • format (string)Export format: xlsx (default) or pdf
  • date_from (string)Start date (YYYY-MM-DD)
  • date_to (string)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"