Contents
On this page

Update Pricing Rule - Plugixa Car Parking

PUT /plugixa-car-parking/v1/pricing-rules/{id}

Change a pricing rule’s fields. PATCH is accepted too and behaves the same.

Needs Plugixa Car Parking Pro. The WordPress user needs the plugixa_carparking_edit capability (change records).

Note. Only the fields you send change: anything left out keeps its stored value. conditions, though, is one value: sending it replaces the whole set, so a condition you leave out of it is removed.

Request

PUT https://your-site.example/wp-json/plugixa-car-parking/v1/pricing-rules/6

Path parameters

Name Type Description
id integer The pricing rule’s id

Request body

Content type: application/json

Field Type Required Description
name string No Must not be blank.
alter_type string No set (replace the price with amount), inc_value, dec_value, inc_percent or dec_percent. Empty leaves it unchanged.
amount number No Zero or more.
price_source string No rate or initial. Empty leaves it unchanged.
priority integer No May be negative.
status string No active or inactive. Empty leaves it unchanged.
billing_type string|null No minute, hour, day, week or month to limit the rule to bookings priced in that unit. null or empty: every unit.
conditions object No When the rule applies, as in the table below. A key you leave out is empty. Sending it replaces the whole set.

The conditions are described on Create Pricing Rule.

{
  "amount": 20
}

Responses

200 OK. data is the updated pricing rule.

{
  "success": true,
  "data": {
    "id": 6,
    "name": "Weekend surcharge",
    "priority": 10,
    "status": "active",
    "conditions": {
      "date_from": "",
      "date_to": "",
      "weekdays": [0, 6],
      "time_from": "",
      "time_to": "",
      "duration_min": null,
      "duration_max": null,
      "location_ids": [2],
      "space_type_ids": [],
      "customer_group_ids": []
    },
    "price_source": "rate",
    "alter_type": "inc_percent",
    "amount": 20.0,
    "billing_type": null,
    "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.id integer The rule’s id
data.name string Shown to the customer beside the price it changed
data.priority integer Matching rules are applied lowest first
data.status string active or inactive
data.alter_type string set, inc_value, dec_value, inc_percent or dec_percent
data.amount number The amount or percentage the change uses
data.price_source string rate (the price per billing unit) or initial (the fee charged once per booking)
data.billing_type string|null The one billing unit the rule is limited to, or null for every unit
data.conditions object When the rule applies. Every key is always present; see the conditions table on Create Pricing Rule
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
404 plugixa_carparking_not_found No pricing rule with that id, or it is in the trash.
409 plugixa_carparking_conflict You sent modified_at and the stored record has changed since: somebody else saved first.
422 plugixa_carparking_missing_name name is sent blank.
422 plugixa_carparking_invalid_choice status, price_source, alter_type or billing_type is not one of the accepted values. data.allowed lists them.
422 plugixa_carparking_not_a_number amount or priority 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 amount is negative.
422 plugixa_carparking_invalid_condition A condition cannot be used: a date that does not exist, date_to before date_from, a weekday outside 0 to 6, a time not in HH:MM, a negative stay, duration_max below duration_min, or a list that holds something other than ids. data.field names it, for example conditions.date_to.
422 plugixa_carparking_too_long A text field is longer than its column holds. data.field names it and data.max gives the limit.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share