POST/v1/transfers/reservations/changes

Confirmar cambio de una reserva de transfer

Reemplaza una reserva existente con una oferta de cambio seleccionada y cotizada.

Compartir
POST/v1/transfers/reservations/changes

Consola API

Pruébalo

Envía una petición real al entorno sandbox e inspecciona la respuesta.

Credenciales

Inicia sesión para elegir entre tus API keys guardadas en vez de pegarlas.

Cuerpo de la petición

Petición cURL

cURL
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/transfers/reservations/changes' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
  -H 'Content-Type: application/json' \
  -d '{"oldReservationId":"5c8563a5d31d4c33a3a1eafbbfe59c4b","useReservationCard":true,"gdsprovider":0,"bookingToken":"opaque_change_offer_token_generated_by_travelandz","pricingToken":"opaque_change_pricing_token_generated_by_travelandz","searchId":"5c8563a5d31d4c33a3a1eafbbfe59c49","resultId":"763475651c06f5ac31ea587084dc0640","currency":"USD","email":"happytraveler@example.com","countryCodeName":"US","phoneNumber":"+18775998200","firstName":"Happy","lastName":"Traveler","airline":"AA","flightNumber":"123","customerSpecialInstructions":"Special instructions changed","partnerTrackingId":"change-1234567ABC"}'

Añade tus credenciales para enviar una petición.

Esta petición necesita identificadores o tokens de una llamada anterior. Ejecuta primero el paso previo y pega aquí sus valores.

Respuesta

Pulsa «¡Pruébalo!» para enviar una petición y ver la respuesta aquí.

Reemplaza una reserva existente con una oferta de cambio seleccionada y cotizada.

Autenticación y headers

HeaderDescripción
AuthorizationBearer <secret_key>. Conserva el secret en el servidor y nunca lo escribas en logs del cliente.
X-Travelandz-Id<public_key>:<profile_code>, donde el profile code persistido usa el formato dp_<12 alfanuméricos>.
LANGHeader recomendado para el idioma. También se acepta Accept-Language.
Content-Typeapplication/json para peticiones con body JSON.

Petición

Acepta todos los campos del booking, más el oldReservationId obligatorio. Usa el bookingToken y el pricingToken generados por el flujo de cambio, no los de la reserva original. Usa useReservationCard para reutilizar el método de pago ya asociado a la reserva.

Schema del body

oldReservationId
string
Identifier of the reservation being replaced.
useReservationCard
booleanNo
Reuse the payment method already held for the reservation.
gdsprovider
enum
0
Transfer content selector. Currently 0.
bookingToken
string
Copy the bookingToken of the selected offer.
searchId
string
Must be the searchId of the selected offer.
resultId
string
Must be the resultId of the selected offer.
pricingToken
string
Opaque value returned by pricing. Required to book.
selectedAmenities
array
selectedAmenities[]
string[]No
When sent, must match the priced selection exactly.
currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
No
Lowercase values are accepted and normalized. Defaults to USD on a new search and is inherited afterwards.
email
string
Formato: email
countryCodeName
string
Formato: ISO 3166-1 alpha-2
For example US or ES.
phoneNumber
string
Valid phone number including the country prefix.
firstName
string
lastName
string
customerSpecialInstructions
stringNo
partnerTrackingId
string
Your own correlation identifier for this booking.
airline
string
Formato: IATA (2 characters)
No
Required when the offer has flightInfoRequired: true. Send it together with flightNumber.
flightNumber
stringNo
Alphanumeric, 1-8 characters, no spaces.
returnAirline
stringNo
Required for a round trip that needs flight details. Send it together with returnFlightNumber.
returnFlightNumber
stringNo
Alphanumeric, 1-8 characters.
extraPaxInfo
array
extraPaxInfo[]firstName
string
extraPaxInfo[]lastName
string
extraPaxInfo[]email
string
Formato: email
No
extraPaxInfo[]phoneNumber
stringNo
ticketTypes
array
ticketTypes[]id
string
Ticket type identifier from the offer. Must be unique.
ticketTypes[]count
number
Integer of at least 1.
scheduleIndex
numberNo
Index of the chosen alternative time. Must be 0 or greater.
paymentToken
stringNo
Only when the selected offer requires it.
successUrl
string
Formato: URL
No
Only when the selected offer requires it.
language
enum
en-USes-ESde-DEfr-FRpt-BRzh-CNit-IT
No
Legacy field. Prefer the LANG or Accept-Language header.

Ejemplo de petición

json
json
{
  "oldReservationId": "5c8563a5d31d4c33a3a1eafbbfe59c4b",
  "useReservationCard": true,
  "gdsprovider": 0,
  "bookingToken": "opaque_change_offer_token_generated_by_travelandz",
  "pricingToken": "opaque_change_pricing_token_generated_by_travelandz",
  "searchId": "5c8563a5d31d4c33a3a1eafbbfe59c49",
  "resultId": "763475651c06f5ac31ea587084dc0640",
  "currency": "USD",
  "email": "happytraveler@example.com",
  "countryCodeName": "US",
  "phoneNumber": "+18775998200",
  "firstName": "Happy",
  "lastName": "Traveler",
  "airline": "AA",
  "flightNumber": "123",
  "customerSpecialInstructions": "Special instructions changed",
  "partnerTrackingId": "change-1234567ABC"
}

Respuesta exitosa

Responde con el mismo envelope que el booking.

Lee status junto con completed antes de comunicar nada al viajero:

  • completed con completed: true y al menos una reserva: el transfer está reservado.
  • pending: todavía no hay respuesta definitiva. Consulta la reserva para saber cómo terminó; no repitas la petición.
  • failed: la reserva fue rechazada. error explica el motivo.

Cuando el cambio se completa, los identificadores de la nueva reserva reemplazan a los de la anterior. Actualiza todo lo que tuvieras guardado de la reserva original.

Schema de respuesta

status
enum
completedpendingfailed
completed
boolean
Treat the operation as confirmed only when this is true and reservations is not empty.
timedOut
boolean
True when a final state was not reached in time.
reservations
array
reservations[]gdsprovider
enum
0
reservations[]reservationId
string
Persist this value; reservation reads and cancellation need it.
reservations[]confirmationNumber
stringNo
Traveller-facing confirmation code.
reservations[]status
enum
completedpendingfailed
reservations[]cancelled
boolean
reservations[]totalAmount
number
Total charged for the reservation.
reservations[]currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
reservations[]pickupInstructions
stringNo
reservations[]ticketUrl
string
Formato: URL
No
reservations[]selectedScheduleIndex
numberNo
reservations[]departureDatetime
string
Formato: ISO 8601
No
reservations[]arrivalDatetime
string
Formato: ISO 8601
No
reservations[]selectedAmenities
array
reservations[]selectedAmenities[]key
string
Value to send in selectedAmenities.
reservations[]selectedAmenities[]name
string
Localized name.
reservations[]selectedAmenities[]description
stringNo
reservations[]selectedAmenities[]imageUrl
string
Formato: URL
No
reservations[]selectedAmenities[]pngImageUrl
string
Formato: URL
No
reservations[]selectedAmenities[]inputType
enum
booleannumeric
No
reservations[]selectedAmenities[]included
boolean
True when the amenity is already part of the offer.
reservations[]selectedAmenities[]selectable
boolean
True when the amenity can be added to this offer.
reservations[]selectedAmenities[]selected
boolean
True when the amenity is part of the priced selection.
error
stringNo
Present when status is failed.
metadata
object
metadatauseSearchIdForDetails
boolean
True when reservation details must be read with searchId instead of reservationId.
metadatadetailsIdentifier
enum
reservationIdsearchId
Identifier to use when reading the reservation.
metadatadetailsSearchId
stringNo
Present when detailsIdentifier is searchId.
metadatamessage
stringNo

Ejemplos de respuesta

200 Cambiado

json
json
{
  "status": "completed",
  "completed": true,
  "timedOut": false,
  "reservations": [
    {
      "gdsprovider": 0,
      "reservationId": "c204ab71cf4c4f0d9a2f2c5a4de1b8f3",
      "confirmationNumber": "TZ-6202244",
      "status": "completed",
      "cancelled": false,
      "totalAmount": 49.84,
      "currency": "USD",
      "pickupInstructions": "The driver will call you when he arrives.",
      "departureDatetime": "2026-08-30T22:40:00-04:00",
      "arrivalDatetime": "2026-08-30T23:06:00-04:00",
      "selectedAmenities": []
    }
  ],
  "metadata": {
    "useSearchIdForDetails": false,
    "detailsIdentifier": "reservationId"
  }
}

200 Sin respuesta definitiva

json
json
{
  "status": "pending",
  "completed": false,
  "timedOut": false,
  "reservations": [],
  "metadata": {
    "useSearchIdForDetails": false,
    "detailsIdentifier": "reservationId"
  }
}

Errores

HTTPCódigoSignificadoAcción recomendada
400El body, la query o el path son inválidos, o incluyen una propiedad desconocida.Corrige la petición usando el array message.
400transfer_invalid_currencyLa moneda está fuera de la lista soportada.Usa una moneda soportada.
400transfer_invalid_languageEl idioma solicitado no está soportado.Usa uno de los valores de idioma documentados.
429transfer_provider_errorEl servicio está temporalmente limitado por rate limit.Reintenta con backoff exponencial.
502transfer_provider_errorLa petición no pudo completarse.No asumas que tuvo éxito. Conserva tus identificadores y consulta la reserva cuando la operación pudiera haberse creado.
400transfer_pricing_requiredLa petición no incluye pricing token.Llama primero a pricing y envía su pricingToken.
400transfer_invalid_booking_tokenEl booking token expiró, fue modificado o no pertenece a esta oferta.Vuelve a buscar y usa el token de la nueva oferta seleccionada.
400transfer_invalid_pricing_tokenEl pricing token es inválido o inconsistente con el resto de la petición.Vuelve a pedir pricing y envía sin cambios el token devuelto.
400transfer_invalid_amenitiesLas keys de amenities están duplicadas, vacías o no están disponibles en esta oferta.Envía keys únicas tomadas de la oferta o del catálogo de amenities.
400transfer_currency_mismatchLa moneda no coincide con la oferta, la cotización o la reserva.Reutiliza la moneda devuelta por el paso anterior, u omite el campo para heredarla.
400transfer_flight_info_requiredLa oferta exige airline y flightNumber.Envía ambos campos de vuelo cuando la oferta tenga flightInfoRequired: true.
400transfer_return_flight_info_requiredUn round trip exige los datos del vuelo de retorno.Envía returnAirline y returnFlightNumber.
409transfer_price_changedEl precio de la oferta ya no es el que se cotizó.Vuelve a pedir pricing y cobra el nuevo finalPrice.amount.
409transfer_booking_in_progressLa reserva no pudo aceptarse para este pricing token.Consulta la reserva antes de crear otra, para no reservar dos veces.
410transfer_pricing_expiredLa cotización expiró antes de crear la reserva.Vuelve a buscar y a cotizar.

Notas de uso

Si un token de cambio expira o el importe cambia, repite la búsqueda de cambio y el pricing. Un oldReservationId ausente o mal formado se rechaza con 400.

Ejemplo cURL

bash
bash
curl --request POST \
  --url "https://api.sandbox.travelandz.com/v1/transfers/reservations/changes" \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
  -H "Content-Type: application/json" \
  --data '{
  "oldReservationId": "5c8563a5d31d4c33a3a1eafbbfe59c4b",
  "useReservationCard": true,
  "gdsprovider": 0,
  "bookingToken": "opaque_change_offer_token_generated_by_travelandz",
  "pricingToken": "opaque_change_pricing_token_generated_by_travelandz",
  "searchId": "5c8563a5d31d4c33a3a1eafbbfe59c49",
  "resultId": "763475651c06f5ac31ea587084dc0640",
  "currency": "USD",
  "email": "happytraveler@example.com",
  "countryCodeName": "US",
  "phoneNumber": "+18775998200",
  "firstName": "Happy",
  "lastName": "Traveler",
  "airline": "AA",
  "flightNumber": "123",
  "customerSpecialInstructions": "Special instructions changed",
  "partnerTrackingId": "change-1234567ABC"
}'