Contents
On this page

Search Availability - Plugixa Boat Rental

GET /pbr/v1/availability

What is free at a marina for a departure and a return, boat by boat, with the price of the window for each. The booking widget asks this before anyone signs in.

Public: no key or login is needed. An API key PRO of either access level may call it too, with GET only.

Note. This is the widget’s view, held to a booking form: only active marinas, active boats with a price, and the boats the form offers are answered. It is rate limited per visitor address: 120 requests every 10 minutes, shared with List Departures. A key’s own limit applies on top.

Request

GET https://your-site.example/wp-json/pbr/v1/availability?location_id=2&start=2026-11-20%2010:00&end=2026-11-20%2014:00&guests=4

Query parameters

Name Type Default Description
location_id integer Required. The marina.
start string Required. Departure, YYYY-MM-DD HH:MM on the marina’s clock.
end string Required. Return, in the same form.
boat_id integer Only this boat. It must be stocked at the marina, active, offered by the form and priced.
guests integer 1 People on board. A boat that carries fewer is moved to not_offered.
form_id integer The booking form to answer for. Without it, the site’s default form.

Without a key, the same request can be sent as POST with these fields in a JSON body.

Responses

200 OK. data is what is free in the window.

{
  "success": true,
  "message": "",
  "data": {
    "location_id": 2,
    "start": "2026-11-20 10:00:00",
    "end": "2026-11-20 14:00:00",
    "availability": [
      {
        "boat_id": 5,
        "mode": "unit",
        "total": 3,
        "available": 2,
        "boat_name": "Sea Ray 230",
        "icon": null,
        "color": "#1e88e5",
        "capacity": 8,
        "price_preview": 380.0,
        "currency": "EUR",
        "units": 4.0,
        "billing_type": "hour"
      }
    ],
    "not_offered": [
      {
        "boat_id": 7,
        "boat_name": "Jet ski Wave 90",
        "code": "too_many_guests",
        "message": "This boat carries at most 2 guests."
      }
    ]
  }
}
Field Type Meaning
data.start, data.end string The window as read
data.availability array One row per boat the window suits
data.availability[].total integer Units of the boat at the marina
data.availability[].available integer Units free for the window, buffers included. 0 means taken
data.availability[].capacity integer The most guests the boat carries
data.availability[].price_preview number What one boat costs for the window, with nothing chosen beyond the boat
data.availability[].units number How many billing units the window is, for example 4 hours
data.availability[].billing_type string The billing unit
data.not_offered array Boats the window does not suit, with the code and message the booking would be refused with (too many guests, not one of its departure times, too short)

A Pro app may add fields to a row or to data, such as a reason in place of “sold out”.

Errors

Status Code When
422 rest_error location_id, start or end is missing or unreadable.
422 location_unavailable The marina does not exist, is inactive, or the form does not book there.
422 type_unavailable boat_id is not stocked at the marina, is inactive, or the form does not offer it.
422 no_price boat_id has no price at the marina for its billing unit.
410 form_unavailable form_id names a form that is not active.
422 invalid_range / too_soon / too_far The return is not after the departure, or the departure is in the past, too soon or too far ahead.
422 location_closed / outside_hours The marina is closed that day, or outside its hours.
429 plugixa_boatrental_rate_limited Too many requests from this address. Retry-After says when to try again.
403 plugixa_boatrental_key_scope A key was sent with POST.

Plus the errors every endpoint can return.

Examples

curl -s -G "https://your-site.example/wp-json/pbr/v1/availability" \
  --data-urlencode "location_id=2" \
  --data-urlencode "start=2026-11-20 10:00" \
  --data-urlencode "end=2026-11-20 14:00" \
  --data-urlencode "guests=4"
<?php
$query = http_build_query([
    'location_id' => 2,
    'start'       => '2026-11-20 10:00',
    'end'         => '2026-11-20 14:00',
    'guests'      => 4,
]);
$ch = curl_init('https://your-site.example/wp-json/pbr/v1/availability?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const params = new URLSearchParams({ location_id: '2', start: '2026-11-20 10:00', end: '2026-11-20 14:00', guests: '4' });
const response = await fetch(`https://your-site.example/wp-json/pbr/v1/availability?${params}`);
const { data } = await response.json();

Quick Links

Share