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.
Prerequisites: create an API key
Section titled “Prerequisites: create an API key”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
API references
Section titled “API references”For this tutorial you need the following API reference:
Create Reservation API reference
Create the reservation
Section titled “Create the reservation”Properties
Section titled “Properties”The required parameters for a forced reservation are:
arrivaldepartureaccommodation_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 thebirth_tablestoage_tables, and these are also returned in the price calculation result.
force: set this totrueif you want the reservation to be forced using your own rules.rows: the rows use a specific JSON format. Each row has atype,type_id(optional),description,amountandtotal:
[ { "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
Section titled “API reference”Create Reservation API reference
Example: create a reservation
Section titled “Example: create 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
Section titled “Response”// reservation