Contents
List Units - Plugixa Boat Rental
GET /pbr/v1/units
List the units: how many of each boat a marina has, as pools or as individually named boats.
An API key PRO with Read only or Read and write access, or a signed-in user with the plugixa_boatrental_view capability.
A row with a quantity is a pool of interchangeable boats. A row with is_assigned set and a label is one individually identified boat, which a booking can hold as its unit_id.
Request
GET https://your-site.example/wp-json/pbr/v1/units?location_id__in=2&boat_id__in=5
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
location_id__in |
string |
Comma-separated marina ids. | |
boat_id__in |
string |
Comma-separated boat ids. | |
status__in |
string |
active, inactive, or both. |
|
created_at__between |
string |
Created between two days, given on the site’s clock and compared in UTC. modified_at__... works the same way. |
Plus the list parameters every paged list accepts, and the filter operators. search matches the label. orderby accepts id, label, quantity, status, display_order, created_at and modified_at.
Responses
200 OK. data is one page of units.
{
"success": true,
"data": [
{
"id": 9,
"location_id": 2,
"boat_id": 5,
"label": "Sea Ray 1",
"quantity": 1,
"is_assigned": true,
"status": "active",
"display_order": 0,
"meta": null,
"created_by": 1,
"modified_by": 1,
"created_at": "2026-09-01 08:05:00",
"modified_at": "2026-09-01 08:05:00",
"deleted_at": null,
"location_name": "Lisbon Marina",
"boat_name": "Sea Ray 230"
}
],
"meta": { "total": 3, "pages": 1 }
}
| Field | Type | Meaning |
|---|---|---|
data[].id |
integer |
The unit’s id, as unit_id on a booking |
data[].location_id |
integer |
The marina it belongs to |
data[].boat_id |
integer |
The boat it is a unit of |
data[].label |
string|null |
The name of an individually identified boat |
data[].quantity |
integer |
How many boats the row stands for |
data[].is_assigned |
boolean |
true for one identified boat, false for a pool |
data[].status |
string |
active or inactive |
data[].meta |
object|null |
Extra data kept on the unit |
data[].location_name, data[].boat_name |
string|null |
The names behind location_id and boat_id |
data[].created_at |
string|null |
UTC datetime. Can be null on rows made by an older version |
Errors
| Status | Code | When |
|---|---|---|
400 |
plugixa_boatrental_unknown_filter |
A filter names a field units cannot be filtered on. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/pbr/v1/units?location_id__in=2&boat_id__in=5" \
-H "Authorization: Bearer $PBR_API_KEY"
<?php
$query = http_build_query(['location_id__in' => '2', 'boat_id__in' => '5']);
$ch = curl_init('https://your-site.example/wp-json/pbr/v1/units?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PBR_API_KEY'),
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const params = new URLSearchParams({ location_id__in: '2', boat_id__in: '5' });
const response = await fetch(`https://your-site.example/wp-json/pbr/v1/units?${params}`, {
headers: { 'Authorization': `Bearer ${process.env.PBR_API_KEY}` },
});
const { data, meta } = await response.json();
Quick Links
Share