buy_id returned by this method.buy_id (path, string) - buy_id of the selected offer from POST /api/air/offers or GET /api/air/offers/{buy_id}/smart_ff. Required.price_change_confirm (query, 1 or 0) - send 1 if your system can show a new price to the user and ask for confirmation. Default: 0. See "Price change". Optional.etm-auth-key (header) - session key from POST /api/login. Required.| Search buy_id | Booking buy_id | |
|---|---|---|
| Source | POST /api/air/offers, smart_ff | Response of this method |
| Example | request_86e7a14d-..._10, ff_..._2 | 2275014016, 2275014016_2275014017 |
| Valid | While search results are kept: at least 20 minutes after the search starts | No time limit on the ETS side. One order per buy_id |
| Used in | Offer info, Offer rules, Smart offer, Availability | Availability, Additional services, Create Order, Offer rules |
buy_id returns a new booking buy_id. Use the one from the latest successful response.buy_id returns 404 without code (see "Errors").buy_id does not expire on the ETS side, but the supplier can change the price or sell the seats at any time. Create the order right after Availability. If some time has passed, call Availability again with the booking buy_id: the offer is checked with the supplier again.buy_id can be used for one order. A second Create Order with the same buy_id returns an error.status: ok and availability: true mean that the supplier confirmed the offer at the moment of the request. It is not a booking and does not hold seats. Seats are booked by Create Order, and the final price is confirmed there.message can contain text for the user even when status is ok. Show it to the user. Several warnings are joined with a space. For example:message lists the old and new times of each changed flight;message is localized and can change: do not parse it.popup_message - text that must be shown to the user before booking, for example about delayed ticketing. Empty string if there is nothing to show.price_change_confirm=1 - error 404 with code 3004, the same as when the offer is not available;price_change_confirm=1 - status: ok and the price_changed block:old_price (number) - price from the search results;new_price (number) - current price;currency (string) - currency of both prices.price_details contains the new price by passenger type, and message contains the text about the change. Show the new price to the user and create the order only after the user agrees.price_changed is returned only when Availability is called with a search buy_id.message, without price_changed. The final price is confirmed in Create Order: if it differs, Create Order returns status: price_changed (see 10 Create Order).price_change_confirm=1 and checking price_changed in the response.POST /api/air/offers:interline, flights_info[].self_dock, flights_info[].bagsRecheck - self-transfer, see 4 Offers request;is_delayed_ticketing - delayed ticketing.is_delayed_ticketing: true means that the supplier issues the ticket some time after payment, not during the payment request. Ticketing can take up to 24 hours. After payment the order has status K (ticketing in progress) and changes to T when the ticket is issued. Check the status with Get order info. Show the user a warning before booking.buy_id.status (string) - ok.availability (boolean) - always true in a successful response.buy_id (string) - booking buy_id. Use it in Create Order and Additional services.request_id (integer) - ID for GET /api/air/offers/{request_id}/additional-services. Not the search request_id (UUID).message (string) - warnings for the user, empty if there are none.popup_message (string) - see "Warnings in a successful response".allow_cyrillic (boolean) - true if passenger names for this offer can be entered in Cyrillic.gds (string) - supplier label. Informational.price_changed (object) - only when the price has changed, see "Price change".price_details (array) - only together with price_changed. Same format as price_details in 4 Offers request.check_in_details (object) - only for some low-cost carriers. Informational.offer_key (string) - for internal use. Ignore it.code: 3004 - the offer cannot be booked. The reason can be: no seats, the supplier did not confirm the offer or the price, the supplier did not respond or returned an error, or the booking buy_id was not found. message contains the supplier's text or a general text. The code is the same for all these reasons. Repeat Availability once: the supplier failure may be temporary. If the error repeats, select another offer or start a new search.{"status": "error", "code": 3004, "message": "There are no seats available. Please try another option or change your search criteria."}code - the search buy_id was not found: the search results have expired or the buy_id is invalid. Start a new search.{"status": "error", "message": ""}etm-auth-key header is missing or the session has expired. See "Authentication troubleshooting" in AVIA API Documentation.buy_id from this response. Optional before it: GET {{url}}/api/air/offers/{{request_id}}/additional-services?segment={{buy_id}}.curl --location --globoff 'https://stage-api.etm-system.com/api/air/offers/{{buy_id}}/availability?price_change_confirm=1' \
--header 'Accept: application/json' \
--header 'Etm-Auth-Key: ' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'Content-Type: application/json'{
"status": "ok",
"message": "",
"availability": true,
"gds": "Amadeus",
"request_id": 16915125,
"popup_message": "",
"allow_cyrillic": false,
"buy_id": "2275014016"
}