Documentation
Difficulty level:
API - Booking - POST booking/check
POST booking/check
Used for
Checking if a booking can be made. The same checks are performed during the actual adding of a booking. But the booking is not actually made.
Authentication
Anonymous access is allowed
Parameters
Parameter | Description | Required | Example |
---|---|---|---|
object_id | Object ID of the booking | Yes* | 1 |
combi_id | Object ID of the booking | Yes* | 2 |
fromdate | From date of the booking | Yes | 2012-08-26 |
tilldate | Till date of the booking | Yes | 2012-08-26 |
fromtime | From time of the booking | No | 10:00 |
tilltime | Till time of the booking | No | 12:00 |
customer | Customer object can be supplied If customer_id is supplied, the booking will be attached to that existing customer |
No | |
options | An array of options, each in combination of the option_name and the required number | No | |
participants | An array of participants, each in combination of the participant_name and the required number | No |
* Object_id OR combi_id is needed. One of these should be present in the request
Example 1
Checking if a booking can be made for 4 people on a slot which is already booked.
POST api/rest/booking/check
Request: { "object_id": "1", "fromdate": "2012-08-26", "tilldate": "2012-08-26", "fromtime": "10:15", "tilltime": "10:20", "number": "4" } Response: { "status": false, "messages": [ "The selected period is not available" ] }
Example 2
Checking if a booking can be made for 4 people (2 adults and 2 children). Include a new customer and include an option.
POST api/rest/booking/check
Request: { "object_id": "1", "fromdate": "2012-08-27", "tilldate": "2012-08-27", "fromtime": "10:15", "tilltime": "10:20", "number": "4", "customer": { "lastname": "Demo" }, "participants": { "0": { "Volwassenen": "2" }, "1": { "Kinderen": "2" } }, "options": { "0": { "taart": "1" } } } Response: { "status": true, "messages": [ "No problems found" ] }