TravelCaster API - Flights - AddBookingInfos operation

Back to Flights home.


The AddBookingInfos operation is the batch version of AddBookingInfo: it adds several additional information entries to an existing booking in a single call. Each entry is assigned to a specific passenger within the booking.

Operation Overview

  • Purpose: attach many custom fields to one booking at once, instead of making one AddBookingInfo call per field. Besides saving round trips, the whole batch produces a single booking history entry, and therefore a single notification, rather than one per field.
  • All-or-nothing: every item is validated before anything is written. If any item is invalid, the whole batch is rejected and no change is applied - there is no partial application.

Dependencies

To call this operation, you need a valid token, obtained previously with the GetAccessToken operation. If your token is no longer valid, you will receive a 1210 error. See the Transaction Codes page for more information.

Request

JSON | XML

http://endpoint/api/version/FlightService.format/AddBookingInfos

(POST) body - AddBookingInfosRequest

format: json | xml

returns: AddBookingInfosResponse

WebService

http://endpoint/api/version/FlightService.asmx

operation: AddBookingInfos

parameters: request ([request])

returns: AddBookingInfosResponse

Structure of the AddBookingInfosRequest object

AddBookingInfosRequest
 |
 |_ Token (mandatory)
 |
 |_ BookingNumber (string - mandatory)
 |_ Items (BookingInfoItem[] - mandatory - at least one item)
    |_ PaxNumber (int - mandatory - RetrieveBookingResponse Passengers.Number)
    |_ FieldName (string - mandatory - max 50 characters)
    |_ Value (string - mandatory - max 200 characters)

Structure of the AddBookingInfosResponse object

AddBookingInfosResponse
 |
 |_ Token
 |_ TransactionID (string)
 |_ TransactionCode (string)
 |_ TransactionMessage (string)
 |
 |_ BookingNumber (string)
 |_ Results (BookingInfoItemResult[] - one per requested item, in request order)
    |_ Index (int - zero-based position of the item in the request Items array)
    |_ PaxNumber (int - echoed back from the requested item)
    |_ FieldName (string - echoed back from the requested item)
    |_ ResultCode (string - "0" when this item's data is valid)
    |_ ResultMessage (string - reason this item is invalid, null when ResultCode is "0")

Notes

All-or-nothing behaviour

Whether the entries were actually stored is decided by the response envelope, not by the per-item results:

  • TransactionCode: null — every item in the batch was applied.
  • TransactionCode: not nullnone of them were applied.

Results reports whether each individual item's data was valid, independently of that. A ResultCode of "0" on a rejected batch means this item was fine, but the batch as a whole was rejected because of another item. Use it to identify which item(s) to fix before retrying.

When the batch is rejected because of validation, the response carries TransactionCode 2104 and a TransactionMessage stating how many items failed, and the offending items carry their own ResultCode/ResultMessage.

Item validation

Each item must satisfy all of the following:

  • FieldName and Value are not empty; FieldName is at most 50 characters and Value at most 200 characters.
  • PaxNumber is greater than zero and matches a passenger present on the booking (see Passengers.Number in the RetrieveBooking response).
  • The (PaxNumber, FieldName) pair appears only once within the batch. Repeating a pair in the same request is a validation failure (2103) rather than a silent overwrite of the earlier one. Field names are compared case-insensitively.

Sending an entry for a (PaxNumber, FieldName) pair that already exists on the booking updates its value, exactly as AddBookingInfo does.

Booking history and notifications

A successful batch writes exactly one booking history entry summarizing the fields updated - and therefore triggers exactly one notification - regardless of how many items it contained. A rejected batch writes none.

Status response

  • Success response: "TransactionCode": null
  • Error response: Refers to Transaction Codes page by "TransactionCode".

Transaction codes

Code Description
1000 Unspecified error — see TransactionMessage
1002 One or more parameters is empty (BookingNumber and/or Items)
1210 Session expired — obtain a new token via GetAccessToken
2100 Permission denied
2104 One or more items failed validation; no changes were applied — see Results

Per-item codes returned in Results[].ResultCode:

Code Description
0 The item is valid
1002 Item is null, FieldName or Value is empty, FieldName exceeds 50 characters, or Value exceeds 200 characters
2101 No passenger found with the requested PaxNumber
2102 Invalid PaxNumber
2103 Duplicate PaxNumber/FieldName within the same batch

Back to Flights home.


See change history for this file
Loading...