Contents
On this page

Adjust Loyalty Points - Plugixa Car Wash

POST /plugixa-carwash/v1/customers/{id}/loyalty/adjust

Give a customer points, or take some away with a negative number.

Needs Plugixa Car Wash Pro with the Loyalty points app on, and the plugixa_carwash_edit capability. A refusal here uses WordPress’s own rest_forbidden code.

Request

POST https://your-site.example/wp-json/plugixa-carwash/v1/customers/25/loyalty/adjust

Path parameters

Name Type Description
id integer The customer’s id

Request body

Content type: application/json

Field Type Required Description
points integer Yes Not zero. The balance cannot go below zero.
note string No Kept in the history. Defaults to “Adjusted by staff”.
{
  "points": 25,
  "note": "Apology for the wait"
}

Responses

200 OK. data is the new summary, as Get Loyalty Points returns it.

{
  "success": true,
  "data": {
    "balance": 255,
    "rules": {
      "points_per_unit": 1.0,
      "reward_points": 100,
      "reward_value": 10.0
    },
    "rewards": 2,
    "history": [
      {
        "id": 90,
        "kind": "adjust",
        "points": 25,
        "coupon_code": "",
        "note": "Apology for the wait",
        "booking_number": null,
        "created_at": "2026-11-12 11:00:00"
      },
      {
        "id": 88,
        "kind": "earn",
        "points": 52,
        "coupon_code": "",
        "note": "CW2026-0042",
        "booking_number": "CW2026-0042",
        "created_at": "2026-11-14 16:30:00"
      },
      {
        "id": 71,
        "kind": "adjust",
        "points": 20,
        "coupon_code": "",
        "note": "Welcome bonus",
        "booking_number": null,
        "created_at": "2026-11-01 09:00:00"
      }
    ]
  }
}
Field Type Meaning
data.balance integer Points now

Errors

Status Code When
404 plugixa_carwash_not_found No such customer, or the customer is in the trash.
400 rest_missing_callback_param points is missing.
400 rest_invalid_param points is not an integer.
422 plugixa_carwash_invalid_points points is zero, or would take the balance below zero.
503 plugixa_carwash_busy The balance was being changed by another request. Try again.
401 rest_forbidden Not signed in.
403 rest_forbidden Signed in without the capability.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-carwash/v1/customers/25/loyalty/adjust" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"points":25,"note":"Apology for the wait"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/customers/25/loyalty/adjust');
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([
        'points' => 25,
        'note'   => 'Apology for the wait',
    ]),
]);
$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-carwash/v1/customers/25/loyalty/adjust', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ points: 25, note: 'Apology for the wait' }),
});
const { data } = await response.json();

Quick Links

Share