Pre-Booking
1 min
Pre - Booking
During the pre-booking process, the partner must send the booking data without a reservation ID, as the booking is not yet confirmed.
In response, we will generate and return a unique token code for that pre-booking. Each token is valid for 2 minutes.
To confirm the booking, you must resend the same token code together with your reservation ID.
If the token is missing, invalid, or expired, the reservation request will be rejected.
Once we receive the reservation data together with a valid token code, we will create the booking in our system and return a success response.
All pre-bookings are initially created with the status “New.”
POST
https://wsb.bakuun.com/v2/booking/MPBXX/XXXX
Body Parameters
- usernamestringrequiredDescription
- passwordstringrequiredDescription
- partnerIdstringrequiredDescription
- partnerNamestringrequiredDescription
- actionstringrequiredDescription
- hotelReservationobjectrequired
- hotelCodestringrequiredDescription
- hotelNamestringrequiredDescription
- resStatusstringrequiredDescription
- checkInstringrequiredDescription
- checkOutstringrequiredDescription
- paymentMethodstringrequiredDescription
- rateTypestringrequiredDescription
- currencyCodestringrequiredDescription
- totalAdultstringrequiredDescription
- totalChildstringrequiredDescription
- child_agesarrayrequiredDescription
- totalBabystringrequiredDescription
- baby_agesarrayrequiredDescription
- roomStaysobjectrequired
- roomTypeIdstringrequiredDescription
- roomNamestringrequiredDescription
- roomTypestringrequiredDescription
- ratePlanIdstringrequiredDescription
- cancelPolicystringrequiredDescription
- numberOfUnitsstringrequiredDescription
- adultCountstringrequiredDescription
- childCountstringrequiredDescription
- child_agesarrayrequiredDescription
- babyCountstringrequiredDescription
- baby_agesarrayrequiredDescription
- commissionstringrequiredDescription
- roomIndexstringrequiredDescription
- ResGuestRPHstringrequiredDescription
- bookingPerDayPricesobjectrequiredDescription
- dateYmdstringrequiredDescription
- pricestringrequiredDescription
- totalobjectrequired
- amountAfterTaxesstringrequiredDescription
- amountBeforeTaxesstringrequiredDescription
- roomIncServicesobjectrequired
- serviceIdstringDescription
- IncServiceNamestringDescription
- inclusionstringDescription
- priceExtrastringDescription
- guestDetailsobjectrequiredDescription
- ResGuestRPHstringrequiredDescription
- firstNamestringrequiredDescription
- lastNamestringrequiredDescription
- middleNamestringrequiredDescription
- emailstringrequiredDescription
- phonestringrequiredDescription
- addressstringrequiredDescription
- countrystringrequiredDescription
- Commentobjectrequired
- Textstringrequired
- paymentCardobjectrequiredDescription
- cardHolderNamestringrequiredDescription
- cardTypestringrequiredDescription
- cardCategorystringrequiredDescription
- cardNumberstringrequiredDescription
- ExpiryMonthstringrequiredDescription
- ExpiryYearstringrequiredDescription
- StartDayMonthstringrequiredDescription
- StartDayYearstringrequiredDescription
- IssueNumstringrequiredDescription
- seriesCodestringrequiredDescription
- vccBalancestringrequiredDescription
- vccCurrencyCodestringrequiredDescription
- vccDeactivationDatestringrequiredDescription
- vccActivationDatestringrequiredDescription
- totalChargeobjectrequired
- taxDetailsobjectrequiredDescription
- typeTaxstringrequiredDescription
- includesstringrequiredDescription
- taxPricestringrequiredDescription
- taxDetailsstringrequiredDescription
- priceDetailsobjectrequired
- rateTypestringrequiredDescription
- amountAfterTaxesstringrequiredDescription
- amountBeforeTaxesstringrequiredDescription
Response
- successboolean
- dataobject
- hotelIdstringDescription
- BookingTokenCodestringDescription
- warningsarray
- errorsarray
json
{
"username": "XXXXXX",
"password": "XXXXXX",
"partnerId": "MPBXX",
"partnerName": "May test Slough",
"action": "getBooking",
"hotelReservation": [
{
"hotelCode": "HTLXXX",
"hotelName": "Novotel Barossa Valley Resort",
"resStatus": "New",
"checkIn": "YYYY-MM-DDTHH:MM",
"checkOut": "YYYY-MM-DDTHH:MM",
"paymentMethod": "BANK",
"rateType": "BAR",
"currencyCode": "HKD",
"totalAdult": "3",
"totalChild": "2",
"child_ages": [1,2],
"totalBaby": "1",
"baby_ages": [1],
"roomStays": [
{
"roomTypeId": "RXXX.X",
"roomName": "Deluxe Double Room with Sea View",
"roomType": "Daily Room",
"ratePlanId": "RXXX.X.X",
"cancelPolicy": "Non refundable",
"numberOfUnits": "1",
"adultCount": "2",
"childCount": "1",
"child_ages": [1],
"babyCount": "1",
"baby_ages": [1],
"commission": "5.00",
"roomIndex": "1",
"ResGuestRPH": "1",
"bookingPerDayPrices": [
{
"dateYmd": "YYYY-MM-DD",
"price": "XXX.XX"
}
],
"total": {
"amountAfterTaxes": "XXX.XX",
"amountBeforeTaxes": "XXX.XX"
},
"roomIncServices": [
{
"serviceId": "123",
"IncServiceName": "servicename",
"inclusion": "0",
"priceExtra": "500.30"
}
]
},
{
"roomTypeId": "RXXX.X",
"roomName": "Deluxe Double Room with Sea View",
"roomType": "Daily Room",
"ratePlanId": "RXXX.X.X",
"cancelPolicy": "Non refundable",
"numberOfUnits": "1",
"adultCount": "2",
"childCount": "1",
"child_ages": [2],
"babyCount": "0",
"baby_ages": [],
"commission": "5.00",
"roomIndex": "2",
"ResGuestRPH": "2",
"bookingPerDayPrices": [
{
"dateYmd": "YYYY-MM-DD",
"price": "XXX.XX"
}
],
"total": {
"amountAfterTaxes": "XXX.XX",
"amountBeforeTaxes": "XXX.XX"
},
"roomIncServices": [
{
"serviceId": "123",
"IncServiceName": "servicename",
"inclusion": "0",
"priceExtra": "500.30"
}
]
}
],
"guestDetails": [
{
"ResGuestRPH": "1",
"firstName": "Test",
"lastName": "User",
"middleName": "Test",
"email": "[email protected]",
"phone": "111111111",
"address": "Pune",
"country": "India"
},
{
"ResGuestRPH": "2",
"firstName": "Test",
"lastName": "Userg",
"middleName": "",
"email": "[email protected]",
"phone": "111111111",
"address": "Pune",
"country": "india"
}
],
"Comment": {
"Text": "one-room"
},
"paymentCard": {
"cardHolderName": "",
"cardType": "",
"cardCategory": "",
"cardNumber": "",
"ExpiryMonth": "",
"ExpiryYear": "",
"StartDayMonth": "",
"StartDayYear": "",
"IssueNum": "",
"seriesCode": "",
"vccBalance": "",
"vccCurrencyCode": "",
"vccDeactivationDate": "",
"vccActivationDate": ""
},
"totalCharge": [
{
"taxDetails": {
"typeTax": "VAT",
"includes": "0/1",
"taxPrice": "10.00",
"taxDetails": "TAX 10% not included"
},
"priceDetails": [
{
"rateType": "BAR",
"amountAfterTaxes": "XXX.XX",
"amountBeforeTaxes": "XXX.XX"
}
]
}
]
}
]
}curl
curl --location 'https://wsb.bakuun.com/v1/booking/MPBXX/668451' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"username": "String",
"password": "String",
"partnerId": "String",
"partnerName": "String",
"action": "String",
"hotelReservation": {
"hotelCode": "",
"hotelName": "",
"resStatus": "",
"checkIn": "",
"checkOut": "",
"paymentMethod": "",
"rateType": "",
"currencyCode": "",
"totalAdult": "",
"totalChild": "",
"child_ages": "",
"totalBaby": "",
"baby_ages": "",
"roomStays": {
"roomTypeId": "",
"roomName": "",
"roomType": "",
"ratePlanId": "",
"cancelPolicy": "",
"numberOfUnits": "",
"adultCount": "",
"childCount": "",
"child_ages": "",
"babyCount": "",
"baby_ages": "",
"commission": "",
"roomIndex": "",
"ResGuestRPH": "",
"bookingPerDayPrices": {
"dateYmd": "",
"price": ""
},
"total": {
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
},
"roomIncServices": {}
},
"guestDetails": {
"ResGuestRPH": "",
"firstName": "",
"lastName": "",
"middleName": "",
"email": "",
"phone": "",
"address": "",
"country": ""
},
"Comment": {
"Text": ""
},
"paymentCard": {
"cardHolderName": "",
"cardType": "",
"cardCategory": "",
"cardNumber": "",
"ExpiryMonth": "",
"ExpiryYear": "",
"StartDayMonth": "",
"StartDayYear": "",
"IssueNum": "",
"seriesCode": "",
"vccBalance": "",
"vccCurrencyCode": "",
"vccDeactivationDate": "",
"vccActivationDate": ""
},
"totalCharge": {
"taxDetails": {
"typeTax": "",
"includes": "",
"taxPrice": "",
"taxDetails": ""
},
"priceDetails": {
"rateType": "",
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
}
}
}
}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://wsb.bakuun.com/v1/booking/MPBXX/668451',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"username": "String",
"password": "String",
"partnerId": "String",
"partnerName": "String",
"action": "String",
"hotelReservation": {
"hotelCode": "",
"hotelName": "",
"resStatus": "",
"checkIn": "",
"checkOut": "",
"paymentMethod": "",
"rateType": "",
"currencyCode": "",
"totalAdult": "",
"totalChild": "",
"child_ages": "",
"totalBaby": "",
"baby_ages": "",
"roomStays": {
"roomTypeId": "",
"roomName": "",
"roomType": "",
"ratePlanId": "",
"cancelPolicy": "",
"numberOfUnits": "",
"adultCount": "",
"childCount": "",
"child_ages": "",
"babyCount": "",
"baby_ages": "",
"commission": "",
"roomIndex": "",
"ResGuestRPH": "",
"bookingPerDayPrices": {
"dateYmd": "",
"price": ""
},
"total": {
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
},
"roomIncServices": {}
},
"guestDetails": {
"ResGuestRPH": "",
"firstName": "",
"lastName": "",
"middleName": "",
"email": "",
"phone": "",
"address": "",
"country": ""
},
"Comment": {
"Text": ""
},
"paymentCard": {
"cardHolderName": "",
"cardType": "",
"cardCategory": "",
"cardNumber": "",
"ExpiryMonth": "",
"ExpiryYear": "",
"StartDayMonth": "",
"StartDayYear": "",
"IssueNum": "",
"seriesCode": "",
"vccBalance": "",
"vccCurrencyCode": "",
"vccDeactivationDate": "",
"vccActivationDate": ""
},
"totalCharge": {
"taxDetails": {
"typeTax": "",
"includes": "",
"taxPrice": "",
"taxDetails": ""
},
"priceDetails": {
"rateType": "",
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
}
}
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"username": "String",
"password": "String",
"partnerId": "String",
"partnerName": "String",
"action": "String",
"hotelReservation": {
"hotelCode": "",
"hotelName": "",
"resStatus": "",
"checkIn": "",
"checkOut": "",
"paymentMethod": "",
"rateType": "",
"currencyCode": "",
"totalAdult": "",
"totalChild": "",
"child_ages": "",
"totalBaby": "",
"baby_ages": "",
"roomStays": {
"roomTypeId": "",
"roomName": "",
"roomType": "",
"ratePlanId": "",
"cancelPolicy": "",
"numberOfUnits": "",
"adultCount": "",
"childCount": "",
"child_ages": "",
"babyCount": "",
"baby_ages": "",
"commission": "",
"roomIndex": "",
"ResGuestRPH": "",
"bookingPerDayPrices": {
"dateYmd": "",
"price": ""
},
"total": {
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
},
"roomIncServices": {}
},
"guestDetails": {
"ResGuestRPH": "",
"firstName": "",
"lastName": "",
"middleName": "",
"email": "",
"phone": "",
"address": "",
"country": ""
},
"Comment": {
"Text": ""
},
"paymentCard": {
"cardHolderName": "",
"cardType": "",
"cardCategory": "",
"cardNumber": "",
"ExpiryMonth": "",
"ExpiryYear": "",
"StartDayMonth": "",
"StartDayYear": "",
"IssueNum": "",
"seriesCode": "",
"vccBalance": "",
"vccCurrencyCode": "",
"vccDeactivationDate": "",
"vccActivationDate": ""
},
"totalCharge": {
"taxDetails": {
"typeTax": "",
"includes": "",
"taxPrice": "",
"taxDetails": ""
},
"priceDetails": {
"rateType": "",
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
}
}
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://wsb.bakuun.com/v1/booking/MPBXX/668451", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://wsb.bakuun.com/v1/booking/MPBXX/668451"
payload = json.dumps({
"username": "String",
"password": "String",
"partnerId": "String",
"partnerName": "String",
"action": "String",
"hotelReservation": {
"hotelCode": "",
"hotelName": "",
"resStatus": "",
"checkIn": "",
"checkOut": "",
"paymentMethod": "",
"rateType": "",
"currencyCode": "",
"totalAdult": "",
"totalChild": "",
"child_ages": "",
"totalBaby": "",
"baby_ages": "",
"roomStays": {
"roomTypeId": "",
"roomName": "",
"roomType": "",
"ratePlanId": "",
"cancelPolicy": "",
"numberOfUnits": "",
"adultCount": "",
"childCount": "",
"child_ages": "",
"babyCount": "",
"baby_ages": "",
"commission": "",
"roomIndex": "",
"ResGuestRPH": "",
"bookingPerDayPrices": {
"dateYmd": "",
"price": ""
},
"total": {
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
},
"roomIncServices": {}
},
"guestDetails": {
"ResGuestRPH": "",
"firstName": "",
"lastName": "",
"middleName": "",
"email": "",
"phone": "",
"address": "",
"country": ""
},
"Comment": {
"Text": ""
},
"paymentCard": {
"cardHolderName": "",
"cardType": "",
"cardCategory": "",
"cardNumber": "",
"ExpiryMonth": "",
"ExpiryYear": "",
"StartDayMonth": "",
"StartDayYear": "",
"IssueNum": "",
"seriesCode": "",
"vccBalance": "",
"vccCurrencyCode": "",
"vccDeactivationDate": "",
"vccActivationDate": ""
},
"totalCharge": {
"taxDetails": {
"typeTax": "",
"includes": "",
"taxPrice": "",
"taxDetails": ""
},
"priceDetails": {
"rateType": "",
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
}
}
}
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://wsb.bakuun.com/v1/booking/MPBXX/668451")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"username": "String",
"password": "String",
"partnerId": "String",
"partnerName": "String",
"action": "String",
"hotelReservation": {
"hotelCode": "",
"hotelName": "",
"resStatus": "",
"checkIn": "",
"checkOut": "",
"paymentMethod": "",
"rateType": "",
"currencyCode": "",
"totalAdult": "",
"totalChild": "",
"child_ages": "",
"totalBaby": "",
"baby_ages": "",
"roomStays": {
"roomTypeId": "",
"roomName": "",
"roomType": "",
"ratePlanId": "",
"cancelPolicy": "",
"numberOfUnits": "",
"adultCount": "",
"childCount": "",
"child_ages": "",
"babyCount": "",
"baby_ages": "",
"commission": "",
"roomIndex": "",
"ResGuestRPH": "",
"bookingPerDayPrices": {
"dateYmd": "",
"price": ""
},
"total": {
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
},
"roomIncServices": {}
},
"guestDetails": {
"ResGuestRPH": "",
"firstName": "",
"lastName": "",
"middleName": "",
"email": "",
"phone": "",
"address": "",
"country": ""
},
"Comment": {
"Text": ""
},
"paymentCard": {
"cardHolderName": "",
"cardType": "",
"cardCategory": "",
"cardNumber": "",
"ExpiryMonth": "",
"ExpiryYear": "",
"StartDayMonth": "",
"StartDayYear": "",
"IssueNum": "",
"seriesCode": "",
"vccBalance": "",
"vccCurrencyCode": "",
"vccDeactivationDate": "",
"vccActivationDate": ""
},
"totalCharge": {
"taxDetails": {
"typeTax": "",
"includes": "",
"taxPrice": "",
"taxDetails": ""
},
"priceDetails": {
"rateType": "",
"amountAfterTaxes": "",
"amountBeforeTaxes": ""
}
}
}
})
response = https.request(request)
puts response.read_body
200
{
"success": true,
"data": [
{
"hotelId": "HTLXX",
"BookingTokenCode": "BTCXXXXXXXXXXXXX"
}
],
"warnings": [],
"errors": []
}451
{
"success": false,
"errors": [
{
"code": 449,
"message": "Check-in date exceeded"
}
]
}