Contents
On this page

Quote Booking - Plugixa Car Rental

POST /plugixa-car-rental/v1/bookings/quote

Price a rental of one model without booking it.

A read: the user needs the plugixa_car_rental_view capability. It is a POST only because the question is a JSON body; it writes nothing.

A quote does not check that a car is free: use Search Availability for that. A booking is priced again when it is made, from the stored rates.

Request

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

Request body

Content type: application/json

Field Type Required Description
pickup_location_id integer Yes A published location that allows pickups.
return_location_id integer No A published location that allows returns. Omitted or 0: the pickup location.
pickup_at string Yes Local time at the pickup location: YYYY-MM-DD HH:MM, with optional seconds, a space or a T between. No time-zone offset, and a bare date is refused.
return_at string Yes Local time at the return location, in the same form. After pickup_at.
vehicle_model_id integer Yes A published vehicle model.
extras object[] No Extras to add, as {"id": 3, "quantity": 1}. Only published extras count, and a quantity above the extra’s max_quantity is cut to it. Needs the Extras app.
coupon string No A coupon code. Needs the Coupons app.
driver_age integer No The driver’s age, 16 to 99, for the young and senior driver surcharges and each model’s minimum age. Needs Pro with the Driver age app.
delivery_address string No Deliver the car to this address. Needs Pro with the Delivery and collection app.
collection_address string No Collect the car from this address at the end. Needs Pro with the Delivery and collection app.
currency string No Price in another of your currencies, by its code. Needs Pro with the Multi-currency app. Unknown codes are ignored.
{
  "pickup_location_id": 1,
  "pickup_at": "2026-12-01 10:00",
  "return_at": "2026-12-04 10:00",
  "vehicle_model_id": 4,
  "extras": [
    {
      "id": 3,
      "quantity": 1
    }
  ],
  "coupon": "WINTER10"
}

Responses

200 OK. data is the quote.

{
  "success": true,
  "data": {
    "vehicle_model_id": 4,
    "rate_plan_id": 5,
    "days": 3,
    "daily_rate": 65.0,
    "currency": "EUR",
    "line_items": [
      {
        "type": "rental",
        "reference_id": 5,
        "label": "Peugeot 3008, 3 days",
        "quantity": 3.0,
        "unit_price": 65.0,
        "total": 195.0
      },
      {
        "type": "extra",
        "reference_id": 3,
        "label": "Child seat",
        "quantity": 1.0,
        "unit_price": 24.0,
        "total": 24.0
      },
      {
        "type": "coupon",
        "reference_id": 7,
        "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,
    "exchange_rate": 1.0,
    "window": {
      "pickup_location_id": 1,
      "return_location_id": 1,
      "pickup_at": "2026-12-01T10:00:00+01:00",
      "return_at": "2026-12-04T10:00:00+01:00",
      "days": 3,
      "one_way": false,
      "after_hours": []
    },
    "refusal": "",
    "refusal_field": "",
    "refusal_scope": "car"
  }
}
Field Type Meaning
data.days integer Days charged. Counted on the pickup location’s calendar, with a grace period before an extra day is charged
data.daily_rate number The rate plan’s price per day
data.rate_plan_id integer The rate plan that priced it
data.line_items object[] Each line: type (rental, extra, one_way, after_hours, coupon and, with Pro, pricing_rule, delivery, driver age and tax lines), label, quantity, unit_price, total, and reference_id where the line comes from a record
data.subtotal number Sum of the positive lines
data.discount_total number Sum of the discounts, as a positive number
data.tax_total number Tax added after discounts
data.total number What the customer pays
data.deposit number Held at the desk, not part of total
data.currency string Currency code
data.exchange_rate number Units of currency per unit of the site’s currency. 1 unless another currency was asked for
data.window object The rental window as understood: locations, pickup_at and return_at with their offset, days, one_way, and after_hours listing the ends (pickup, return) that fall outside opening hours
data.refusal string Why this car cannot be booked for this request, or empty
data.refusal_field string The field the refusal is about, or empty
data.notices object Only when a coupon was sent and refused: notices.coupon says why. The quote is then priced without it

A car refused for this request (for example a driver younger than its minimum age) is still priced, with refusal set, and still answers 200.

Errors

Status Code When
422 plugixa_car_rental_unknown_location A location is missing, unpublished or in the trash. data.field names it.
422 plugixa_car_rental_location_not_allowed The pickup location takes no pickups, or the return location takes no returns.
422 plugixa_car_rental_invalid_datetime pickup_at or return_at is missing, a bare date, not a date, or a time skipped by a clock change at that location.
422 plugixa_car_rental_return_before_pickup return_at is not after pickup_at.
422 plugixa_car_rental_location_closed The location is closed on that day.
422 plugixa_car_rental_outside_hours The time is outside the location’s opening hours and it charges no after-hours fee.
422 plugixa_car_rental_too_short The rental is shorter than the shortest rental in the booking rules.
422 plugixa_car_rental_too_long The rental is longer than the longest rental in the booking rules. data.field is return_at.
422 plugixa_car_rental_unknown_model vehicle_model_id is missing, unpublished or not a model.
422 plugixa_car_rental_not_priced No published rate covers a rental of this length for the model.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/quote" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"pickup_location_id":1,"pickup_at":"2026-12-01 10:00","return_at":"2026-12-04 10:00","vehicle_model_id":4,"extras":[{"id":3,"quantity":1}],"coupon":"WINTER10"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/quote');
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([
        'pickup_location_id' => 1,
        'pickup_at'          => '2026-12-01 10:00',
        'return_at'          => '2026-12-04 10:00',
        'vehicle_model_id'   => 4,
        'extras'             => [
            [
                'id'       => 3,
                'quantity' => 1,
            ],
        ],
        'coupon'             => 'WINTER10',
    ]),
]);
$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/quote', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    pickup_location_id: 1,
    pickup_at: '2026-12-01 10:00',
    return_at: '2026-12-04 10:00',
    vehicle_model_id: 4,
    extras: [{ id: 3, quantity: 1 }],
    coupon: 'WINTER10',
  }),
});
const { data } = await response.json();

Quick Links

Share