Contents
On this page

Create Tax Rate - Plugixa Car Parking

POST /plugixa-car-parking/v1/tax-rates

Create a tax rate. An active rate is charged on every booking at the locations it applies to. See Tax rates.

Needs Plugixa Car Parking Pro. The WordPress user needs the plugixa_carparking_create capability (create records).

Request

POST https://your-site.example/wp-json/plugixa-car-parking/v1/tax-rates

Request body

Content type: application/json

Field Type Required Description
name string Yes Must not be blank.
rate number No Zero or more. At most 100 when type is percent, at most 999.9999 otherwise. Defaults to 0.
type string No percent: a share of the booking. fixed: the same amount on every booking. Defaults to percent.
is_compound boolean No true to charge the rate on the booking plus the taxes charged before it. Defaults to false.
status string No active or inactive. Defaults to active.
applies_to object|null No {"locations": [3]} to charge the rate only at those locations. null, an empty string or an empty list means every location.
display_order integer No May be negative. Defaults to 0.

A percent rate is charged on the booking total after discounts. Rates are charged in display_order, and that order decides what a compound rate compounds on. A rate that works out at zero adds no line to the quote.

{
  "name": "VAT",
  "rate": 20,
  "type": "percent",
  "is_compound": false
}

Responses

201 Created. data is the new tax rate.

{
  "success": true,
  "data": {
    "id": 2,
    "name": "VAT",
    "rate": 20.0,
    "type": "percent",
    "is_compound": false,
    "applies_to": null,
    "status": "active",
    "display_order": 0,
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "deleted_at": null
  }
}
Field Type Meaning
data.id integer The tax rate’s id
data.name string Shown on the quote and the invoice beside the tax charged
data.rate number A percentage when type is percent, an amount when it is fixed
data.type string percent or fixed
data.is_compound boolean Whether the rate is charged on the taxed price
data.status string active or inactive
data.applies_to object|null {"locations": [ids]} when the rate is charged only at those locations, null when it is charged everywhere
data.display_order integer The order rates are charged in, lowest first
data.created_at string UTC datetime
data.modified_at string UTC datetime of the last change. Send it back on an update to have the change refused if somebody else saved first
data.deleted_at string|null null unless the record is in the trash

Errors

Status Code When
422 plugixa_carparking_missing_name name is missing or blank.
422 plugixa_carparking_invalid_choice status or type is not one of the accepted values. data.allowed lists them.
422 plugixa_carparking_not_a_number rate or display_order is not a number. Use a dot for decimals.
422 plugixa_carparking_number_too_large A number is larger than 99999999.
422 plugixa_carparking_negative_number rate is negative.
422 plugixa_carparking_invalid_rate A percent rate above 100, or any rate above 999.9999.
422 plugixa_carparking_not_a_boolean is_compound is not true or false.
422 plugixa_carparking_invalid_scope applies_to is not an object whose locations is a list of location ids.
422 plugixa_carparking_too_long A text field is longer than its column holds. data.field names it and data.max gives the limit.
500 plugixa_carparking_insert_failed The database refused the new row.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-parking/v1/tax-rates" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"VAT","rate":20,"type":"percent","is_compound":false}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/tax-rates');
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([
        'name'        => 'VAT',
        'rate'        => 20,
        'type'        => 'percent',
        'is_compound' => false,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-parking/v1/tax-rates', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'VAT', rate: 20, type: 'percent', is_compound: false }),
});
const { data } = await response.json();

Quick Links

Share