Contents
On this page

Quote Booking - Plugixa Car Parking

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

Work out what a stay would cost, with every price line and total, without creating anything. This is the pricing the Create Booking route stores.

The user needs the plugixa_carparking_view capability.

Note. A quote checks neither availability nor opening hours: a price for dates that are full or closed still comes back. A space type with no price for the billing unit is priced at 0. An unknown or invalid coupon is ignored without an error: check coupon_id in the answer to see whether it was applied.

Request

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

Request body

Content type: application/json

Field Type Required Description
location_id integer Yes The location.
space_type_id integer Yes The space type.
entry_datetime string Yes YYYY-MM-DD, optionally followed by HH:MM or HH:MM:SS, in the site’s time zone.
exit_datetime string Yes Same format, after the entry.
quantity integer No Number of spaces. Defaults to 1.
billing_type string No minute, hour, day, week or month. Defaults to the location’s billing unit.
coupon string No A coupon code, checked as for the signed-in staff user. Applied only when coupons are switched on in the settings.
extras PRO array No Extras as { "id": 4, "quantity": 1 } objects. Extras the location does not offer are skipped.
{
  "location_id": 3,
  "space_type_id": 2,
  "entry_datetime": "2026-12-01 08:00",
  "exit_datetime": "2026-12-04 08:00",
  "quantity": 1,
  "coupon": "WINTER10"
}

Responses

200 OK. data is the quote.

{
  "success": true,
  "data": {
    "location_id": 3,
    "space_type_id": 2,
    "billing_type": "day",
    "units": 3,
    "quantity": 1,
    "currency": "EUR",
    "line_items": [
      {
        "type": "fee",
        "label": "Booking fee",
        "quantity": 1,
        "unit_price": 8,
        "total": 8
      },
      {
        "type": "parking",
        "reference_id": 2,
        "label": "1 space × 3 days",
        "quantity": 3,
        "unit_price": 12.5,
        "total": 37.5
      },
      {
        "type": "discount",
        "reference_id": 6,
        "label": "Coupon WINTER10",
        "quantity": 1,
        "unit_price": -4.55,
        "total": -4.55
      }
    ],
    "subtotal": 45.5,
    "discount_total": 4.55,
    "coupon_id": 6,
    "coupon_code": "WINTER10",
    "tax_total": 0,
    "deposit_amount": 0,
    "total": 40.95
  }
}
Field Type Meaning
data.billing_type string The billing unit used
data.units number Billing units in the stay, rounded up, at least 1. Calendar months for month
data.currency string The location’s currency, else the site’s
data.line_items array The price lines: fee, parking, extra PRO, discount, tax PRO. A line a pricing rule changed PRO also carries original_unit_price, original_amount and adjustments
data.subtotal number Fee, parking and extras, before the discount
data.discount_total number The coupon discount
data.coupon_id integer|null The coupon applied, null if none was
data.coupon_code string|null Its code
data.tax_total number Lines added after the discount, such as tax PRO
data.deposit_amount number What would be due now when a deposit applies PRO, else 0
data.total number Subtotal minus discount plus tax, never below 0
data.extras_total number With Pro: the sum of the extra lines
data.installments object|null With Pro, when the location offers monthly payments: the plan the stay can be paid by (months, first, monthly, rolling), or null when the stay is too short or costs nothing

Errors

Status Code When
422 plugixa_carparking_not_a_number location_id, space_type_id or quantity is not a number.
422 plugixa_carparking_negative_number One of those numbers is negative.
422 plugixa_carparking_invalid_date A date is not in the accepted format or is not a real date.
422 missing_fields Location, space type, entry or exit is missing.
422 invalid_range The exit is not after the entry.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/quote" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"location_id":3,"space_type_id":2,"entry_datetime":"2026-12-01 08:00","exit_datetime":"2026-12-04 08:00","quantity":1,"coupon":"WINTER10"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/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([
        'location_id'    => 3,
        'space_type_id'  => 2,
        'entry_datetime' => '2026-12-01 08:00',
        'exit_datetime'  => '2026-12-04 08:00',
        'quantity'       => 1,
        'coupon'         => 'WINTER10',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/quote', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    location_id: 3,
    space_type_id: 2,
    entry_datetime: '2026-12-01 08:00',
    exit_datetime: '2026-12-04 08:00',
    quantity: 1,
    coupon: 'WINTER10',
  }),
});
const { data } = await response.json();

Quick Links

Share