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.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 of date range in
YYYY-MM-DD format. Must be ≤ end_date. Defaults to one month ago.End of date range in
YYYY-MM-DD format. Must be ≥ start_date and ≤ today. Defaults to today.Filter by order status. One of:
pending, confirmed, processing, ready, delivered, cancelled.Response 202 Accepted
trueConfirmation that the report is being generated.
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
trueConfirmation that the PDF is being generated.
salesApproximately 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
inventoryApproximately 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
kitchenApproximately 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’sURL::signedRoute() and will be delivered via an in-app notification.
Middleware: signedAuthentication: Not required (signature is the access control)
Path parameters
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 appropriateContent-Type:
| Extension | Content-Type |
|---|---|
.pdf | application/pdf |
.xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
.csv | text/csv |
Error responses
| Status | Cause |
|---|---|
403 | Signed URL signature is invalid or has expired |
403 | Path contains traversal characters or disallowed extension |
404 | File does not exist on the storage disk |
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:apiRoute name:
api.exports.sales
Request body
Filter start date (
YYYY-MM-DD). Must be ≤ end_date.Filter end date (
YYYY-MM-DD). Must be ≥ start_date.Filter by order status. One of:
pending, confirmed, preparing, ready, delivered, cancelled.Response 202 Accepted
trueConfirmation that the export is processing.
processingGET /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 theexport_ready notification type.
Middleware: auth:sanctum, signedRoute name:
api.exports.download
Query parameters
Base64-encoded file path on the local storage disk.
Tenant UUID. Must match the authenticated user’s tenant.
Response
Streamed.xlsx file download.
Error responses
| Status | Cause |
|---|---|
400 | Missing path or tenant parameters, or invalid base64 |
401 | Not authenticated |
403 | Authenticated user’s tenant does not match the tenant parameter |
404 | File not found or has expired (files expire after 24 hours) |