Contents
On this page

Check Out - Plugixa Car Rental

POST /plugixa-car-rental/v1/public/checkout

Complete a held booking: save the customer’s details and answers, and start the payment.

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

With an offline method (pay at pickup, bank transfer) the booking is confirmed straight away and instructions says what to do next. With an online method (Stripe or PayPal, with Pro) the hold is extended while the customer pays, redirect is the provider’s page to send them to, and the booking is confirmed when the provider reports the payment.

Checking out again a booking that is already confirmed with the same payment_method answers the same result again, so a repeated click is harmless.

Request

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

Request body

Content type: application/json

Field Type Required Description
token string Yes The token Hold Car returned.
customer_name string Yes Must not be blank.
customer_email string Yes A valid address. The confirmation is sent there.
consent boolean Yes Must be true: the customer accepts your terms. When they did is kept on the booking.
payment_method string Yes The id of a switched-on method from Booking Form Options.
customer_phone string No Phone number.
notes string No Plain text.
pay_type string No For an online method: one of the booking’s payment_options types. Anything else: the first option, usually the full amount.
fields object No Answers to your custom fields, keyed by key. A required field must be answered; a select answer must be one of its options, a number numeric, a date YYYY-MM-DD, a checkbox true or false.
page_url string No The page the customer booked on, kept so an online payment can bring them back. Only an address on your site is kept.
website string No A honeypot: leave it empty or leave it out.
{
  "token": "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
  "customer_name": "Claire Martin",
  "customer_email": "claire.martin@example.com",
  "customer_phone": "+33 6 12 34 56 78",
  "notes": "Arrives on the 08:40 train.",
  "consent": true,
  "payment_method": "pay_at_pickup",
  "fields": {
    "flight_number": "AF1234"
  },
  "website": ""
}

Responses

200 OK. data holds the booking and what to do next.

{
  "success": true,
  "data": {
    "booking": {
      "reference": "CR-2026-0128",
      "status": "confirmed",
      "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": ""
        }
      ]
    },
    "instructions": "Pay at the desk when you collect the car.",
    "redirect": "",
    "manage_url": "https://your-site.example/my-booking/?pcr_manage=128-3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d"
  }
}
Field Type Meaning
data.booking object The booking, as on Get Held Booking
data.instructions string Text to show the customer: the method’s instructions with the booking reference filled in
data.redirect string For an online method, the payment page to send the customer to. Empty otherwise
data.manage_url string The link to the customer’s booking page, as in the confirmation email. Empty without the Customer portal app and its page

Errors

Status Code When
404 plugixa_car_rental_not_found No booking has that token, or it is in the trash.
409 plugixa_car_rental_booking_closed The booking is no longer pending, for example its hold ran out.
422 plugixa_car_rental_invalid customer_name is blank, customer_email is not valid, consent is not true, payment_method is not a switched-on method, or a custom field answer is missing or invalid. data.field names it, as fields.<key> for a custom field.
422 plugixa_car_rental_too_long A customer field is longer than its column. data.field names it.
409 plugixa_car_rental_nothing_owed An online method was chosen and nothing is owed.
502 plugixa_car_rental_payment_unavailable The online payment provider could not start the payment. The message is the provider’s.
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 coupon reached its usage limit since it was applied.
400 plugixa_car_rental_rejected The hidden website field was filled in.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-rental/v1/public/checkout" \
  -H "Content-Type: application/json" \
  -d '{"token":"ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb","customer_name":"Claire Martin","customer_email":"claire.martin@example.com","customer_phone":"+33 6 12 34 56 78","notes":"Arrives on the 08:40 train.","consent":true,"payment_method":"pay_at_pickup","fields":{"flight_number":"AF1234"},"website":""}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/public/checkout');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'token'          => 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb',
        'customer_name'  => 'Claire Martin',
        'customer_email' => 'claire.martin@example.com',
        'customer_phone' => '+33 6 12 34 56 78',
        'notes'          => 'Arrives on the 08:40 train.',
        'consent'        => true,
        'payment_method' => 'pay_at_pickup',
        'fields'         => [
            'flight_number' => 'AF1234',
        ],
        'website'        => '',
    ]),
]);
$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/checkout', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    token: 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb',
    customer_name: 'Claire Martin',
    customer_email: 'claire.martin@example.com',
    customer_phone: '+33 6 12 34 56 78',
    notes: 'Arrives on the 08:40 train.',
    consent: true,
    payment_method: 'pay_at_pickup',
    fields: { flight_number: 'AF1234' },
    website: '',
  }),
});
const { data } = await response.json();

Quick Links

Share