How to Confirm or Cancel a Flight Booking
After creating a booking, you can confirm it to issue tickets or cancel it if the reservation is no longer needed. Both actions use the same PATCH endpoint with different request bodies.
Endpoint
PATCH /flights/api/v2/bookings/{booking_id}
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key. |
x-correlation-id | Yes | Correlation ID from the autocomplete response. |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
booking_id | string | Yes | The booking ID returned when the booking was created. |
Confirming a Booking
Send a PATCH request with booking_status set to "Confirm" to issue tickets.
Request Body
JSON
{
"booking_status": "Confirm"
}Example Request
PATCH /flights/api/v2/bookings/XNFiEtVA3LL
JSON
{
"booking_status": "Confirm"
}Example Response
JSON
{
"status": "success",
"data": {
"booking_id": "XNFiEtVA3LL",
"booking_status": "TICKETED"
},
"message": "Booking confirmed successfully"
}Possible Confirmation Statuses
| Status | Description |
|---|---|
TICKETED | Tickets have been issued immediately. |
TICKETINPROCESS | Ticketing is in progress. Check back shortly using the get booking endpoint. |
Cancelling a Booking
Send a PATCH request with booking_status set to "Cancel" to cancel the booking.
Request Body
JSON
{
"booking_status": "Cancel"
}Example Request
PATCH /flights/api/v2/bookings/XNFiEtVA3LL
JSON
{
"booking_status": "Cancel"
}Example Response
JSON
{
"status": "success",
"data": {
"booking_id": "XNFiEtVA3LL",
"booking_status": "CANCELLED"
},
"message": "Booking cancelled successfully"
}Booking Status Reference
| Status | Description |
|---|---|
BOOKED | Reservation is held but not yet ticketed. Must be confirmed before the ticket time limit. |
TICKETED | Tickets have been issued. The booking is fully confirmed. |
TICKETINPROCESS | Ticketing is being processed. Poll the get booking endpoint to check for completion. |
CANCELLED | Booking has been cancelled. |
Important Notes
- Ticket time limit. When a booking has status
BOOKED, it must be confirmed before thetickettimelimitreturned in the booking creation response. After this deadline, the reservation may be automatically released by the airline. - Cancellation penalties. Cancelling a ticketed booking may incur penalties based on the fare rules. Review the fare rules before cancelling. See How to Retrieve Fare Rules for a Flight.
- Cancelling a held booking. Cancelling a booking with status
BOOKED(not yet ticketed) typically does not incur any penalty. - TICKETINPROCESS. If the confirmation response returns
TICKETINPROCESS, the ticketing is still underway. Use the Get Booking Details endpoint to poll for the final status.
Related Articles
- How to Book a Flight — Create the booking that you then confirm or cancel.
- How to Retrieve Flight Booking Details — Check the current status of any booking.
- How to Retrieve Fare Rules for a Flight — Understand cancellation penalties before cancelling.