Skip to content

Forced booking

You can also use your own price calculation and add it to Camping.care. To do this, you need to set up the price structure in a specific way. This tutorial explains how.

You need a private or public API key. To create one, see Authentication.

For PHP we’ve built an SDK. You can download it from our Git repository: campingcare-php-sdk

For this tutorial you need the following API reference:

Create Reservation API reference

The required parameters for a forced reservation are:

  • arrival
  • departure
  • accommodation_id: you can find the accommodation ID with the accommodations API.
  • persons / age_tables / birth_tables: choose which one to use.
    • persons: the number of persons, calculated using the default age table.
    • age_tables: use the age tables from your system for the calculation. You need the age table ID and the amount. We check whether the age tables are valid.
    • birth_tables: provide a birth date for each person. We convert the birth_tables to age_tables, and these are also returned in the price calculation result.
  • force: set this to true if you want the reservation to be forced using your own rules.
  • rows: the rows use a specific JSON format. 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"
}
]

Create Reservation API reference

{
"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" : []
}
// reservation