Skip to content

Deduct points

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

Removes points. The balance is clamped at zero rather than going negative.

NameInTypeDescription
customer_idpathstringShopify customer GID (percent-encoded, e.g. gid%3A%2F%2Fshopify%2FCustomer%2F123) or the numeric customer id.
FieldTypeDescription
pointsinteger
reasonstring(optional)
source_refstring(optional)

Returns DeductResult.

FieldTypeDescription
changedboolean
requestednumber
appliednumber
points_deductednumberSame as applied. Kept for existing integrations.
balance_afternumber or null(nullable)
balanceBalance
{
"changed": true,
"requested": 120,
"applied": 120,
"points_deducted": 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/deduct" \
-H "Authorization: Bearer chrm_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"points":120}'

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

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