Adjust loyalty points
Adds points to or subtracts points from a buyer's account.
Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call AccumulateLoyaltyPoints to add points when a buyer pays for the purchase.
Name | Description |
---|---|
account_
Required
|
The ID of the target loyalty account. |
Name | Description |
---|---|
idempotency_
Required
|
A unique string that identifies this |
adjust_
Required
|
The points to add or subtract and the reason for the adjustment. To add points, specify a positive integer. To subtract points, specify a negative integer. |
allow_
|
Indicates whether to allow a negative adjustment to result in a negative balance. If |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
event
|
The resulting event data for the adjustment. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/loyalty/accounts/5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd/adjust \
-X POST \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"adjust_points": {
"points": 10,
"reason": "Complimentary points"
},
"idempotency_key": "bc29a517-3dc9-450e-aa76-fae39ee849d1"
}'
{
"event": {
"id": "613a6fca-8d67-39d0-bad2-3b4bc45c8637",
"type": "ADJUST_POINTS",
"created_at": "2020-05-08T21:42:32Z",
"adjust_points": {
"loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd",
"points": 10,
"reason": "Complimentary points"
},
"loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
"source": "LOYALTY_API"
}
}