From e019c32ff8cbbfe89717567948745175b304b572 Mon Sep 17 00:00:00 2001 From: minjikarin Date: Thu, 20 Jun 2024 14:09:58 +0200 Subject: [PATCH] example updated --- README.md | 27 +++++++++++-------- .../namespaces/booking/hotel_bookings.js | 14 ++++++---- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7d4fd0b..244bcd7 100644 --- a/README.md +++ b/README.md @@ -406,22 +406,27 @@ amadeus.shopping.hotelOffersSearch.get({ amadeus.shopping.hotelOfferSearch('XXX').get() // Hotel Booking API v2 -amadeus.booking.hotelOrders.post({ - guests: [], - travelAgent: {}, - roomAssociations: [], - payment: {} -}) +amadeus.booking.hotelOrders.post( + JSON.stringfy({ + "data": { + "type": "hotel-order", + "guests": [], + "travelAgent": {}, + "roomAssociations": [], + "payment": {} + }}) +) // Hotel Booking API v1 amadeus.booking.hotelBookings.post( JSON.stringify({ - 'offerId': 'XXX', - 'guests': [], - 'payments': [] - } - ) + "data": { + "offerId": "XXXX", + "guests": [], + "payments": [], + "rooms": [] + }}) ) // On-Demand Flight Status diff --git a/src/amadeus/namespaces/booking/hotel_bookings.js b/src/amadeus/namespaces/booking/hotel_bookings.js index 7d3b8a4..3858209 100644 --- a/src/amadeus/namespaces/booking/hotel_bookings.js +++ b/src/amadeus/namespaces/booking/hotel_bookings.js @@ -25,11 +25,15 @@ class HotelBookings { * To book the hotel offer with ID 'XXX' with guests & payments info * * ```js - * amadeus.booking.hotelBookings.post({ - * 'offerId': 'XXX', - * 'guests': [], - * 'payments': [] - * }); + * amadeus.booking.hotelBookings.post( + * JSON.stringify({ + * "data": { + * "offerId": "XXXX", + * "guests": [], + * "payments": [], + * "rooms": [] + * }}) + * ) * ``` */ post(params = {}) {