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 priceduration_id: the ID of the contract duration you will create; it is needed to calculate the pricefrom: the arrival dateto: 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 400length,width: the minimum length and width, in metres, the berth must havepolicy:resourcesorvectors; 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 isresourcescount: how many berths you want in the response; if you do not write it, it is 5zero: set it to 1 to also see berths with a zero priceallow_days_overlap: set it to 1 to consider free a berth that another booking leaves on the day of your arrivalresource_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.
See also: Direct booking APIs and Creating a booking for a resource.
