Booking

Describes the flow for completing a booking.

Further endpoints about the property such as products and rooms can be found on the property API page

Availability

GET https://example.allocate.co.uk/api/v2/availability/

Request availability information for a set of dates.

Query Parameters

Name
Type
Description

stay_occs

string

Occupancy id for each stay (parameter can be repeated for each room required)

nights

string

Length of stay

date_from

string

ISO 8601 date for start of query set.

date_to

string

ISO 8601 date for end of query set.

{
  "body": [
    {
      "next": {
        "href": "https://example.allocate.co.uk/api/v2/room-options?date=2019-09-02&nights=2&stay_occs=3"
      },
      "price_breakdown": [120, 120],
      "date": "2019-09-02",
      "available": true,
      "price": 240
    }
  ]
}

Stay Options

GET https://example.allocate.co.uk/api/v2/room-options

Further options for each stay. The following paths are of interest : body.terms_and_conditions Terms that need displaying to the customer body.stays Currently selected stays body.total_price Total price of stays so far body.detected_country IP detected country of customer body.occupancy_options Options that can be selected for this stay. Follow the next link here to continue for additional rooms. After a stay has been picked, the response will contain body.stays which contains the picked stay plus any applicable extras for that stay in body.stays[0].supplements. The id and amount of extras that are required should be added to the querystring of the subsequent call to room-options, i.e /api/v2/room-options?supplement:0:213=1 A booking is ready to be created when the body.occupancy_options property no longer exists. At this point there may be a body.payment property you can use to create a payment_token that should be POSTed with the body for completing a booking below.

Query Parameters

Name
Type
Description

supplement:{id}:{id}

number

Amount of particular extra to add to this booking. See example above

stay_occs

number

Occupancy ID for each stay (parameter can be repeated for each room)

nights

number

Length of stay

date

string

ISO 8601 arrival date for booking

Create Booking

POST https://example.allocate.co.uk/api/v2/room-options

Complete a booking. Body should sent as a JSON object.

Query Parameters

Name
Type
Description

nights

number

Number of nights for the booking

continuation

string

A token for stays in your booking. This is encoded inside the 'next' link of the room-options request

date

string

ISO 8601 date of arrival for your stay.

Request Body

Name
Type
Description

payment_token

string

A payment token which will be used to charge the card or complete the payment intent depending on your payment provider.

stays

string

Array of data for individual stay information. See Individual stay option documentation.

telephone

string

Phone number for booking contact

town_city

string

Town or city for booking contact

address_line_1

string

First line of address for booking contact

postcode

string

Postcode / Zip for booking contact

country

string

ISO-3166 Alpha-2 Country code for booking contact

email

string

Email for booking contact

name

string

Full name for booking contact

Cancel

GET https://example.allocate.co.uk/api/v2/cancel

Check if a booking can be cancelled.

Path Parameters

Name
Type
Description

booking_id

string

The long booking id to cancel.

Cancel

DELETE https://example.allocate.co.uk/api/v2/cancel

Cancel a booking

Path Parameters

Name
Type
Description

booking_id

string

The long booking id to cancel.

Last updated

Was this helpful?