Contents
On this page

Update Tax Rate - Plugixa Car Rental

PUT /plugixa-car-rental/v1/tax-rates/{id}

Change a tax rate. Only the fields you send are changed; PATCH works the same way.

Needs Plugixa Car Rental Pro with the Tax app on. The user needs the plugixa_car_rental_edit capability.

Request

PUT https://your-site.example/wp-json/plugixa-car-rental/v1/tax-rates/2

Path parameters

Name Type Description
id integer The tax rate’s id

Request body

Content type: application/json

Field Type Required Description
name string No As it should appear on the bill. Up to 100 characters.
rate number No More than 0, and at most 100 for a percentage. Rounded to 4 decimals.
type string No percent or fixed.
compound boolean No Charge this percentage on the taxes before it too. Only for percent.
location_ids integer[] No Pickup locations it applies to. Empty: every location.
sort_order integer No 0 to 9999, lowest applied first.
status string No published or unpublished.
modified_at string No The modified_at you read. When it differs from the stored one the update is refused with 409. See Edit conflicts.

Fields you leave out keep their stored value. The whole rate, as it would be after the change, is checked again. location_ids is replaced as a whole.

{
  "location_ids": [
    1,
    2
  ],
  "modified_at": "2026-11-12 09:30:00"
}

Responses

200 OK. data is the tax rate as it now is.

{
  "success": true,
  "data": {
    "id": 2,
    "name": "VAT 20%",
    "rate": 20.0,
    "type": "percent",
    "compound": false,
    "location_ids": [
      1,
      2
    ],
    "sort_order": 0,
    "status": "published",
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 10:15:00",
    "deleted_at": null
  }
}
Field Type Meaning
data.location_ids integer[] Pickup locations it applies to. Empty: every location
data.modified_at string UTC datetime of this change

Errors

Status Code When
404 plugixa_car_rental_not_found No tax rate with that id, or it is in the trash.
422 plugixa_car_rental_invalid name is blank, rate is not above 0 or a percentage above 100, compound is set on a fixed amount, or location_ids names a location that does not exist. data.field names the field.
422 plugixa_car_rental_invalid_choice status or type is not one of its values. data.allowed lists them.
422 plugixa_car_rental_not_a_number A number field was sent as something else. data.field names it.
422 plugixa_car_rental_negative_number A number field that cannot be negative is. data.field names it.
422 plugixa_car_rental_too_long A text field is longer than its column. data.field names it and data.max gives the limit.
409 plugixa_car_rental_conflict You sent modified_at and the tax rate has been saved by someone else since. data.expected and data.current carry both values.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-rental/v1/tax-rates/2" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"location_ids":[1,2],"modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/tax-rates/2');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'location_ids' => [1, 2],
        'modified_at'  => '2026-11-12 09:30:00',
    ]),
]);
$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/tax-rates/2', {
  method: 'PUT',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ location_ids: [1, 2], modified_at: '2026-11-12 09:30:00' }),
});
const { data } = await response.json();

Quick Links

Share