openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 13.8 kB
JSON
{"openapi":"3.0.0","info":{"description":"\nBefore using this API, we recommend you read our **[Authorization Guide](https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262)** for more information on how to generate an access token. \n\nPlease also be aware that our test environment is based on a subset of the production for this API it may change dynamically. For your tests, use big cities like LON (London) or NYC (New-York).\n\n\n**Warning: Do not perform test booking in production**. All requests are sent and processed by hotel providers. An excessive amount of fake/canceled reservation will make you blacklisted by hotel providers.\n","title":"Hotel Booking","version":"1.1.3","x-logo":{"url":"https://amadeus.com/images/en/technology/mobile-tablet/mobile-woman-office-city.jpg.transform/medium/img.jpg"},"x-origin":[{"format":"swagger","url":"https://raw.githubusercontent.com/amadeus4dev/amadeus-open-api-specification/main/spec/json/HotelBooking_v1_swagger_specification.json","version":"2.0"}],"x-providerName":"amadeus.com","x-serviceName":"amadeus-hotel-booking","x-status":"validated","x-tags":["#mobile-services"]},"tags":[{"name":"Booking"}],"paths":{"/booking/hotel-bookings":{"parameters":[{"$ref":"#/components/parameters/Ama-Client-Ref"},{"$ref":"#/components/parameters/Accept-Encoding"}],"post":{"description":"","operationId":"createBooking","requestBody":{"content":{"application/vnd.amadeus+json":{"schema":{"example":{"data":{"guests":[{"contact":{"email":"bob.smith@email.com","phone":"+33679278416"},"name":{"firstName":"BOB","lastName":"SMITH","title":"MR"}}],"offerId":"NRPQNQBOJM","payments":[{"card":{"cardNumber":"0000000000000000","expiryDate":"2026-01","vendorCode":"VI"},"method":"creditCard"}]}},"properties":{"data":{"properties":{"guests":{"description":"minimum one guest is mandatory","items":{"$ref":"#/components/schemas/Stakeholder"},"maxItems":99,"minItems":1,"type":"array","uniqueItems":true},"offerId":{"description":"offerId to book","example":"63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3","maxLength":100,"minLength":2,"pattern":"^[A-Z0-9]*$","type":"string"},"payments":{"description":"payments (often mandatory)","items":{"$ref":"#/components/schemas/Payment"},"maxItems":9,"minItems":1,"type":"array","uniqueItems":true},"rooms":{"description":"rooms repartition (when used the `rooms` array items must match the shopping offer `roomQuantity`)","items":{"description":"room","properties":{"guestIds":{"description":"room main guest (and accompagnants) (optional)","items":{"example":1,"type":"integer"},"type":"array","uniqueItems":true},"paymentId":{"description":"if missing, the first payment is used (optional)","example":1,"type":"integer"},"specialRequest":{"description":"special request to send to the reception (optional)","example":"I will arrive at midnight","maxLength":120,"minLength":2,"type":"string"}},"title":"Room","type":"object"},"maxItems":9,"minItems":1,"type":"array"}},"required":["offerId","guests"],"title":"HotelBookingQuery","type":"object"}},"required":["data"],"title":"BookingSchema","type":"object"}}},"description":"`offerId`, `guests`, `payments` and optional `rooms` for the repartition (when used the `rooms` array items must match the shopping offer `roomQuantity`)\n","required":true},"responses":{"201":{"$ref":"#/components/responses/BookingSell"},"400":{"$ref":"#/components/responses/Error400ResponseCreateBooking"},"500":{"$ref":"#/components/responses/Error500ResponseCreateBooking"}},"summary":"Create Orders associated to the Hotel Offers","tags":["Booking"]}}},"x-generatedAt":"2025-04-15T13:49:53.208Z","servers":[{"url":"https://test.api.amadeus.com/v1"}],"components":{"parameters":{"Accept-Encoding":{"description":"Compress the Response","in":"header","name":"Accept-Encoding","required":false,"schema":{"type":"string","enum":["gzip","identity"]}},"Ama-Client-Ref":{"description":"Client Reference to track Request/Response","in":"header","name":"Ama-Client-Ref","required":false,"schema":{"type":"string","pattern":"^[A-Z0-9_]*$"}}},"responses":{"BookingSell":{"description":"Booked","content":{"application/vnd.amadeus+json":{"schema":{"example":{"data":[{"associatedRecords":[{"originSystemCode":"GDS","reference":"QVH2BX"}],"id":"XD_8138319951754","providerConfirmationId":"8138319951754","type":"hotel-booking"}]},"properties":{"data":{"description":"All room bookings data","items":{"$ref":"#/components/schemas/HotelBookingLight"},"type":"array"},"warnings":{"description":"All Warnings","items":{"$ref":"#/components/schemas/Warning"},"type":"array"}},"title":"HotelBookedResponse","type":"object"}}}},"Error400ResponseCreateBooking":{"description":"Bad Request\n\ncode | title | owner | pointer\n------- | -------------------------------------------------------------- | -------- | -------\n 477 | INVALID FORMAT | Amadeus | \n 4725 | INVALID PASSENGER ASSOCIATION | Amadeus | data/rooms/guestIds\n33555 | NUMBER OF ROOMS MISMATCH BETWEEN SHOPPING AND BOOKING | Amadeus | data/rooms\n33554 | PRICE HAS CHANGED. PLEASE GET A NEW OFFERID AND TRY AGAIN | Amadeus | data/offerId\n36803 | OFFERID HAS EXPIRED. PLEASE GET A NEW OFFERID AND TRY AGAIN | Amadeus | data/offerId\n 1205 | INVALID CREDIT CARD TYPE | Amadeus | data/payments/card/vendorCode\n 8517 | INVALID CREDIT CARD NUMBER | Provider | data/payments/card/cardNumber\n 1427 | GUARANTEE REQUIRED | Provider | data/payments/card\n 1146 | DEPOSIT REQUIRED | Provider | data/payments/card\n 3659 | CREDIT CARD DEPOSIT REQUIRED | Provider | data/payments/card\n 3682 | CREDIT CARD NOT ACCEPTED AT HOTEL PROPERTY | Provider | data/payments/card/vendorCode\n 3871 | CREDIT CARD EXPIRATION DATE INVALID FOR CHECK IN DATE | Provider | data/payments/card/expiryDate\n \n","content":{"application/vnd.amadeus+json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Error500ResponseCreateBooking":{"description":"Internal Server Error\n\ncode | title | owner \n------- | -------------------------------------------------------------- | -------\n00011 | UNABLE TO PROCESS | Provider\n04070 | UNABLE TO PROCESS - CONTACT HELP DESK | Amadeus\n","content":{"application/vnd.amadeus+json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"AssociatedRecord":{"description":"Associated Record (Flight Booking Record)","properties":{"originSystemCode":{"description":"* GDS: Associated Amadeus GDS Flight Booking PNR Record","enum":["GDS"],"example":"GDS","type":"string"},"reference":{"description":"Amadeus GDS Record","example":"QVH2BX","maxLength":6,"minLength":6,"pattern":"^[A-Z0-9]{6}$","type":"string"}},"required":["reference","originSystemCode"],"type":"object"},"Contact":{"description":"Contact Details","properties":{"email":{"description":"Email Address","example":"bob.smith@email.com","format":"email","maxLength":90,"minLength":3,"pattern":"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9-.]+$","type":"string"},"phone":{"description":"Phone Number in standard E.123(https://en.wikipedia.org/wiki/E.123)","example":"+33679278416","maxLength":20,"minLength":6,"pattern":"^[+][1-9][0-9]{4,18}$","type":"string"}},"required":["phone","email"],"type":"object"},"Error":{"description":"Error","properties":{"code":{"description":"[Integer] A machine-readable error code from the Amadeus Canned Messages table, that will enable the API Consumers code to handle this type of error","example":1,"type":"integer"},"detail":{"description":"[String] An easy-to-read explanation specific to this occurrence of the problem. It should give the API consumer an idea of what went wrong and how to recover from it. Like the title, this field value can be localized.","example":"The targeted resource doesn't exist","type":"string"},"status":{"description":"[Integer] The [HTTP status code](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) of this response. This is present only in terminal errors which cause an unsuccessful response. In the case of multiple errors, they must all have the same status.","example":400,"type":"integer"},"title":{"description":"[String] An error title from the Canned Messages table with a 1:1 correspondence to the error code. This may be localized","example":"Resource not found","type":"string"}},"required":["code","title","status"],"type":"object"},"ErrorResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/Error"},"type":"array"}},"required":["errors"],"title":"ErrorResponse","type":"object"},"HotelBookingLight":{"description":"Booking Details","properties":{"associatedRecords":{"items":{"$ref":"#/components/schemas/AssociatedRecord"},"maxItems":1,"minItems":1,"type":"array"},"id":{"description":"Booking Id","example":"XD_8138319951754","maxLength":19,"minLength":5,"pattern":"^[A-Z0-9_]*$","type":"string"},"providerConfirmationId":{"description":"GDS Confirmation Number. If you call the Provider, this Reference may be asked","example":"8138319951754","maxLength":16,"minLength":2,"pattern":"^[A-Z0-9_]*$","type":"string"},"self":{"description":"Retrieve Booking Details","example":"https://test.api.amadeus.com/v1/booking/hotel-bookings/XD_8138319951754","format":"uri","type":"string"},"type":{"description":"Response Type","example":"hotel-booking","type":"string"}},"required":["type","id","providerConfirmationId"],"type":"object"},"Name":{"description":"Guest Name","properties":{"firstName":{"description":"first name (and middle name) of room guest","example":"BOB","maxLength":56,"minLength":1,"pattern":"^[A-Za-z \\p{Han}\\p{Katakana}\\p{Hiragana}\\p{Hangul}-]*$","type":"string"},"lastName":{"description":"last name of room guest","example":"SMITH","maxLength":57,"minLength":1,"pattern":"^[A-Za-z \\p{Han}\\p{Katakana}\\p{Hiragana}\\p{Hangul}-]*$","type":"string"},"title":{"description":"title/gender of room guest","enum":["MR","MRS","MS"],"example":"MR","maxLength":54,"minLength":1,"pattern":"^[A-Za-z -]*$","type":"string"}},"required":["firstName","lastName"],"type":"object"},"Payment":{"description":"form of payment (mandatory in case of `acceptedPayments`/`methods`)","properties":{"card":{"description":"payment card details (mandatory in case of `method` creditCard)","properties":{"cardNumber":{"description":"card number","maxLength":22,"minLength":2,"pattern":"^[0-9]*$","type":"string"},"expiryDate":{"description":"Expiration Date YYYY-MM","example":"2019-01","maxLength":7,"minLength":7,"pattern":"^[0-9]{4}-[0-9]{2}$","type":"string"},"vendorCode":{"description":"card type (CA, VI, AX, DC...)\nExamples:\n * CA - MasterCard (warning: use it instead of MC/IK/EC/MD/XS)\n * VI - Visa\n * AX - American Express\n * DC - Diners Club\n * AU - Carte Aurore\n * CG - Cofinoga\n * DS - Discover\n * GK - Lufthansa GK Card\n * JC - Japanese Credit Bureau\n * TC - Torch Club\n * TP - Universal Air Travel Card\n * BC - Bank Card\n * DL - Delta\n * MA - Maestro\n * UP - China UnionPay \n * VE - Visa Electron\n","example":"VI","maxLength":2,"minLength":2,"pattern":"^[A-Z]{2}$","type":"string"}},"required":["vendorCode","cardNumber","expiryDate"],"title":"Card","type":"object"},"id":{"example":1,"type":"integer"},"method":{"description":"The Payment Methods:\n * creditCard (CC) - Payment Cards in `creditCards` are accepted ","enum":["creditCard"],"example":"creditCard","type":"string"}},"required":["method"],"title":"Payment","type":"object"},"Stakeholder":{"description":"Guest Details","example":{"contact":{"email":"bob.smith@email.com","phone":"+33679278416"},"id":1,"name":{"firstName":"BOB","lastName":"SMITH","title":"MR"}},"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"hotelRewardsMember":{"description":"Hotel Chain Rewards Member Number. To receive your Rewards Points, access online check in, fast check out. An error is returned by the Chain if the number is invalid.\nExample Rewards Programs:\n* Marriott Bonvoy\n* Hilton Honors\n* Hyatt Rewards\n* IHG Rewards\n* Wyndham Rewards\n* Accor Live Limitless ALL\n* Best Western Rewards\n* Choice Privileges\n* Radisson Rewards\n","example":"3081031320523260","maxLength":21,"minLength":1,"pattern":"^[A-Z0-9-]{1,21}$","type":"string"},"id":{"description":"item identifier","example":1,"type":"integer"},"name":{"$ref":"#/components/schemas/Name"}},"required":["name","contact"],"type":"object"},"Warning":{"description":"Warning","properties":{"code":{"description":"[Integer] A machine-readable warning code from the Amadeus Canned Messages table, that will enable the API Consumers code to handle this type of warning","example":1,"type":"integer"},"detail":{"description":"[String] An easy-to-read explanation specific to this occurrence of the problem. It should give the API consumer an idea of what went wrong and how to recover from it. Like the title, this field value can be localized.","example":"The targeted resource doesn't exist","type":"string"},"title":{"description":"[String] A warning title from the Canned Messages table with a 1:1 correspondence to the warning code. This may be localized","example":"Resource not found","type":"string"}},"required":["code","title"],"type":"object"}}}}