Contents
On this page

Get Unit - Plugixa Boat Rental

GET /pbr/v1/units/{id}

Read one unit: a pool of a boat at a marina, or one individually identified boat.

An API key PRO with Read only or Read and write access, or a signed-in user with the plugixa_boatrental_view capability.

Request

GET https://your-site.example/wp-json/pbr/v1/units/9

Path parameters

Name Type Description
id integer The unit’s id

Responses

200 OK. data is the unit.

{
  "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"
  }
}
Field Type Meaning
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.location_name, data.boat_name string|null The names behind location_id and boat_id

The other fields are described on List Units.

Errors

Status Code When
404 plugixa_boatrental_not_found No unit with that id, or the unit is in the trash.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/pbr/v1/units/9" \
  -H "Authorization: Bearer $PBR_API_KEY"
<?php
$ch = curl_init('https://your-site.example/wp-json/pbr/v1/units/9');
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 response = await fetch('https://your-site.example/wp-json/pbr/v1/units/9', {
  headers: { 'Authorization': `Bearer ${process.env.PBR_API_KEY}` },
});
const { data } = await response.json();

Quick Links

Share