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

NameTypeDescription

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
    }
  ]
}

You should not call the API methods below directly, instead follow the next link contained in the availability request above and the next link contained in subsequent calls.

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

NameTypeDescription

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

{
  "body": {
    "terms_and_conditions": [
      {
        "name": "Cancellation Policy",
        "terms": "<p>If a booking is cancelled less than 72 hours prior to arrival, we reserve the right to charge in full for the cancelled nights. As our deposits paid are non-refundable, we recommend cancellation insurance.</p>"
      },
      {
        "name": "General",
        "terms": "<p>Booking Terms &amp; Conditions</p>\n\n<p>Rates\nAll our rates are quoted on a per room per night basis for Bed &amp; Breakfast or Dinner, Bed &amp; Breakfast, inclusive of V.A.T.</p>\n\n<p>Amendments &amp; Cancellation\nIf a booking is amended or cancelled less than 72 hours prior to arrival, we reserve the right to charge in full for the cancelled nights. As our deposits paid are non-refundable, we recommend cancellation insurance.</p>\n\n<p>Discounts/ Special Rates\nRates cannot be altered once the booking has been made.</p>\n\n<p>Restaurant\nOur restaurant is non-smoking. If you wish to dine in the evening we strongly advise you book on arrival, to avoid disappointment. Children's High teas are served between 6 and 6.30pm.</p>\n\n<p>Leisure Club\nAll guests have complementary use of our Leisure Club facilities. The club is open 8am and“ 8.30pm Weekdays, 8am and“ 8pm Weekends (times may differ due to circumstances &amp; Bank holidays). Children Under 16 are not permitted to use the Gym, Sauna and Steam room. Under 5 years are not permitted to use the spa. Children are not permitted in the swimming Pool between 10am and  11.30am Daily.</p>\n\n<p>Payment\nWe accept all major credit &amp; debit cards. Personal cheques are only accepted up to the value of the guarantee card. Company cheques are only accepted by prior arrangement.</p>\n\n<p>Arrival &amp; Departure Times\nOur rooms are usually available from 2pm on the day of arrival. You should vacate your room by 12pm on the day of departure.</p>\n\n<p>Car Parking\nThere is ample free parking. We regret that we cannot accept responsibility for loss or damage to vehicles parked in the hotel car park during your stay.</p>"
      }
    ],
    "stays": [],
    "detected_country": "GB",
    "arrival_date": "2019-09-02",
    "payment": [
      {
        "meta": "{}",
        "provider": "stripe",
        "use_3dsecure": false,
        "deposit_amount": 0,
        "publishable_key": "pk_test_DFMB1GAJwMPW6eAUuAfUZ89g",
        "currency": "GBP"
      }
    ],
    "total_price": 0,
    "occupancy_options": [
      {
        "stay_types": [
          {
            "next": {
              "href": "https://example.allocate.co.uk/api/v2/room-options?continuation=W1siNTE3OSIsIjM0NCIsIjEiXV0&date=2019-09-02&nights=2&stay_occs=3"
            },
            "price": 240,
            "price_by_day": [120, 120],
            "stay_type": {
              "href": "https://example.allocate.co.uk/api/v2/staytypes/1"
            }
          },
          {
            "next": {
              "href": "https://example.allocate.co.uk/api/v2/room-options?continuation=W1siNTE3OSIsIjM0NCIsIjIiXV0&date=2019-09-02&nights=2&stay_occs=3"
            },
            "price": 336,
            "price_by_day": [168, 168],
            "stay_type": {
              "href": "https://example.allocate.co.uk/api/v2/staytypes/2"
            }
          }
        ],
        "room": { "href": "https://example.allocate.co.uk/api/v2/rooms/5179" },
        "product": { "href": "https://example.allocate.co.uk/api/v2/rack" }
      }
    ]
  },
  "head": { "type": "room-options" },
  "href": "https://example.allocate.co.uk/api/v2/room-options?date=2019-09-02&nights=2&stay_occs=3"
}

Create Booking

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

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

Query Parameters

NameTypeDescription

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

NameTypeDescription

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

{
  "total_paid": 0,
  "total_cost": 240,
  "total_to_pay": 240,
  "reference": "66/143",
  "id": "3CCF1D5E-CD65-11E9-8C71-DBBA4566E927"
}

Cancel

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

Check if a booking can be cancelled.

Path Parameters

NameTypeDescription

booking_id

string

The long booking id to cancel.

{
  "body": {
    cancellation_terms: "Terms",
    can_be_cancelled: true,
  }
}

Cancel

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

Cancel a booking

Path Parameters

NameTypeDescription

booking_id

string

The long booking id to cancel.

Last updated