Skip to main content

Forced booking

You can also use your own price calculation and add the price calculation to the system. You have to setup the price structure in a specific way. In the tutorial we will explain this in more detail

Prerequisits: Creating the API key

You have to add a private or public API key. To a create a private or public key check our getting started documentation here

For PHP we build a sdk. You can download our SDK from our Git Repository: here

API references

For this tutorial you will need the folowing API references:

Create Reservation API reference

Create the reservation

Properties

The required parameters a forced reservation are the:

  • arrival

  • departure

  • accommodation_id (The accommoadtion id can be found using the accommodations api.)

  • persons / age_tables / birth_tables

persons: You can choose which parameter to use. It can depend on the parameter persons: The number of persons are calculated using the default age table.

age tables: You can use the systems age tables for the calculation. You need the age table id and amount to use this. The system will check if the age tables are valid

birth_tables You can also provide birthdays for each person. The system will convert the birth_tables to age_tables. These will also be returned in the price calculaton result.

  • force

This parameters has to be set to true if you want a reservation to be forced using your own rules

  • rows

The rows will have a specific format in json. Each row has a type, type_id (optional), description, amount and total:


[
{
"type":"rate",
"type_id":"1234",
"description": "Pitch description",
"amount":"2",
"total":"200"
},
{
"type":"guest",
"type_id":"1234",
"description": "Guest price description",
"amount":"2",
"total":"50"
}
]

API Reference

Create Reservation API reference

Example creating a reservation


{

"accommodation_id": 12345,
"arrival": "2021-08-15",
"departure": "2021-08-15",
"birth_tables" : [
{
"birthdate" : "1980-01-01",
"count" : 2
},
{
"birthdate" : "2018-01-01",
"count" : 0
}
],
"force": true,
"forced_rows" : [
{
"type":"product",
"type_id":"1234",
"description": "Pitch description",
"amount":"2",
"total":"200"
},
{
"type":"product",
"type_id":"1234",
"description": "Guest price description",
"amount":"2",
"total":"50"
}
],
"mainTraveler" : {
"gender": "male",
"first_name": "John",
"last_name": "Doe",
"address": "Canal Street",
"address_number": "1",
"zipcode": "1234AA",
"city": "Amsterdam",
"phone" : "0031123456789",
"email" : "john@doe.com"

},
"meta" : [],

}


Response


// reservation