curl --request POST \
--url https://staging.api.prexsell.com/v2/reports/company/orders \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-12-31T23:59:59.999Z",
"orderBy": "DepartureDate"
}
'{
"data": {
"report": {
"id": "clxyz1234567890abc",
"status": "Queued",
"orderBy": "DepartureDate",
"createdAt": "2025-01-01T00:00:00.000Z",
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-12-31T23:59:59.999Z",
"expiresAt": null,
"downloadedAt": null
}
}
}Create company orders report
Enqueues an async CSV report of the authenticated companyβs orders over the specified date range. Returns 202 Accepted with the new report record. Poll GET /orders or fetch GET /orders/:id/download once status is Completed. The date range must not exceed 366 days. The company is resolved from the session β it cannot be supplied by the client.
curl --request POST \
--url https://staging.api.prexsell.com/v2/reports/company/orders \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-12-31T23:59:59.999Z",
"orderBy": "DepartureDate"
}
'{
"data": {
"report": {
"id": "clxyz1234567890abc",
"status": "Queued",
"orderBy": "DepartureDate",
"createdAt": "2025-01-01T00:00:00.000Z",
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-12-31T23:59:59.999Z",
"expiresAt": null,
"downloadedAt": null
}
}
}Body
Date window and optional sort order for the report. The company is resolved from the session.
Inclusive start of the date range (ISO 8601 date-time).
"2025-01-01T00:00:00.000Z"
Inclusive end of the date range (ISO 8601 date-time).
"2025-12-31T23:59:59.999Z"
Field to sort orders by. "DepartureDate" (default) sorts by departure date; "CreatedAt" sorts by order creation date.
CreatedAt, DepartureDate "DepartureDate"
Response
Report enqueued successfully. Poll GET /orders or fetch GET /orders/:id/download once status is Completed.
Show child attributes
Show child attributes
