Create the booking

Only then can you create the booking in apaleo using the apaleo Booking API. Use the data from the response to populate the payment account model in the booking request to apaleo. 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.

{
  "paymentAccount": {
    "accountNumber": "1111",
    "accountHolder": "John Doe",
    "expiryMonth": "8",
    "expiryYear": "2018",
    "paymentMethod": "visa",
    "payerEmail": "s.hopper@test.com",
    "payerReference": "4ea6462b-cca3-4c17-a035-c7b5132db83c",
    "isVirtual": false
  },
  "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"
}

payerReference

Be sure to set the paymentAccount.payerReference with the shopperReference used to perform the authorization and 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?