Skip to main content
All report generation endpoints dispatch background jobs and return 202 Accepted immediately. A notification is sent to the requesting user when the file is ready. All report endpoints require authentication and tenant ownership.
Common middleware for all report endpoints: auth:sanctum, tenant.ownership, throttle:api

Report generation endpoints

GET /api/v1/reports/sales/excel

Queue a sales report as an Excel (.xlsx) file. Route name: reports.sales.excel

Query parameters

start_date
string
Start of date range in YYYY-MM-DD format. Must be ≤ end_date. Defaults to one month ago.
end_date
string
End of date range in YYYY-MM-DD format. Must be ≥ start_date and ≤ today. Defaults to today.
status
string
Filter by order status. One of: pending, confirmed, processing, ready, delivered, cancelled.

Response 202 Accepted

success
boolean
true
message
string
Confirmation that the report is being generated.
estimated_time
string
Estimated completion time (approximately 1–5 minutes).

GET /api/v1/reports/sales/pdf

Queue a sales report as a PDF file. Route name: reports.sales.pdf Accepts the same start_date, end_date, and status query parameters as the Excel endpoint.

Response 202 Accepted

success
boolean
true
message
string
Confirmation that the PDF is being generated.
report_type
string
sales
estimated_time
string
Approximately 1–3 minutes.

GET /api/v1/reports/inventory/pdf

Queue an inventory report as a PDF file. Route name: reports.inventory.pdf

Response 202 Accepted

report_type
string
inventory
estimated_time
string
Approximately 1–2 minutes.

GET /api/v1/reports/kitchen/pdf

Queue a kitchen preparation list as a PDF file. Route name: reports.kitchen.pdf

Response 202 Accepted

report_type
string
kitchen
estimated_time
string
Approximately 30 seconds.

File download endpoints

GET /api/v1/reports/download/

Download a pre-generated report file. The URL is signed — it must be generated server-side using Laravel’s URL::signedRoute() and will be delivered via an in-app notification. Middleware: signed
Authentication: Not required (signature is the access control)

Path parameters

path
string
required
File path relative to the local storage disk. Must start with reports/ and have an extension of .pdf, .xlsx, or .csv. Path traversal characters are blocked.

Response

Streamed file download with appropriate Content-Type:
ExtensionContent-Type
.pdfapplication/pdf
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.csvtext/csv

Error responses

StatusCause
403Signed URL signature is invalid or has expired
403Path contains traversal characters or disallowed extension
404File does not exist on the storage disk
Do not construct report download URLs manually. Always use the signed URL from the notification payload.

Sales export endpoints

POST /api/v1/exports/sales

Queue a filtered sales export for the authenticated user’s tenant. Middleware: auth:sanctum, tenant.ownership, throttle:api
Route name: api.exports.sales

Request body

start_date
string
Filter start date (YYYY-MM-DD). Must be ≤ end_date.
end_date
string
Filter end date (YYYY-MM-DD). Must be ≥ start_date.
status
string
Filter by order status. One of: pending, confirmed, preparing, ready, delivered, cancelled.

Response 202 Accepted

success
boolean
true
message
string
Confirmation that the export is processing.
status
string
processing
curl -X POST https://yourdomain.com/api/v1/exports/sales \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"start_date": "2025-01-01", "end_date": "2025-01-31"}'

GET /api/v1/exports/download

Download a queued export file. The URL is signed and authenticated. Links are valid for 30 minutes and are delivered via the export_ready notification type. Middleware: auth:sanctum, signed
Route name: api.exports.download

Query parameters

path
string
required
Base64-encoded file path on the local storage disk.
tenant
string
required
Tenant UUID. Must match the authenticated user’s tenant.

Response

Streamed .xlsx file download.

Error responses

StatusCause
400Missing path or tenant parameters, or invalid base64
401Not authenticated
403Authenticated user’s tenant does not match the tenant parameter
404File not found or has expired (files expire after 24 hours)

Build docs developers (and LLMs) love