Booking
About 365 wordsAbout 1 min
POST Hotel Booking API
POST /v1.0/booking
Request Parameters
{
"bookingReferenceId": "86621248",
"hotel": "5931939",
"roomCode": "R848281",
"checkIn": "2023-10-10",
"checkOut": "2023-10-11",
"quantity": 1,
"guest": {
"phone": "12345678123",
"email": "eric.li@phoentrix.com",
"guestName": [
{
"firstName": "Liang",
"lastName": "Li"
}
]
},
"occupancy": {
"adults": 1,
"childrenAges": []
},
"ratePlanCode": "DBDAEE3618140F99B14A0103EE9B7EFDC55D75B3AE7D43564B422264602FE456A7796F6D4F86C670052FB57D22823AF9",
"totalPrice": 28.82,
"currency": "USD",
"nation": "CN",
"channel": 1,
"boardCode": "RO",
"bedGroupId": "37336",
"specialRequests": "",
"hotelPackage": ""
}| Field | Type | Required | Description |
|---|---|---|---|
| bookingReferenceId | string | Yes | Client booking reference ID |
| hotel | string | Yes | Hotel ID |
| roomCode | string | Yes | Room ID |
| checkIn | string | Yes | Check-in date |
| checkOut | string | Yes | Check-out date |
| quantity | int | Yes | Number of rooms |
| guest | object | Yes | Contact information |
| phone | string | Yes | Contact phone |
| string | Yes | Contact email | |
| guestName | List | Yes | Guest list |
| firstName | string | Yes | Guest first name |
| lastName | string | Yes | Guest last name |
| occupancy | object | Yes | Occupancy information |
| adults | int | Yes | Number of adults |
| childrenAges | List | No | Children ages |
| ratePlanCode | string | Yes | Rate plan code |
| totalPrice | decimal | Yes | Total price |
| currency | string | No | Currency |
| nation | string | No | Nationality code |
| channel | int | No | Channel (default: 1) |
| boardCode | string | Yes | Meal plan code |
| bedGroupId | string | No | Bed group ID |
| specialRequests | string | No | Special requests |
| hotelPackage | string | No | Package type (hotel_only / hotel_package) |
Request Example
curl --location --request POST '{{domain}}/v1.0/booking' \
--header 'Authorization: PHT apikey={{api_key}},signature={{signature}},timestamp={{timestamp}}' \
--header 'api_key: {{api_key}}' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--data-raw '{
"bookingReferenceId":"86621248",
"hotel":"5931939",
"roomCode":"R848281",
"checkIn":"2023-10-10",
"checkOut":"2023-10-11",
"quantity":config.js,
"guest":{
"phone":"12345678123",
"email":"eric.li@phoentrix.com",
"guestName":[
{
"firstName":"Liang",
"lastName":"Li"
}
]
},
"occupancy":{
"adults":config.js,
"childrenAges":[
]
},
"ratePlanCode":"DBDAEE3618140F99B14A0103EE9B7EFDC55D75B3AE7D43564B422264602FE456A7796F6D4F86C670052FB57D22823AF9",
"totalPrice":28.82,
"currency":"USD",
"nation":"CN",
"channel":config.js,
"boardCode":"RO",
"bedGroupId":"37336",
"specialRequests":"",
"hotelPackage":""
}'Response Example
{
"responseStatus": "SUCCESS",
"version": "v1.0",
"referenceId": "230602279",
"bookingReferenceId": "86621248",
"remark": "booking successful"
}| Field | Type | Description |
|---|---|---|
| responseStatus | string | Response status |
| version | string | API version |
| referenceId | string | System booking ID |
| bookingReferenceId | string | Client booking reference ID |
| remark | string | Additional remarks |
Status Codes
| Code | Description |
|---|---|
| SUCCESS | Booking successful |
| BOOKING_FAIL | Booking failed |
| BOOKING_TIMEOUT | Booking timeout |
| UNAUTHORIZED | Authentication failed |
| SUPPLIER_SERVER_ERROR | Server or upstream API error |