Sales Report
Generate sales reports for bookings and tickets within a specified date range. This endpoint provides comprehensive ticket information including fare breakdowns, passenger details, and ticket status.
Endpoint
- URL:
/api/v1/flight/salesreport - Method:
POST - Auth Required: Yes (Bearer Token/X-API-KEY)
- Content-Type:
application/json
Authentication
This endpoint requires a valid JWT Bearer token in the Authorization header:
Authorization: Bearer <access_token>
Obtain tokens via /api/v1/sign-in (POST) with your credentials.
Request Structure
| Field | Type | Required | Description |
|---|---|---|---|
| system | string | No | Booking system code (e.g., VN, VJ, 1A) |
| fromDate | string | No | Start date (ddMMyyyy format, e.g., 31122024) |
| toDate | string | No | End date (ddMMyyyy format, e.g., 31122024) |
Example Request:
{
"system": "VN",
"fromDate": "01012024",
"toDate": "31012024"
}
Request Constraints & Business Rules
- Date range should not exceed 90 days to ensure optimal performance.
- The
fromDatemust be earlier than or equal totoDate. - If no date range is provided, the system may default to current month.
- Only authorized users can access sales report data.
- Reports include all ticket types: issued, voided, refunded, and exchanged.
Response Structure
| Field | Type | Nullable | Description |
|---|---|---|---|
| system | string | Yes | System name (e.g., VN, VJ, 1A) |
| status | boolean | No | true if successful, false if failed |
| error | object | Yes | Error details (if any) |
| description | string | Yes | Error description (if any) |
| trackingId | string | Yes | Tracking ID for request logs |
| trackingTime | string | Yes | Time for request tracking (ISO 8601 format) |
| tickets | array | Yes | List of ticket reports (see SalesReportTicket) |
SalesReportTicket Object
| Field | Type | Nullable | Description |
|---|---|---|---|
| index | integer | No | Ticket sequence number |
| bookingCode | string | Yes | Booking code (PNR) |
| ticketNumber | string | Yes | Ticket number |
| ticketType | string | Yes | Ticket status: OPEN, VOID, USED, RFND, EXCH |
| serviceType | string | Yes | Service type: FLIGHT, BAGGAGE, SEAT, SSR |
| serviceCode | string | Yes | Service code |
| relatedNumber | string | Yes | Related ticket number |
| relatedType | string | Yes | Relation type: EXCH (exchange), RFND (refund), ORGN |
| issueDate | string | Yes | Issue date (ddmmyyyy) |
| paxIndex | string | Yes | Passenger index in booking |
| fullName | string | Yes | Full passenger name |
| givenName | string | Yes | Given name |
| surname | string | Yes | Surname |
| paxType | string | Yes | Passenger type: ADT, CHD, INF |
| totalFare | number | No | Total fare amount |
| baseFare | number | No | Base fare amount |
| taxes | number | No | Total tax amount |
| currency | string | Yes | Currency code |
| startPoint | string | Yes | Departure airport code |
| endPoint | string | Yes | Arrival airport code |
| info | string | Yes | Additional information |
| taxDetails | array | Yes | Tax breakdown details |
| couponInfos | array | Yes | Coupon information list |
| endorsement | string | Yes | Endorsement information |
| ticketImage | string | Yes | Ticket image/face |
Example Response:
{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "abc-123",
"trackingTime": "2024-06-01T12:00:00Z",
"tickets": [
{
"index": 1,
"bookingCode": "ABC123",
"ticketNumber": "738-1234567890",
"ticketType": "OPEN",
"serviceType": "FLIGHT",
"serviceCode": "Y",
"relatedNumber": null,
"relatedType": "ORGN",
"issueDate": "01012024",
"paxIndex": "1",
"fullName": "NGUYEN VAN A",
"givenName": "VAN A",
"surname": "NGUYEN",
"paxType": "ADT",
"totalFare": 2350000,
"baseFare": 2000000,
"taxes": 350000,
"currency": "VND",
"startPoint": "SGN",
"endPoint": "HAN",
"info": "VN123 02JAN24",
"taxDetails": [],
"couponInfos": [],
"endorsement": "NON-REF",
"ticketImage": null
}
]
}
Error Codes
See Error Codes for details on possible error responses.
Security & Validation
- All input is validated for type and required fields.
- Only authenticated users can access this endpoint.
- Date ranges are validated to prevent excessive data retrieval.
- All report generation actions are logged and traceable.
Validation Questions
- What is the maximum date range allowed for reports?
- Are there different access levels for different types of sales data?
- How are voided and refunded tickets handled in the totals?
- Can reports be filtered by specific airlines or booking sources?
For integration support, see Contact Support.