Contents
On this page
Adjust Store Credit - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/store-credit/{customer_id}/adjust
Give or take store credit by hand. The change is written to the ledger and the audit log.
Needs a user with the plugixa_pos_manage_settings capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators hold it; other roles only when you grant it.
Request
POST https://your-site.example/wp-json/plugixa-pos/v1/store-credit/88/adjust
Path parameters
| Name | Type | Description |
|---|---|---|
customer_id |
integer |
The customer’s user id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
amount |
string |
Yes | Decimal, may be negative. |
note |
string |
Yes | Why, 1 to 200 characters. |
{
"amount": "10.00",
"note": "Returned a gift"
}
Responses
200 OK. data is the history, as in Get Store Credit History.
{
"success": true,
"data": {
"customer_id": 88,
"balance": "35.00",
"ledger": [
{
"type": "adjust",
"amount": "25.00",
"balance_after": "25.00",
"order_id": null,
"note": "Returned a gift",
"user": "admin",
"created_at": "2026-11-16 15:55:29"
}
]
}
}
Errors
| Status | Code | When |
|---|---|---|
409 |
plugixa_pos_credit_balance |
Taking more than the customer holds. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/store-credit/88/adjust" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"amount":"10.00","note":"Returned a gift"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/store-credit/88/adjust');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'amount' => '10.00',
'note' => 'Returned a gift',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/store-credit/88/adjust', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ amount: '10.00', note: 'Returned a gift' }),
});
const { data } = await response.json();
Quick Links
Share