Contents
On this page

Get Loyalty Points - Plugixa Car Wash

GET /plugixa-carwash/v1/customers/{id}/loyalty

Read a customer’s points balance, the reward rules, how many rewards they can claim, and their latest movements.

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

Note. The customer is not looked up first: an unknown id answers 200 with a balance of 0 and an empty history.

Request

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

Path parameters

Name Type Description
id integer The customer’s id

Responses

200 OK.

{
  "success": true,
  "data": {
    "balance": 230,
    "rules": {
      "points_per_unit": 1.0,
      "reward_points": 100,
      "reward_value": 10.0
    },
    "rewards": 2,
    "history": [
      {
        "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
data.rules.points_per_unit number Points earned per unit of currency spent
data.rules.reward_points integer Points one reward costs
data.rules.reward_value number Value of the coupon a reward gives
data.rewards integer Rewards the balance can pay for
data.history[] object The latest 50 movements: kind (earn, adjust or redeem), points, coupon_code, note, booking_number, created_at

Points are earned once per booking, when it becomes completed: its total times points_per_unit, rounded down.

Errors

Status Code When
401 rest_forbidden Not signed in.
403 rest_forbidden Signed in without the capability.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-carwash/v1/customers/25/loyalty" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/customers/25/loyalty');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$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', {
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share