Contents
On this page

Cancel Booking - Plugixa Car Rental

POST /plugixa-car-rental/v1/public/manage/cancel

Cancel the booking a manage link opens, on the terms View Booking showed.

Public: no sign-in and no nonce. Needs the Customer portal app on. Rate limited to 10 requests an hour per visitor address: see Public routes.

The terms are recorded on the booking, its status becomes cancelled, and plugixa_car_rental_booking_cancelled_by_customer fires. The refund is paid back automatically only for money taken by an online method that can refund; anything paid at the desk is yours to return.

Request

POST https://your-site.example/wp-json/plugixa-car-rental/v1/public/manage/cancel

Request body

Content type: application/json

Field Type Required Description
link string Yes The manage token from the customer’s link: the value of pcr_manage in manage_url, in the form <booking id>-<64 hexadecimal characters>.
fee number No The fee the customer was shown. When given and different from today’s fee (a deadline passed in between), the cancellation is refused so they can confirm the new terms.
{
  "link": "128-3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d",
  "fee": 0
}

Responses

200 OK. data holds the cancelled booking and the terms it was cancelled on.

{
  "success": true,
  "data": {
    "booking": {
      "reference": "CR-2026-0128",
      "status": "cancelled",
      "vehicle_model_name": "Peugeot 3008",
      "pickup_location_name": "Paris Gare de Lyon",
      "return_location_name": "Paris Gare de Lyon",
      "pickup_local": "2026-12-01 10:00 CET",
      "return_local": "2026-12-04 10:00 CET",
      "days": 3,
      "hold_expires_at": null,
      "customer_name": "Claire Martin",
      "customer_email": "claire.martin@example.com",
      "payment_method": "pay_at_pickup",
      "currency": "EUR",
      "line_items": [
        {
          "type": "rental",
          "label": "Peugeot 3008, 3 days",
          "quantity": 3.0,
          "unit_price": 65.0,
          "total": 195.0
        },
        {
          "type": "extra",
          "label": "Child seat",
          "quantity": 1.0,
          "unit_price": 24.0,
          "total": 24.0
        },
        {
          "type": "coupon",
          "label": "Coupon WINTER10",
          "quantity": 1.0,
          "unit_price": -21.9,
          "total": -21.9
        }
      ],
      "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_options": [
        {
          "type": "full",
          "amount": 197.1,
          "label": ""
        }
      ]
    },
    "cancellation": {
      "allowed": false,
      "free": true,
      "free_until": "2026-11-29T09:00:00Z",
      "fee": 0.0,
      "refund": 0.0,
      "reason": "This booking can no longer be cancelled online.",
      "free_until_local": "2026-11-29 10:00 CET",
      "recorded": true
    }
  }
}
Field Type Meaning
data.booking.status string cancelled
data.cancellation.recorded boolean true on a cancelled booking: fee and refund are then the ones it was cancelled on

Errors

Status Code When
404 plugixa_car_rental_link_invalid The link is malformed, does not match the booking, or the booking is in the trash.
409 plugixa_car_rental_cannot_cancel The booking cannot be cancelled online: not pending or confirmed, or its pickup time has passed. The message says which.
409 plugixa_car_rental_terms_changed fee differs from today’s fee. data.cancellation carries the new terms.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-rental/v1/public/manage/cancel" \
  -H "Content-Type: application/json" \
  -d '{"link":"128-3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d","fee":0}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/public/manage/cancel');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'link' => '128-3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d',
        'fee'  => 0,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-rental/v1/public/manage/cancel', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    link: '128-3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d',
    fee: 0,
  }),
});
const { data } = await response.json();

Quick Links

Share