MENU

Booking

Endpoint(s)

https://api.website.world/webapps/api/booking 

https://api.website.world/webapps/api/bookingresource

Description

Use the booking endpoint to get and post bookings which have been made on your site. 

GET Parameters

Name Description Example Data Type
id

If ID is specified, then only a single element is returned if found. Otherwise, an array is returned, even if only one item matches.

id=12345

int
pid Product Id pid=12345 int
resourceid Resource Id, You can get the full information regarding resources using the /bookingresource endpoint resourceid=123 int
includePastBookings

To include bookings which have occured before the present day.

includePastBookings=1 string
bookingStartAfter Get bookings which start after time provided bookingStartAfter
="2021-01-22 10:30:00"
string
bookingStartBefore Get bookings which start before time provided bookingStartBefore
="2021-01-22 10:30:00"
string
bookingFinishAfter Get bookings which end after the time provided bookingFinishAfter
="2021-02-22 16:00:00"
string
bookingFinishBefore Get bookings which end before the time provided bookingFinishBefore
="2021-02-22 16:00:00"
string

Accepted date format is yyy-MM-dd HH:mm:ss. If the time is not provided, then it will default to midnight time.

Adding a new booking:

Bookings must have a resource_id, booking_time, booking_finish, and duration.

Example: 

{

   "resourceid": 12345,

   "booking_time": "2022-01-19 19:34:00.0",

   "duration": "01:00:00",

   "booking_finish": "2022-01-19 20:34:00.0"

}


Booking Resource

You can add booking and calendar resources for customers to book. Example: A hairdresser can be booked in a salon setup, or a vehicle can be booked for hire for a period of time. 

GET Parameters

Name Description Example Data Type
id

If ID is specified, then only a single element is returned if found. Otherwise, an array is returned, even if only one item matches.

id=12345

int
resourcename The name of the resource. resourcename="Andrew" string
resourceemail Email address of the resource if applicable. resourceemail="name@example.com" string
pid The product Id, which can be hired or booked. Use the /product endpoint to get complete information about products. pid=123 int
resourceType The resourceType. Valid options are HireItem, Accommodation, Person, Seat. resourceType="HireItem" string

Add a new resource

You do not need to provide the id if you want to add a new resource. The rest of the information will be used to create the new resource.

Example

{ 

"calendar_increment": "01:00:00",

   "min_booking_duration": "00:05:00",

   "max_booking_duration": "01:00:00",

   "resourcename": "Test"

}

Update a resouce

Please provide the id of the resource you wish to update. Only provide the information you wish to update.

{ 

  "id": 123,

  "resourcename": "Test",

  "max_booking_duration": "01:00:00"

}

Example Return JSON Booking

{ 

"endPoint": "booking",

"resultCount": 1,

"data": {

"resourceid": 2465,

"bi_id": 38566609,

"mbr_id": 3647211,

"booking_time": "2021-04-12 10:00:00.0",

"pid": 567,

"booking_status": "ordered",

"booking_freq": "00:00:00",

"bookingid": 9879,

"duration": "01:00:00",

"booking_lastmodified": "2021-04-01 14:52:41.225745",

"b_id": 4444,

"booking_finish": "2021-04-12 11:00:00.0",

"booking_detail": "test order test@test.com 1234567 jet boat ride",

"id": 333,

"page": 1234,

"cid": 1111

},

"success": true

}

Example Return JSON Booking Resource

{

"endPoint": "bookingresource",

"resultCount": 1,

"data": {

"sat_start": "09:00:00",

"calendar_increment": "00:30:00",

"min_booking_notice": "00:30:00",

"wed_start": "09:00:00",

"min_booking_duration": "02:00:00",

"pid": 0,

"mon_finish": "17:00:00",

"max_booking_notice": "11 mons",

"wed_finish": "17:00:00",

"tue_start": "09:00:00",

"sun_start": "09:00:00",

"max_booking_duration": "02:00:00",

"sun_finish": "17:00:00",

"id": 2368,

"fri_start": "09:00:00",

"sat_finish": "17:00:00",

"resourceid": 2368,

"fri_finish": "17:00:00",

"thu_finish": "17:00:00",

"resourcetype": "Person",

"tue_finish": "17:00:00",

"mon_start": "09:00:00",

"thu_start": "09:00:00",

"resourcename": "Test Name",

"cid": 1111

},

"success": true

}