Contents
On this page

Get Price Quote - Plugixa Car Wash

GET /plugixa-carwash/v1/public/quote

Price what the customer has chosen so far, exactly as the booking would be priced: the live summary of the booking form.

Open to anyone: no sign-in. Rate-limited per visitor address to 600 requests an hour, shared by every public read route (bucket carwash_read). See Public routes.

Request

GET https://your-site.example/wp-json/plugixa-carwash/v1/public/quote?form_id=1&location_id=3&vehicle_type_id=2&package_id=4&coupon=SPRING10

Query parameters

Name Type Default Description
form_id integer Required. A published booking form.
location_id integer One of the form’s locations.
vehicle_type_id integer One of the form’s vehicle types. Required as soon as one vehicle type is published.
package_id integer One of the form’s packages. Required unless the form’s display is services.
service_ids string Comma-separated service ids: add-ons allowed with the package, or any published service on a services form. A packages form takes none.
coupon string A coupon code, or with Pro a gift card code.
date string Y-m-d. Used by Pro memberships to check the membership covers that day.

Send the customer’s X-PCW-Session header too and the price is worked out for that signed-in customer, which matters for Pro apps that price per customer such as Memberships and Fleet accounts.

Responses

200 OK. data is the quote.

{
  "success": true,
  "data": {
    "lines": [
      {
        "role": "package",
        "item_id": 4,
        "name": "Deluxe",
        "price": 49.0,
        "duration": 60
      },
      {
        "role": "discount",
        "source": "coupon",
        "item_id": 9,
        "name": "Coupon SPRING10",
        "price": -4.9,
        "duration": 0
      }
    ],
    "duration": 60,
    "currency": "USD",
    "tax_rate": 6.25,
    "prices_include_tax": false,
    "discount": 4.9,
    "subtotal": 44.1,
    "tax": 2.76,
    "total": 46.86,
    "due": 46.86,
    "coupon": {
      "code": "SPRING10",
      "valid": true,
      "id": 9
    }
  }
}
Field Type Meaning
data.lines[] object role (package, addon, service, fee or discount), item_id, name, price, duration, and for fees and discounts a source
data.duration integer Minutes the wash takes, at least 5
data.tax_rate number The location’s rate, percent
data.prices_include_tax boolean Whether the tax is inside the prices
data.subtotal number Sum of the lines
data.tax number Tax
data.total number Total
data.due number What is left to pay after credits such as a gift card PRO
data.coupon object Only when a code was sent: code, valid, and message when it does not apply

A code that does not apply does not fail the quote: coupon.valid is false and coupon.message says why (“That code has expired.”, “That code has been used up.” …). Booking with it is refused. With Pro, credits, membership and notices can appear too.

Errors

Status Code When
404 plugixa_carwash_form_not_found form_id is missing, or the form does not exist or is not published: “This booking form is not available.”
422 plugixa_carwash_not_offered The location, vehicle type, package or an extra is not one this form offers, or it is not published. The message says which, for example “Choose your vehicle type.” or “One of the chosen extras is not available with this package.”
422 plugixa_carwash_nothing_chosen Neither a package nor a service.
422 plugixa_carwash_not_for_vehicle The package or a service is switched off for this vehicle type.
429 plugixa_carwash_rate_limited This address has used up its requests for the hour.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-carwash/v1/public/quote?form_id=1&location_id=3&vehicle_type_id=2&package_id=4&coupon=SPRING10"
<?php
$query = http_build_query([
    'form_id'         => 1,
    'location_id'     => 3,
    'vehicle_type_id' => 2,
    'package_id'      => 4,
    'coupon'          => 'SPRING10',
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/public/quote?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({
  form_id: '1',
  location_id: '3',
  vehicle_type_id: '2',
  package_id: '4',
  coupon: 'SPRING10',
});
const response = await fetch(`https://your-site.example/wp-json/plugixa-carwash/v1/public/quote?${query}`);
const { data } = await response.json();

Quick Links

Share