### GET /finance/balance Source: https://context7.com/el-djalalov/avia-wiki/llms.txt This endpoint retrieves the current account balance and available funds for bookings. It uses a GET request with an authentication key as a query parameter. The response provides balance details including currency amounts, reserved funds, and credit limits. ```APIDOC ## GET /finance/balance ### Description Retrieve current account balance and available funds for bookings. ### Method GET ### Endpoint https://api.example.com/finance/balance ### Parameters #### Path Parameters - None #### Query Parameters - **auth_key** (string) - Required - Authentication key for API access. #### Request Body - None ### Request Example No request body required. Query parameters in URL: https://api.example.com/finance/balance?auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **code** (integer) - Response code (0 for success). - **data** (object) - Contains balance with amount, reserved, available, and credit limit in specified currency. #### Response Example { "success": true, "code": 0, "data": { "balance": { "RUB": { "amount": 500000.00, "reserved": 150000.00, "available": 350000.00 } }, "credit_limit": { "RUB": {"amount": 1000000.00} } } } ``` -------------------------------- ### Get Account Balance (REST API) Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Retrieve the current account balance, including reserved and available funds, along with the credit limit. Requires an authentication key. Returns balance and credit limit details, typically in a specified currency. ```bash curl -X GET "https://api.example.com/finance/balance?auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac" ``` -------------------------------- ### GET /avia/fare-families Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Retrieves available fare families and upgrades for a selected flight, showing feature comparison and price differences. ```APIDOC ## GET /avia/fare-families ### Description Retrieve available fare families and upgrades for a selected flight. Shows feature comparison and price differences between fare options. ### Method GET ### Endpoint /avia/fare-families ### Parameters #### Query Parameters - **flight_id** (string) - Required - Unique identifier for the flight. - **auth_key** (string) - Required - API authentication key. ### Request Example ```bash curl -X GET "https://api.example.com/avia/fare-families?flight_id=3CPSEASYOWA1001090MOWLED2024130_GI_31_RU-TUA.SU.0.95...&auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac" ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **code** (integer) - Response code. - **data** (object) - Contains fare family information. - **base_flight** (object) - Details of the base flight fare. - **id** (string) - Flight identifier. - **fare_family_type** (string) - Type of fare family. - **price** (object) - Price details in different currencies. - **is_baggage** (boolean) - Indicates if baggage is included. - **is_refund** (boolean) - Indicates if the fare is refundable. - **is_change** (boolean) - Indicates if the fare is changeable. - **baggage** (object) - Baggage allowance details. - **cabin_baggage** (object) - Cabin baggage allowance details. - **upgrades** (array) - List of available fare upgrades. - **id** (string) - Upgrade identifier. - **fare_family_type** (string) - Type of fare family for the upgrade. - **increase_price** (object) - Price increase for the upgrade. - **is_baggage** (boolean) - Indicates if baggage is included in the upgrade. - **baggage** (object) - Baggage allowance details for the upgrade. - **is_refund** (boolean) - Indicates if the upgraded fare is refundable. - **is_change** (boolean) - Indicates if the upgraded fare is changeable. #### Response Example ```json { "success": true, "code": 0, "data": { "base_flight": { "id": "3CPSEASYOWA1001090MOWLED2024130_GI_31_RU-TUA.SU...", "fare_family_type": "Economy Lite", "price": {"RUB": {"amount": 4581.70}}, "is_baggage": false, "is_refund": false, "is_change": true, "baggage": {"piece": 0, "weight": null}, "cabin_baggage": {"piece": 1, "weight": 10} }, "upgrades": [ { "id": "upgrade_1", "fare_family_type": "Economy Standard", "increase_price": {"RUB": {"amount": 1200.00}}, "is_baggage": true, "baggage": {"piece": 1, "weight": 23}, "is_refund": false, "is_change": true }, { "id": "upgrade_2", "fare_family_type": "Economy Flex", "increase_price": {"RUB": {"amount": 3500.00}}, "is_baggage": true, "baggage": {"piece": 1, "weight": 23}, "is_refund": true, "is_change": true } ] } } ``` ``` -------------------------------- ### Flight Search One-Way API GET Request Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Searches for one-way flights using a GET request. It requires passenger counts, service class, and segment details including origin, destination, and date. The response provides a success status, a process ID, execution time, and a Search Result Object (SRO) identifier for retrieving detailed results. ```bash curl -X GET "https://api.example.com/avia/search?adt=1&chd=0&inf=0&src=0&yth=0&class=e&segments[0][from]=MOW&segments[0][to]=SVX&segments[0][date]=29.07.2018&lang=ru&auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac" ``` -------------------------------- ### Flight Search Round-Trip API GET Request Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Searches for round-trip flights by specifying multiple segments in a GET request. It supports complex itineraries and allows filtering by airlines and GDS providers. Parameters include passenger counts, service class, segment details, and optional filters for direct flights, airlines, and GDS inclusion/exclusion. ```bash curl -X GET "https://api.example.com/avia/search?adt=1&chd=0&inf=0&src=0&yth=0&class=e&segments[0][from]=MOW&segments[0][to]=LED&segments[0][date]=18.05.2018&segments[1][from]=LED&segments[1][to]=MOW&segments[1][date]=14.06.2018&is_direct_only=1&filter_airlines[0]=SU&gds_white_list[0]=17&lang=ru&auth_key=531e0b51b74d7f0ec164b8bf05b61ef5" ``` -------------------------------- ### GET /avia/search-result Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Retrieves flight recommendations based on a Search Result Object (SRO). It returns detailed flight information such as pricing, baggage allowances, fare rules, and segment details. ```APIDOC ## GET /avia/search-result ### Description Retrieves flight recommendations using a Search Result Object (SRO). Returns comprehensive flight details including pricing, baggage allowances, fare rules, and segment information. ### Method GET ### Endpoint /avia/search-result ### Parameters #### Query Parameters - **sro** (string) - Required - The Search Result Object identifier. - **lang** (string) - Optional - The language code for the response (e.g., 'en', 'ru'). - **auth_key** (string) - Required - Your API authentication key. ### Request Example ```bash curl -X GET "https://api.example.com/avia/search-result?sro=MY0100OWE1000MOWPKC20170729&lang=ru&auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac" ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **code** (integer) - An integer code representing the status of the operation. - **pid** (string) - A unique identifier for the search process. - **time** (object) - Contains timing information for the API request. - **execution** (float) - The execution time in seconds. - **data** (object) - Contains the main search and flight data. - **search** (object) - Details about the search query. - **adt** (integer) - Number of adults. - **chd** (integer) - Number of children. - **inf** (integer) - Number of infants. - **class** (string) - The requested flight class. - **segments** (array) - An array of flight segments. - **from** (object) - Departure location details. - **name** (string) - City name. - **iata** (string) - IATA code of the city. - **country** (object) - Country details. - **name** (string) - Country name. - **iata** (string) - IATA code of the country. - **to** (object) - Arrival location details. - **name** (string) - City name. - **iata** (string) - IATA code of the city. - **country** (object) - Country details. - **name** (string) - Country name. - **iata** (string) - IATA code of the country. - **date** (string) - Departure date in 'DD.MM.YYYY' format. - **type** (string) - Type of the search (e.g., 'ow' for one-way). - **flights** (array) - An array of flight objects. - **id** (string) - Unique identifier for the flight. - **is_tour_operator** (boolean) - Indicates if the flight is from a tour operator. - **fare_family_type** (string) - The fare family type. - **duration** (integer) - Flight duration in minutes. - **segments_count** (integer) - Number of segments in the flight. - **type** (string) - Type of flight (e.g., 'regular', 'charter'). - **is_baggage** (boolean) - Indicates if baggage is included. - **is_refund** (boolean) - Indicates if the ticket is refundable. - **is_change** (boolean) - Indicates if the ticket can be changed. - **provider** (object) - Information about the flight provider. - **gds** (integer) - GDS identifier. - **name** (string) - Provider name. - **supplier** (object) - Supplier details. - **id** (integer) - Supplier ID. - **code** (string) - Supplier code. - **title** (string) - Supplier title. - **price** (object) - Pricing information. - **RUB** (object) - Pricing in Russian Rubles. - **amount** (float) - Total amount. - **passengers_amounts** (object) - Amount per passenger type. - **adult** (float) - Amount for adults. - **passengers_amounts_details** (array) - Detailed breakdown of passenger amounts. - **type** (string) - Passenger type (e.g., 'adt'). - **amount** (float) - Amount for this passenger type. - **tax** (float) - Tax amount. - **tarif** (float) - Fare amount. - **fee** (float) - Fee amount. - **commission** (float) - Commission amount. - **segments** (array) - An array of segment objects within the flight. - **dep** (object) - Departure details for the segment. - **date** (string) - Departure date. - **time** (string) - Departure time. - **datetime** (string) - Full departure date and time. - **ts** (integer) - Unix timestamp for departure. - **terminal** (string) - Departure terminal. - **airport** (object) - Departure airport details. - **id** (integer) - Airport ID. - **title** (string) - Airport title. - **code** (string) - Airport IATA code. - **city** (object) - Departure city details. - **id** (integer) - City ID. - **code** (string) - City IATA code. - **title** (string) - City title. - **country** (object) - Departure country details. - **id** (integer) - Country ID. - **code** (string) - Country IATA code. - **title** (string) - Country title. - **ar** (object) - Arrival details for the segment. - **date** (string) - Arrival date. - **time** (string) - Arrival time. - **datetime** (string) - Full arrival date and time. - **ts** (integer) - Unix timestamp for arrival. - **terminal** (string) - Arrival terminal. - **airport** (object) - Arrival airport details. - **id** (integer) - Airport ID. - **title** (string) - Airport title. - **code** (string) - Airport IATA code. - **city** (object) - Arrival city details. - **id** (integer) - City ID. - **code** (string) - City IATA code. - **title** (string) - City title. - **country** (object) - Arrival country details. - **id** (integer) - Country ID. - **code** (string) - Country IATA code. - **title** (string) - Country title. - **seats** (integer) - Available seats. - **flight_number** (string) - Flight number. - **direction** (integer) - Flight direction indicator. - **duration** (object) - Duration details for the segment. - **flight** (object) - Flight time. - **common** (integer) - Total flight time in minutes. - **hour** (integer) - Flight hours. - **minute** (integer) - Flight minutes. - **transfer** (object) - Transfer time. - **common** (integer) - Total transfer time in minutes. - **hour** (integer) - Transfer hours. - **minute** (integer) - Transfer minutes. - **is_baggage** (boolean) - Indicates if baggage is included for this segment. - **baggage** (object) - Baggage information. - **piece** (integer) - Number of baggage pieces. - **weight** (float/null) - Maximum baggage weight in kg. - **cabin_baggage** (object) - Cabin baggage information. - **piece** (integer) - Number of cabin baggage pieces. - **weight** (float) - Maximum cabin baggage weight in kg. - **dimensions** (string/null) - Cabin baggage dimensions. - **is_refund** (boolean) - Indicates if refund is allowed for this segment. - **is_change** (boolean) - Indicates if changes are allowed for this segment. - **refundBlock** (object) - Refund rules. - **beforeDeparture** (object) - Refund rules before departure. - **available** (boolean) - Whether refund is available. - **isFree** (boolean) - Whether refund is free. - **comment** (string) - Comment on refund policy. - **exchangeBlock** (object) - Exchange rules. - **beforeDeparture** (object) - Exchange rules before departure. - **available** (boolean) - Whether exchange is available. - **isFree** (boolean) - Whether exchange is free. - **comment** (string) - Comment on exchange policy. - **class** (object) - Flight class details. - **type_id** (integer) - Class type ID. - **name** (string) - Class name. - **service** (string) - Service associated with the class. - **fare_code** (string) - Fare code for the segment. - **carrier** (object) - Airline carrier details. - **id** (integer) - Carrier ID. - **code** (string) - Carrier IATA code. - **title** (string) - Carrier name. - **aircraft** (object) - Aircraft details. - **code** (string) - Aircraft code. - **title** (string) - Aircraft model. - **stops** (array) - Array of stopover details (empty if no stops). - **is_mini_rules_exists** (boolean) - Indicates if mini fare rules are available. - **baggage_recheck** (boolean) - Indicates if baggage recheck is required. #### Response Example (Abbreviated) ```json { "success": true, "code": 0, "pid": "284245_202011831464027", "time": {"execution": 1.1912}, "data": { "search": { "adt": 1, "chd": 0, "inf": 0, "class": "E", "segments": [ { "from": {"name": "Moscow", "iata": "MOW", "country": {"name": "Russia", "iata": "RU"}}, "to": {"name": "New York", "iata": "NYC", "country": {"name": "USA", "iata": "US"}}, "date": "21.01.2020" } ], "type": "ow" }, "flights": [ { "id": "MY10EASYOWE1000090MOWNYC2020121-TUA.EK.0.2120...", "is_tour_operator": false, "fare_family_type": "Economy Flex", "duration": 2120, "segments_count": 2, "type": "regular", "is_baggage": true, "is_refund": false, "is_change": true, "provider": {"gds": 17, "name": "TUA", "supplier": {"id": 719, "code": "EK", "title": "Emirates"}}, "price": {"RUB": {"amount": 76916, "passengers_amounts": {"adult": 76916}, "passengers_amounts_details": [{"type": "adt", "amount": 76916, "tax": 1094, "tarif": 65905, "fee": 68, "commission": -1}]}}, "segments": [ { "dep": {"date": "21.01.2020", "time": "15:40", "datetime": "21.01.2020 15:40:00", "ts": 1642768000, "terminal": "", "airport": {"id": 80753, "title": "Vnukovo", "code": "VKO"}, "city": {"id": 64192, "code": "MOW", "title": "Moscow"}, "country": {"id": 191, "code": "RU", "title": "Russia"}}, "ar": {"date": "21.01.2020", "time": "02:05", "datetime": "21.01.2020 02:05:00", "ts": 1642791900, "terminal": "2", "airport": {"id": 79531, "title": "Dubai", "code": "DXB"}, "city": {"id": 12, "code": "DXB", "title": "Dubai"}, "country": {"id": 2, "code": "AE", "title": "UAE"}}, "seats": 9, "flight_number": "231", "duration": {"flight": {"common": 325, "hour": 5, "minute": 25}, "transfer": {"common": 60, "hour": 1, "minute": 0}}, "is_baggage": true, "baggage": {"piece": 2, "weight": null}, "cabin_baggage": {"piece": 1, "weight": 7, "dimensions": null}, "is_refund": false, "is_change": true, "refundBlock": {"beforeDeparture": {"available": false, "isFree": false, "comment": "Not allowed"}}, "exchangeBlock": {"beforeDeparture": {"available": true, "isFree": false, "comment": "Exchange before departure with fee from 40 rubles"}}, "class": {"type_id": 1, "name": "E", "service": "K"}, "fare_code": "KLSOSRU1", "carrier": {"id": 924, "code": "FZ", "title": "Flydubai"}, "aircraft": {"code": "73H", "title": "Boeing 737-800 with winglets"}, "stops": [], "is_mini_rules_exists": true, "baggage_recheck": true }, { "dep": {"date": "22.01.2020", "time": "09:05", "datetime": "22.01.2020 09:05:00", "ts": 1642831500, "terminal": "3", "airport": {"id": 79531, "title": "Dubai", "code": "DXB"}, "city": {"id": 12, "code": "DXB", "title": "Dubai"}, "country": {"id": 2, "code": "AE", "title": "UAE"}}, "ar": {"date": "22.01.2020", "time": "19:00", "datetime": "22.01.2020 19:00:00", "ts": 1642867200, "terminal": "4", "airport": {"id": 80962, "title": "John F. Kennedy", "code": "JFK"}, "city": {"id": 7069274, "code": "NYC", "title": "New York"}, "country": {"id": 231, "code": "US", "title": "USA"}}, "seats": 9 } ] } ] } } ``` ``` -------------------------------- ### GET /avia/search-cached Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Retrieves flight search results using cached recommendations for faster response times. Includes cache metadata. ```APIDOC ## GET /avia/search-cached ### Description Search with cached recommendations for faster response times. Includes cache metadata showing last update time and expiration. ### Method GET ### Endpoint /avia/search-cached ### Parameters #### Query Parameters - **from** (string) - Required - Departure airport IATA code. - **to** (string) - Required - Arrival airport IATA code. - **date** (string) - Required - Departure date in YYYY-MM-DD format. - **adt** (integer) - Required - Number of adult passengers. - **class** (string) - Optional - Travel class (e.g., 'e' for economy). - **auth_key** (string) - Required - API authentication key. ### Request Example ```bash curl -X GET "https://api.example.com/avia/search-cached?from=VOZ&to=AER&date=2021-03-20&adt=1&class=e&auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac" ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **code** (integer) - Response code. - **data** (object) - Contains the flight recommendations. - **recommendations** (array) - List of flight recommendations. - **departure_airport_iata** (string) - Departure airport IATA code. - **departure_city_iata** (string) - Departure city IATA code. - **arrival_airport_iata** (string) - Arrival airport IATA code. - **arrival_city_iata** (string) - Arrival city IATA code. - **departure_date_forward** (string) - Forward departure date and time. - **arrival_date_forward** (string) - Forward arrival date and time. - **price** (string) - Flight price. - **passengers_price_details** (array) - Price details per passenger type. - **validating_carrier_code** (string) - Validating carrier code. - **is_refundable** (boolean) - Indicates if the flight is refundable. - **is_changeable** (boolean) - Indicates if the flight is changeable. - **route_duration** (integer) - Route duration in minutes. - **categories** (array) - Flight categories. - **places_available** (integer) - Number of available seats. - **segments** (object) - Flight segments details. - **is_from_cache** (boolean) - Indicates if the data is from cache. - **updated_at** (string) - Cache update timestamp. - **recommendation_time_life** (string) - Cache expiration timestamp. #### Response Example ```json { "success": true, "code": 0, "data": { "recommendations": [ { "departure_airport_iata": "VOZ", "departure_city_iata": "VOZ", "arrival_airport_iata": "AER", "arrival_city_iata": "AER", "departure_date_forward": "2021-03-20 21:50:00", "arrival_date_forward": "2021-03-21 03:45:00", "price": "7103.00", "passengers_price_details": [ {"type": "adt", "amount": 7103, "tax": 0, "tarif": 6897, "fee": 206} ], "validating_carrier_code": "DP", "is_refundable": false, "is_changeable": false, "route_duration": 215, "categories": ["NON_DIRECT_BAGGAGE"], "places_available": 2, "segments": { "forward": [ { "departure_airport_iata": "VOZ", "arrival_airport_iata": "VKO", "departure_date": "2021-03-20 21:50:00", "arrival_date": "2021-03-20 22:45:00", "flight_duration": 70, "operating_carrier_code": "DP", "flight_number": "274", "service_class": "E", "booking_class": "T", "baggage": {"weight": 10, "piece": 1}, "cabin_baggage": {"weight": 10, "piece": 1} } ] }, "is_from_cache": true, "updated_at": "2020-12-15 04:20:30", "recommendation_time_life": "2021-08-30 12:45:36" } ] } } ``` ``` -------------------------------- ### Get Flight Insurance Pricing (REST API) Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Retrieve available insurance options and their pricing for passengers on a specific flight. Requires flight ID, passenger details (type, birthdate), and an authentication key. Returns a list of insurance options with prices per passenger and total. ```bash curl -X POST "https://api.example.com/avia/insurance/price" \ -H "Content-Type: application/json" \ -d '{ "flight_id": "MY10EASYOWE1000090MOWNYC2020121-TUA.EK.0.2120...", "passengers": [ {"type": "adt", "birthdate": "1985-03-15"}, {"type": "chd", "birthdate": "2015-06-20"} ], "auth_key": "ce78e8e5daf8cefb7b9c1c87adb1ac" }' ``` -------------------------------- ### GET /avia/search (Round Trip) Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Searches for round-trip or multi-city flights by defining multiple segments with dates. Supports direct flights only filter, airline and GDS whitelisting/blacklisting. Returns SRO for results; handles unlimited segments for complex itineraries. ```APIDOC ## GET /avia/search (Round Trip) ### Description Initiates a round-trip or multi-segment flight search with passenger details and filters. Allows specification of multiple segments for itineraries. Authentication and language parameters are included; results via SRO. ### Method GET ### Endpoint https://api.example.com/avia/search ### Parameters #### Path Parameters None #### Query Parameters - **adt** (integer) - Required - Number of adults - **chd** (integer) - Optional - Number of children (2-12 years) - **inf** (integer) - Optional - Number of infants (0-2 years) - **src** (integer) - Optional - Number of seniors - **yth** (integer) - Optional - Number of students - **class** (string) - Required - Service class (e.g., "e" for economy) - **segments[n][from]** (string) - Required - Origin IATA for segment n - **segments[n][to]** (string) - Required - Destination IATA for segment n - **segments[n][date]** (string) - Required - Date for segment n (DD.MM.YYYY) - **is_direct_only** (integer) - Optional - 1 to filter direct flights only - **filter_airlines[n]** (string) - Optional - Airline IATA codes to filter - **gds_white_list[n]** (integer) - Optional - GDS providers to include - **gds_black_list[n]** (integer) - Optional - GDS providers to exclude - **lang** (string) - Optional - Language code - **auth_key** (string) - Required - Authentication token #### Request Body None ### Request Example curl -X GET "https://api.example.com/avia/search?adt=1&chd=0&inf=0&src=0&yth=0&class=e&segments[0][from]=MOW&segments[0][to]=LED&segments[0][date]=18.05.2018&segments[1][from]=LED&segments[1][to]=MOW&segments[1][date]=14.06.2018&is_direct_only=1&filter_airlines[0]=SU&gds_white_list[0]=17&lang=ru&auth_key=531e0b51b74d7f0ec164b8bf05b61ef5" ### Response #### Success Response (200) - **success** (boolean) - True if search initiates successfully - **code** (integer) - 0 for success - **pid** (string) - Process ID - **time** (object) - Execution time details - **data** (object) - Contains SRO identifier #### Response Example { "success": true, "code": 0, "pid": "15652_596cae8c395c2", "time": {"execution": 0.0903}, "data": { "sro": "MY0100OWE1000MOWSVX20170729" } } ``` -------------------------------- ### GET /avia/search (One Way) Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Searches for one-way flights based on origin, destination, date, passenger counts, and class. Returns a Search Result Object (SRO) identifier for polling results. Supports filters and configurable timeouts up to 20 seconds. ```APIDOC ## GET /avia/search (One Way) ### Description Performs a one-way flight search with specified segments, passenger types, and service class. Returns an SRO identifier to retrieve detailed results asynchronously. Authentication via auth_key query parameter is required. ### Method GET ### Endpoint https://api.example.com/avia/search ### Parameters #### Path Parameters None #### Query Parameters - **adt** (integer) - Required - Number of adults - **chd** (integer) - Optional - Number of children (2-12 years) - **inf** (integer) - Optional - Number of infants (0-2 years) - **src** (integer) - Optional - Number of seniors - **yth** (integer) - Optional - Number of students - **class** (string) - Required - Service class (e.g., "e" for economy) - **segments[0][from]** (string) - Required - Origin IATA code - **segments[0][to]** (string) - Required - Destination IATA code - **segments[0][date]** (string) - Required - Departure date (DD.MM.YYYY) - **lang** (string) - Optional - Language code - **auth_key** (string) - Required - Authentication token #### Request Body None ### Request Example curl -X GET "https://api.example.com/avia/search?adt=1&chd=0&inf=0&src=0&yth=0&class=e&segments[0][from]=MOW&segments[0][to]=SVX&segments[0][date]=29.07.2018&lang=ru&auth_key=ce78e8e5daf8cefb7b9c1c87adb1ac" ### Response #### Success Response (200) - **success** (boolean) - True if search initiates successfully - **code** (integer) - 0 for success - **pid** (string) - Process ID - **time** (object) - Execution time details - **data** (object) - Contains SRO identifier #### Response Example { "success": true, "code": 0, "pid": "15652_596cae8c395c2", "time": {"execution": 0.0903}, "data": { "sro": "MY0100OWE1000MOWSVX20170729" } } ``` -------------------------------- ### Create Booking API Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Book selected flight with passenger details and optional insurance. Returns order ID, billing number, and payment deadline. ```APIDOC ## POST /avia/booking ### Description Book selected flight with passenger details and optional insurance. Returns order ID, billing number, and payment deadline. ### Method POST ### Endpoint https://api.example.com/avia/booking #### Request Body - **flight_id** (string) - Required - Identifier for the flight to book. - **passengers** (array) - Required - List of passenger details. - **type** (string) - Required - Passenger type (e.g., 'adt' for adult). - **first_name** (string) - Required - Passenger's first name. - **last_name** (string) - Required - Passenger's last name. - **middle_name** (string) - Optional - Passenger's middle name. - **gender** (string) - Required - Passenger's gender ('M' or 'F'). - **birthdate** (string) - Required - Passenger's birthdate (YYYY-MM-DD). - **citizenship** (string) - Required - Passenger's citizenship (ISO 3166-1 alpha-2 code). - **document** (object) - Required - Passenger's identification document. - **type** (string) - Required - Document type (e.g., 'P' for passport). - **number** (string) - Required - Document number. - **expire** (string) - Required - Document expiration date (YYYY-MM-DD). - **email** (string) - Required - Passenger's email address. - **phone** (string) - Required - Passenger's phone number. - **contact** (object) - Required - Contact information for the booking. - **email** (string) - Required - Contact email address. - **phone** (string) - Required - Contact phone number. - **insurance** (object) - Optional - Insurance details. - **enabled** (boolean) - Required - Whether insurance is enabled. - **passengers** (array) - Required if enabled - List of passenger indices to include in insurance. ### Request Example ```json { "flight_id": "MY10EASYOWE1000090MOWNYC2020121-TUA.EK.0.2120...", "passengers": [ { "type": "adt", "first_name": "IVAN", "last_name": "PETROV", "middle_name": "SERGEEVICH", "gender": "M", "birthdate": "1985-03-15", "citizenship": "RU", "document": { "type": "P", "number": "123456789", "expire": "2030-12-31" }, "email": "ivan.petrov@email.com", "phone": "+79161234567" } ], "contact": { "email": "booking@agency.com", "phone": "+79161234567" }, "insurance": { "enabled": true, "passengers": [0] } } ``` #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **code** (integer) - Response code. - **pid** (string) - Unique process ID. - **time** (object) - Timing information. - **execution** (number) - Execution time in seconds. - **data** (object) - Booking data. - **order** (object) - Order details. - **order_id** (integer) - Unique order identifier. - **billing_number** (string) - Billing number for the order. - **status** (string) - Current status of the order (e.g., 'booked'). - **created** (string) - Timestamp when the order was created. - **expire** (string) - Timestamp when the order expires. - **ticketing_time_limit** (integer) - Unix timestamp for ticketing deadline. - **price** (object) - Price breakdown. - **RUB** (object) - Price in Russian Rubles. - **amount** (number) - Total amount. - **commission** (number) - Commission amount. - **passengers_amounts** (object) - Amounts per passenger type. - **tickets** (array) - List of tickets associated with the order. - **locator** (string) - Booking locator. - **vnd_locators** (array) - Vendor-specific locators. - **booking_office_id** (string) - Booking office identifier. - **carrier** (object) - Flight carrier information. - **code** (string) - Carrier code (e.g., 'EK'). - **title** (string) - Carrier name (e.g., 'Emirates'). - **passengers** (array) - Passenger details for the ticket. - **id** (integer) - Passenger ID. - **type** (string) - Passenger type. - **first_name** (string) - Passenger's first name. - **last_name** (string) - Passenger's last name. - **ticket_number** (string|null) - Ticket number (null if not yet issued). - **status** (string) - Ticket status. - **insurance** (object) - Insurance details. - **enabled** (boolean) - Whether insurance is enabled. - **price** (object) - Insurance price. - **RUB** (object) - Price in Russian Rubles. - **amount** (number) - Insurance amount. - **policy_numbers** (array) - List of insurance policy numbers. #### Response Example ```json { "success": true, "code": 0, "pid": "2912_5a02f9684bf43", "time": {"execution": 2.5431}, "data": { "order": { "order_id": 123456, "billing_number": "AC-123456", "status": "booked", "created": "2020-01-20 15:30:00", "expire": "2020-01-21 15:30:00", "ticketing_time_limit": 1642086000, "price": { "RUB": { "amount": 76916, "commission": -1, "passengers_amounts": {"adult": 76916} } } }, "tickets": [ { "locator": "ABC123", "vnd_locators": ["EK:ABC123"], "booking_office_id": "P3534125", "carrier": {"code": "EK", "title": "Emirates"}, "passengers": [ { "id": 1, "type": "adt", "first_name": "IVAN", "last_name": "PETROV", "ticket_number": null, "status": "booked" } ] } ], "insurance": { "enabled": true, "price": {"RUB": {"amount": 500}}, "policy_numbers": ["INS-001-2020"] } } } ``` ``` -------------------------------- ### POST /api/user/login Source: https://context7.com/el-djalalov/avia-wiki/llms.txt Authenticates users with login credentials and returns an auth token upon success. Includes protection against brute-force attacks, locking accounts after 20 failed attempts for 180 seconds. Supports language specification for responses. ```APIDOC ## POST /api/user/login ### Description Standard login endpoint for user authentication. After successful login, an auth_token is provided for subsequent API calls. Accounts are protected against brute-force with IP-based lockouts. ### Method POST ### Endpoint https://api.example.com/api/user/login ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **login** (string) - Required - Email or username for login - **password** (string) - Required - Password for authentication - **lang** (string) - Optional - Language code (e.g., "ru") ### Request Example { "login": "agent@travelagency.com", "password": "securePassword123", "lang": "ru" } ### Response #### Success Response (200) - **success** (boolean) - True if login succeeds - **code** (integer) - 0 for success - **pid** (string) - Process ID - **time** (object) - Execution time details - **data** (object) - Contains auth_token #### Response Example { "success": true, "code": 0, "pid": "2912_5a02f9684bf43", "time": {"execution": 0.0321}, "data": { "auth_token": "95a16c8be4787dc70483e64b406d91e5" } } #### Error Response (Account Locked) { "success": false, "code": 7, "pid": "639432_2025012120219190", "time": {"execution": 0.065}, "data": { "message": "Suspicious login attempt. Attempt limit exceeded. Authorization blocked for 3 minutes. Do not retry during this time" } } ```