Contents
On this page

Adjust Gift Card Balance - Plugixa Car Wash

POST /plugixa-carwash/v1/gift-cards/{id}/adjust

Add to a gift card’s balance, or take from it with a negative amount. The change is written in the card’s ledger.

Needs Plugixa Car Wash Pro with the Gift cards app on, and the plugixa_carwash_edit capability.

Request

POST https://your-site.example/wp-json/plugixa-carwash/v1/gift-cards/11/adjust

Path parameters

Name Type Description
id integer The gift card’s id

Request body

Content type: application/json

Field Type Required Description
amount number Yes Positive adds, negative takes away. Not zero, and the balance cannot go below zero.
note string No Kept in the ledger, cut to 190 characters. Defaults to “Adjusted by staff”.
{
  "amount": 10,
  "note": "Goodwill top-up"
}

Responses

200 OK. data is the gift card with its new balance.

{
  "success": true,
  "data": {
    "id": 11,
    "code": "K7PQ2DW3HN9C",
    "initial_value": 50.0,
    "balance": 45.5,
    "currency": "USD",
    "recipient_name": "Mia",
    "recipient_email": "mia@example.com",
    "purchaser_name": "Lucas",
    "message": "Happy birthday!",
    "expires_on": "2027-11-12",
    "status": "published",
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-10 08:15:00",
    "modified_at": "2026-11-12 09:30:00",
    "deleted_at": null
  }
}
Field Type Meaning
data.balance number The new balance

Errors

Status Code When
404 plugixa_carwash_not_found No gift card with that id, or it is in the trash.
400 rest_missing_callback_param amount is missing.
400 rest_invalid_param amount is not a number.
422 plugixa_carwash_invalid_amount amount is zero (“Enter an amount.”) or would take the balance below zero.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share