Skip to main content
POST
/
v2
/
reports
/
company
/
orders
Create company orders report
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

application/json

Date window and optional sort order for the report. The company is resolved from the session.

startDate
string<date-time>
required

Inclusive start of the date range (ISO 8601 date-time).

Example:

"2025-01-01T00:00:00.000Z"

endDate
string<date-time>
required

Inclusive end of the date range (ISO 8601 date-time).

Example:

"2025-12-31T23:59:59.999Z"

orderBy
enum<string>
default:DepartureDate

Field to sort orders by. "DepartureDate" (default) sorts by departure date; "CreatedAt" sorts by order creation date.

Available options:
CreatedAt,
DepartureDate
Example:

"DepartureDate"

Response

Report enqueued successfully. Poll GET /orders or fetch GET /orders/:id/download once status is Completed.

data
object
required