I try to implement Amadeus hotel booking API.
But it always return error, on both V1 and V2.
here is the detail
V1
https://test.api.amadeus.com/v1/booking/hotel-bookings
body
{
"data": {
"offerId": "{{hotelOfferId}}",
"guests": [
{
"id": 1,
"name": {
"title": "MR",
"firstName": "BOB",
"lastName": "SMITH"
},
"contact": {
"phone": "+33679278416",
"email": "[email protected]"
}
}
],
"payments": [
{
"id": 1,
"method": "creditCard",
"card": {
"vendorCode": "VI",
"cardNumber": "4111111111111111",
"expiryDate": "2026-08"
}
}
],
"rooms": [
{
"guestIds": [
1
],
"paymentId": 1,
"specialRequest": "I will arrive at midnight"
}
]
}
}
response
{
"errors": [
{
"code": 38190,
"title": "Invalid access token",
"detail": "The access token provided in the Authorization header is invalid",
"status": 401
}
]
}
I already logged in, and no problem with another endpoints.
V2
https://test.api.amadeus.com/v2/booking/hotel-orders
body
{
"data": {
"type": "hotel-order",
"guests": [
{
"tid": 1,
"title": "MR",
"firstName": "BOB",
"lastName": "SMITH",
"phone": "+33679278416",
"email": "[email protected]"
}
],
"travelAgent": {
"contact": {
"email": "[email protected]"
}
},
"roomAssociations": [
{
"guestReferences": [
{
"guestReference": "1"
}
],
"hotelOfferId": "{{hotelOfferId}}"
}
],
"payment": {
"method": "CREDIT_CARD",
"paymentCard": {
"paymentCardInfo": {
"vendorCode": "VI",
"cardNumber": "4151289722471370",
"expiryDate": "2026-08",
"holderName": "BOB SMITH"
}
}
}
}
}
response
{
"errors": [
{
"status": 500,
"code": 11,
"title": "UNABLE TO PROCESS",
"detail": "Amadeus Error - UNABLE TO PROCESS"
}
]
}
Thank you for your response, it is very meaningful for me.
I read the documentation, and try the official postman. But it’s all not helping.
official postman : https://www.postman.com/amadeus4dev/workspace/amadeus-for-developers-s-public-workspace/collection/2672636-27471449-d2ca-a8c4-1399-6b0cfbddd079
API explorer : https://developers.amadeus.com/self-service/category/hotels/api-doc/hotel-booking/api-reference