Skip to main content

Exchange Ticket

Exchange (change) tickets for an existing booking. This is a 3-step process: Search → Reprice → Confirm.


Search for available flights to exchange tickets.

Endpoint

  • URL: /api/v1/flight/exchange-search
  • Method: POST
  • Auth Required: Yes (Bearer Token/X-api-key)
  • Content-Type: application/json

Request Structure

FieldTypeRequiredDescription
systemstringYesBooking system code (e.g., VN, VJ, 1A)
bookingCodestringYesBooking code (PNR)
promoCodestringNoPromotional discount/coupon code
flightValueCancelsarrayYesFlight values to cancel (from booking)
newFlightsarrayYesNew flight requests (see FlightRequest)

FlightRequest Object

FieldTypeRequiredDescription
legintegerNoFlight segment sequence number
startPointstringYesDeparture airport code (3-letter IATA)
endPointstringYesArrival airport code (3-letter IATA)
departDateDateOnlyYesDeparture date (YYYY-MM-DD format)
preferCabinstringNoCabin class: Y - Economy, F - First, C - Business, W - Premium Economy, M - Non-premium Economy

Sample Request:

{
"system": "VN",
"bookingCode": "ABC123",
"promoCode": "DISCOUNT10",
"flightValueCancels": ["encoded_flight_value_1"],
"newFlights": [
{
"leg": 0,
"startPoint": "SGN",
"endPoint": "HAN",
"departDate": "2024-06-02",
"preferCabin": "Y"
}
]
}

Response Structure

Returns an array of TripOtaFlightSearchResponse objects (same as Search Flight).

FieldTypeNullableDescription
systemstringYesSystem name (e.g., VN, VJ, 1A)
statusbooleanNotrue if successful, false if failed
errorobjectYesError details (if any)
descriptionstringYesError description (if any)
trackingIdstringYesTracking ID for request logs
trackingTimestringYesTime for request tracking (ISO 8601 format)
fareDatasarrayYesList of available exchange flight options

Sample Response

[
{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "exchange-search-001",
"trackingTime": "2025-07-01T07:00:00.000Z",
"fareDatas": [
{
"airline": "VN",
"startPoint": "SGN",
"endPoint": "HAN",
"departDate": "2024-06-02",
"flightValue": "encoded_new_flight_value_from_exchange_search",
"totalFare": 2450000,
"currency": "VND"
}
]
}
]

Step 2: Exchange Reprice

Check the price difference before confirming the exchange.

Endpoint

  • URL: /api/v1/flight/exchange-reprice
  • Method: POST
  • Auth Required: Yes (Bearer Token/X-api-key)
  • Content-Type: application/json

Request Structure

FieldTypeRequiredDescription
systemstringYesBooking system code
bookingCodestringYesBooking code (PNR)
flightCancelsarrayYesFlight values to cancel
flightExchangesarrayYesFlight values to exchange (from exchange-search)

Sample Request:

{
"system": "VN",
"bookingCode": "ABC123",
"flightCancels": ["encoded_flight_value_1"],
"flightExchanges": ["encoded_new_flight_value"]
}

Response Structure

FieldTypeNullableDescription
systemstringYesSystem name
statusbooleanNoSuccess status
errorobjectYesError details
descriptionstringYesError description
trackingIdstringYesTracking ID
trackingTimestringYesTracking time
bookingCodestringYesBooking code
exchangeValuestringYesExchange value for confirm step
exchangePricingDetailsarrayYesPricing details (see ExchangeTicketInfo)

Sample Response

{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "exchange-reprice-001",
"trackingTime": "2025-07-01T07:05:00.000Z",
"bookingCode": "ABC123",
"exchangeValue": "encoded_exchange_value_from_reprice",
"exchangePricingDetails": [
{
"ticketNumber": "2389876543210",
"passenger": "NGUYEN VAN A",
"oldPrice": { "amount": 2000000, "currency": "VND" },
"newPrice": { "amount": 2450000, "currency": "VND" },
"different": { "amount": 450000, "currency": "VND" },
"penalty": { "amount": 100000, "currency": "VND" },
"refund": { "amount": 0, "currency": "VND" }
}
]
}

Step 3: Exchange Confirm

Confirm and finalize the ticket exchange.

Endpoint

  • URL: /api/v1/flight/exchange-confirm
  • Method: POST
  • Auth Required: Yes (Bearer Token/X-api-key)
  • Content-Type: application/json

Request Structure

FieldTypeRequiredDescription
systemstringYesBooking system code
bookingCodestringYesBooking code (PNR)
exchangeValuestringYesExchange value from reprice step

Sample Request:

{
"system": "VN",
"bookingCode": "ABC123",
"exchangeValue": "encoded_exchange_value_from_reprice"
}

Response Structure

FieldTypeNullableDescription
systemstringYesSystem name
statusbooleanNoSuccess status
errorobjectYesError details
descriptionstringYesError description
trackingIdstringYesTracking ID
trackingTimestringYesTracking time
bookingCodestringYesUpdated booking code
exchangePricingDetailsarrayYesExchange pricing details (see ExchangeTicketInfo)

ExchangeTicketInfo Object

FieldTypeNullableDescription
ticketNumberstringYesTicket number
passengerstringYesPassenger information
oldPriceMoneyYesOld ticket price
newPriceMoneyYesNew ticket price
differentMoneyYesPrice difference
penaltyMoneyYesPenalty amount
refundMoneyYesRefund amount

Sample Response:

{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "abc123",
"trackingTime": "2025-07-01T07:00:00.000Z",
"bookingCode": "ABC123",
"exchangePricingDetails": [
{
"ticketNumber": "2389876543210",
"passenger": "NGUYEN VAN A",
"oldPrice": { "amount": 2000000, "currency": "VND" },
"newPrice": { "amount": 2050000, "currency": "VND" },
"different": { "amount": 50000, "currency": "VND" },
"penalty": { "amount": 100000, "currency": "VND" },
"refund": { "amount": 0, "currency": "VND" }
}
]
}

Error Codes

This endpoint may return the following error codes:

For a complete list of error codes, see Error Codes.


Security & Validation

  • All input is validated for type and required fields.
  • Only authenticated users can access this endpoint.
  • The endpoint is protected against tampering with bookingCode and segment data.

Validation Questions

  • Are there limits on the number of exchanges per booking?
  • Are there time or fare restrictions for exchanges?

For integration support, see Contact Support.