post https://api.aeronpay.in/api/serviceapi-prod/api/flight/cancel
Cancel Flight API
The Cancel Flight API allows you to cancel booked flights. This API supports both full and partial cancellations, depending on your requirements.
Overview
Use this API to initiate flight cancellations for bookings. The API provides flexible cancellation options with detailed status tracking.
API Endpoint
POST /flight/cancel
Request Headers
Header | Required | Description |
---|---|---|
client-id | Yes | Your unique client ID |
client-secret | Yes | Your client secret key for authentication |
Content-Type | Yes | Must be application/json |
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
client_referenceId | string | Yes | Unique reference ID for tracking the cancellation request |
booking_id | integer | Yes | The unique booking ID of the flight reservation to cancel |
request_type | string | Yes | Type of cancellation request. Options: full_cancellation or partial_cancellation |
reason | string | Yes | Reason for cancellation. Options: no_show , flight_cancelled , or others |
remarks | string | Yes | Additional comments or information about the cancellation |
journeys | array | Conditional | Required only for partial_cancellation - List of journey segments to cancel |
ticket_id | array | Conditional | Required for partial cancellation - Array of specific ticket IDs to cancel |
Request Type Options
- full_cancellation: Cancels the entire booking including all passengers and segments
- partial_cancellation: Cancels specific passengers or journey segments (requires additional parameters)
Cancellation Reasons
- no_show: Passenger did not show up for the flight
- flight_cancelled: Flight was cancelled by the airline
- others: Other reasons for cancellation
Example Request
{
"client_referenceId": "ABC12345656789",
"booking_id": 1984869,
"request_type": "full_cancellation",
"reason": "flight_cancelled",
"remarks": "Flight was cancelled by the airline."
}
Response Structure
The API returns a detailed response with cancellation status and processing information.
Response Parameters
Parameter | Type | Description |
---|---|---|
status | string | Overall status of the cancellation request (SUCCESS , FAILED , PENDING ) |
status_code | string | HTTP status code of the response |
message | string | Descriptive message about the cancellation result |
data | object | Detailed cancellation processing information |
Data Object Parameters
Parameter | Type | Description |
---|---|---|
trace_id | string | Unique identifier for tracking the cancellation process |
result | array | Array of cancellation results for each ticket processed |
Result Array Parameters
Parameter | Type | Description |
---|---|---|
request_id | integer | Internal request ID for the cancellation |
ticket_id | integer | Unique identifier of the cancelled ticket |
status | integer | Cancellation status (1 = successful, 0 = failed) |
remarks | string | Status remarks for the specific ticket |
request_status | string | Current processing status of the request |
Example Response
{
"status": "SUCCESS",
"status_code": "200",
"message": "Cancellation of ticket processed successful.",
"data": {
"trace_id": "677e0e8c-69f6-4480-b3c8-b89308f1b0bd",
"result": [
{
"request_id": 320073,
"ticket_id": 2263870,
"status": 1,
"remarks": "Successful",
"request_status": "Unassigned"
}
]
}
}
Status Codes
Status Code | Description |
---|---|
200 | Cancellation request processed successfully |
400 | Bad request - Invalid parameters or booking not found |
401 | Unauthorized - Invalid authentication credentials |
500 | Internal server error |
Error Handling
If the cancellation request fails, the API will return appropriate error codes and messages. Common error scenarios include:
- Invalid booking ID
- Booking already cancelled
- Cancellation not allowed for the fare type
- Technical issues with airline systems
Always implement proper error handling in your integration to manage these scenarios effectively.