Skip to content

Adjust a balance

POST /customers/{customer_id}/points/adjust
Scopepoints:write
Customer session tokenNot accepted: call from your server with an API key
Rate limit classwrite (limits)
Idempotency keyRequired (idempotency)
MCP toolcharm_adjust_points

Applies a signed correction. Unlike earn there is no natural idempotency key, so the Idempotency-Key header is the only thing preventing a retry from applying twice. delta and reason may also be sent as query parameters, for no-code clients (a Gorgias action button, say) whose only way to collect a value from a human is the query string; the body wins when both are present, and the query string is part of the idempotency hash.

NameInTypeDescription
customer_idpathstringShopify customer GID (percent-encoded, e.g. gid%3A%2F%2Fshopify%2FCustomer%2F123) or the numeric customer id.
delta (optional)queryintegerAlternative to the body field of the same name.
reason (optional)querystringAlternative to the body field of the same name.
FieldTypeDescription
deltaintegerSigned change; negative values deduct. Must be non-zero and within the safe integer range. A deduction larger than the balance is clamped, and the response reports both requested and applied.
reasonstringShown verbatim in the customer’s history. (optional)

Returns AdjustResult.

FieldTypeDescription
changedboolean
requestednumber
appliednumberWhat actually landed; differs from requested when a negative delta is clamped at zero.
balance_afternumber or null(nullable)
balanceBalance
{
"changed": true,
"requested": 120,
"applied": 120,
"balance_after": 120,
"balance": {
"id": "gid://shopify/Customer/7712345",
"legacy_id": 7712345,
"points_balance": 120,
"points_earned": 120,
"points_redeemed": 120,
"pending_points": 120
}
}
Terminal window
curl -X POST "https://charm.appfleece.app/api/v1/customers/7712345/points/adjust" \
-H "Authorization: Bearer chrm_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"delta":1,"reason":"Goodwill after a late delivery"}'

unauthorized · invalid_token · insufficient_scope · access_required · not_found · validation_error · rate_limited · idempotency_conflict

Every error body carries code, message, request_id and a doc_url pointing at the matching entry in the error catalog.