Contents
On this page

Change Booking Status - Plugixa Car Rental

POST /plugixa-car-rental/v1/bookings/{id}/status

Move a booking to another status: confirm it, cancel it, record the pickup and the return, close it.

The user needs the plugixa_car_rental_edit capability.

A booking is never edited field by field: its dates, car and price move together, and its status only along the moves below.

Status Means May move to
pending Made, not confirmed. A booking from the booking form holds its car until its hold runs out; one made by staff holds it until somebody confirms or cancels it confirmed, cancelled, expired
confirmed The car is the customer’s for the dates picked_up, cancelled, no_show
picked_up The car is out returned
returned The car is back completed
completed Closed. An invoice is issued at this point when the Invoices app is on none
cancelled Cancelled. Frees the car and gives a coupon use back none
no_show The customer did not come none
expired A hold that ran out, or was given back none

Confirming a booking whose hold ran out still works if its car, or another car of the same model, is still free; the car may then change. Confirming also records the coupon use. Cancelling frees the car and gives the coupon use back. Every move fires plugixa_car_rental_booking_status_changed, which sends the emails and messages you have set up. With Pro and the Inspections app, signing a pickup or return inspection makes the picked_up and returned moves for you.

Request

POST https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/status

Path parameters

Name Type Description
id integer The booking’s id

Request body

Content type: application/json

Field Type Required Description
status string Yes The status to move to. One of the eight statuses.
modified_at string No The modified_at you read, to be warned of a conflicting edit. See Edit conflicts.
{
  "status": "picked_up"
}

Responses

200 OK. data is the booking as it now is.

{
  "success": true,
  "data": {
    "id": 128,
    "reference": "CR-2026-0128",
    "status": "picked_up",
    "source": "admin",
    "vehicle_model_id": 4,
    "vehicle_unit_id": 9,
    "pickup_location_id": 1,
    "return_location_id": 1,
    "pickup_at": "2026-12-01 09:00:00",
    "return_at": "2026-12-04 09:00:00",
    "hold_expires_at": null,
    "billable_days": 3,
    "customer_id": null,
    "customer_name": "Claire Martin",
    "customer_email": "claire.martin@example.com",
    "customer_phone": "+33 6 12 34 56 78",
    "currency": "EUR",
    "subtotal": 219.0,
    "discount_total": 21.9,
    "tax_total": 0.0,
    "total": 197.1,
    "deposit": 800.0,
    "amount_paid": 0.0,
    "payment_status": "unpaid",
    "payment_method": "",
    "notes": "Arrives on the 08:40 train.",
    "meta": [],
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-12-01 09:05:00",
    "deleted_at": null,
    "line_items": [
      {
        "id": 301,
        "booking_id": 128,
        "position": 0,
        "type": "rental",
        "reference_id": 5,
        "label": "Peugeot 3008, 3 days",
        "quantity": 3.0,
        "unit_price": 65.0,
        "total": 195.0,
        "meta": null,
        "created_by": "1",
        "modified_by": "1",
        "created_at": "2026-11-12 09:30:00",
        "modified_at": "2026-11-12 09:30:00",
        "deleted_at": null
      },
      {
        "id": 302,
        "booking_id": 128,
        "position": 1,
        "type": "extra",
        "reference_id": 3,
        "label": "Child seat",
        "quantity": 1.0,
        "unit_price": 24.0,
        "total": 24.0,
        "meta": null,
        "created_by": "1",
        "modified_by": "1",
        "created_at": "2026-11-12 09:30:00",
        "modified_at": "2026-11-12 09:30:00",
        "deleted_at": null
      },
      {
        "id": 303,
        "booking_id": 128,
        "position": 2,
        "type": "coupon",
        "reference_id": 7,
        "label": "Coupon WINTER10",
        "quantity": 1.0,
        "unit_price": -21.9,
        "total": -21.9,
        "meta": null,
        "created_by": "1",
        "modified_by": "1",
        "created_at": "2026-11-12 09:30:00",
        "modified_at": "2026-11-12 09:30:00",
        "deleted_at": null
      }
    ],
    "next": [
      "returned"
    ],
    "pickup_local": "2026-12-01 10:00 CET",
    "return_local": "2026-12-04 10:00 CET",
    "vehicle_model_name": "Peugeot 3008",
    "vehicle_unit_plate": "AB-123-CD",
    "pickup_location_name": "Paris Gare de Lyon",
    "return_location_name": "Paris Gare de Lyon"
  }
}
Field Type Meaning
data.status string The new status
data.next string[] Statuses it may move to now
data.vehicle_unit_id integer|null The car, which a late confirmation may have changed
data.hold_expires_at string|null Cleared when a pending booking moves on

The whole booking comes back, in the same shape as Get Booking.

Errors

Status Code When
404 plugixa_car_rental_not_found No booking with that id, or it is in the trash.
400 rest_missing_callback_param status is missing.
400 rest_invalid_param status is not one of the eight statuses.
409 plugixa_car_rental_illegal_transition The booking cannot move from its status to that one. data.allowed lists where it can go.
409 plugixa_car_rental_hold_lapsed Confirming: the hold ran out and no car of the model is free any more.
409 plugixa_car_rental_coupon_used_up Confirming: the booking’s coupon reached its usage limit since it was applied, and nothing has been paid on it yet.
409 plugixa_car_rental_busy Confirming: another booking for the same model was being made at that moment. Try again.
409 plugixa_car_rental_unknown_location Confirming: a location the booking uses was deleted for good.
409 plugixa_car_rental_conflict You sent modified_at and the booking has been changed since.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/status" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"status":"picked_up"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/status');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'status' => 'picked_up',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/status', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ status: 'picked_up' }),
});
const { data } = await response.json();

Quick Links

Share