Skip to main content

Checking a resource's availability

How to check with one call whether a berth is free in a period and at what price: parameters, response and errors (direct booking APIs, being phased out).

This call is part of the Direct booking APIs, which are being phased out: if you are writing a new integration, do not start here. To authenticate use the technical user and the key described on the same page.

The addresses are the production ones. To try it in the test environment, use demo.blueshell.it instead of my.blueshell.it.

To check a berth's availability, make an HTTP GET request to the following URL:

https://my.blueshell.it/booking/available.php

Parameters

Required parameters (if one is missing the call answers 422; an unknown ID answers 404):

  • type_id: the ID of the contract type you will create; it is needed to calculate the price

  • duration_id: the ID of the contract duration you will create; it is needed to calculate the price

  • from: the arrival date

  • to: the departure date

Optional parameters:

  • dimension_type: the ID of the type of resource you want to book (berth, hotel room, etc.). Only types with Online Booking turned on can be booked: for the others the call answers 400

  • length, width: the minimum length and width, in metres, the berth must have

  • policy: resources or vectors; it says whether the rate is calculated from the occupied resource or from the boat (it depends on the marina's choices); if you do not write it, it is resources

  • count: how many berths you want in the response; if you do not write it, it is 5

  • zero: set it to 1 to also see berths with a zero price

  • allow_days_overlap: set it to 1 to consider free a berth that another booking leaves on the day of your arrival

  • resource_id: the ID of a berth, to find out whether that very one is free

The response and the errors

The response is a list (empty if no berth is free). Each element has resource (the berth's id, to use to confirm the booking, the name and the size class), prices (the price lines) and totals (total_net and total, the final price).

If the marina's price list does not cover the whole period and no berth can be offered for that reason, the response is a 422 error with "error": "IncompletePriceListCoverage" and the uncovered periods in uncovered_periods: it does not mean the marina is full.


Did this answer your question?