Create the booking
Only then can you create the booking in apaleo using the apaleo Booking API. Please note that all amounts you send to apaleo to overwrite the default amounts for time slices or services have to be gross amounts and you should not include amounts for city tax or additional custom fees.
{
"booker": {
"title": "Mr",
"gender": "Male",
"firstName": "Jon",
"middleInitial": "D",
"lastName": "Doe",
"email": "john.d@doe.com",
"phone": "+4989123343",
"address": {
"addressLine1": "My Street 1",
"postalCode": "12453",
"city": "MyCity",
"countryCode": "GB"
}
},
"reservations": [
{
"arrival": "2021-12-22",
"departure": "2021-12-24",
"adults": 1,
"childrenAges": [
6
],
"guestComment": "I need a wake up service",
"channelCode": "Direct",
"primaryGuest": {
"title": "Mr",
"gender": "Male",
"firstName": "Jon",
"middleInitial": "D",
"lastName": "Doe",
"email": "john.d@doe.com",
"phone": "+4989123343",
"address": {
"addressLine1": "My Street 1",
"postalCode": "12453",
"city": "MyCity",
"countryCode": "GB"
}
},
"guaranteeType": "Prepayment",
"travelPurpose": "Business",
"timeSlices": [
{
"ratePlanId": "MUC-NONREF-FAMILY"
},
{
"ratePlanId": "MUC-NONREF-FAMILY"
}
],
"services": [
{
"serviceId": "MUC-BRKF"
},
{
"serviceId": "MUC-YOGA",
"dates": [
{
"serviceDate": "2021-12-23",
"amount": {
"amount": 35,
"currency": "EUR"
}
}
]
}
],
"prePaymentAmount": {
"amount": 50,
"currency": "EUR"
}
},
{
"arrival": "2021-12-23",
"departure": "2021-12-25",
"adults": 1,
"childrenAges": [
6
],
"channelCode": "Direct",
"primaryGuest": {
"title": "Mr",
"gender": "Male",
"firstName": "Eric",
"middleInitial": "E",
"lastName": "Steinmetz",
"email": "eric.e@steinmetz.com",
"phone": "+4989123343",
"address": {
"addressLine1": "My Street 1",
"postalCode": "12453",
"city": "MyCity",
"countryCode": "GB"
}
},
"guaranteeType": "CreditCard",
"timeSlices": [
{
"ratePlanId": "BER-FLEX-DBL",
"totalAmount": {
"amount": 120,
"currency": "EUR"
}
},
{
"ratePlanId": "BER-FLEX-DBL",
"totalAmount": {
"amount": 125,
"currency": "EUR"
}
}
],
"companyId": "BER-UMBRELLA",
"commission": {
"commissionAmount": {
"amount": 20,
"currency": "EUR"
},
"beforeCommissionAmount": {
"amount": 100,
"currency": "EUR"
}
}
}
],
"transactionReference": "564578124534890J"
}
Be sure to set the transactionReference with the PSP reference returned from the
authorization call.
Whenever a transaction reference is set, apaleo will try to finalize the transaction regardless of the reservation guarantee type and payment automation settings. In the end, if the booker has been prompt to prepay a certain amount, apaleo will just finalize the transaction. If the booker doesn’t need to prepay, consider not requesting any prepayment from the first place.
Also, the prePaymentAmount for each reservation must be set with the sum of the
prePaymentGrossAmount of the selected offers.
Nice to have:
If you subscribe to the “reservation created” event, you could implement notifications like: hotel just has been booked, be fast! Pretty cool, right?
Payment Account
Payment account for booking can be created using the next call if you want to add the card to the booking for references and any future payments done directly in apaleo
POST https://api.apaleo.com/booking/v1/payment-accounts/by-stored-payment-method
Sample Request:
{
"target": {
"type": "Booking",
"id": "KYKXKLWL"
},
"payerReference": "f86de5cf-1989-4c74-9ffa-70e82e852423",
"storedPaymentMethodId ": "H7EJGJQD4HNG5S75"
}
Be sure to set the payerReference with the shopperReference used to perform the authorization and the storedPaymentMethodId with the tokenization.storedPaymentMethodId returned from the authorization call. If you want to use the most recent authorization for a shopperReference, set storedPaymentMethodId to "LATEST".
Alternatively, payment account can be created using the PSP reference returned from the
authorization call. Set transactionReference to PSP reference.
POST https://api.apaleo.com/booking/v1/payment-accounts/by-authorization
Sample Request:
{
"target": {
"type": "Booking",
"id": "KYKXKLWL"
},
"transactionReference": "K9DTTJQD4HNG5S82"
}