Adjusts the point balance of a loyalty account.
You can adjust the balance in two ways:
balance
allows you to set the total points balance to this new amount.amount
allows you to adjust the points balance by this amount. This amount can be a positive number to increase the points balance or a negative number to decrease the balance.An account may not be adjusted to result in a negative balance. If you pass an integer in both the balance
and the amount
parameters then the balance
adjustment takes effect and the
amount
adjustment is ignored.
You can only call this method when authenticated as a Wix app or Wix user identity.
Loyalty account ID.
Description to explain the reason for the points adjustment.
Each time the loyalty account is updated, revision
increments by 1.
The current revision
must be passed when adjusting points in the loyalty account. This
ensures you're working with the latest version of the loyalty account and prevents unintended overwrites.
Sets the account's point balance to this amount. Must be a positive, whole number or zero.
The net difference between this new balance and the previous balance will be reflected in the adjusted
field of the customer's account.
Min: 0
Max: 999999999
Adjusts the account's point balance by this amount. Must be a whole number with a maximum of 7 digits.
The amount can be negative, but cannot be 0
.
Min: -9999999
Max: 9999999
Loyalty account.
Transaction ID associated with the points adjustment.
curl -X POST \
'https://www.wixapis.com/loyalty-accounts/v1/accounts/e6f39a5b-a6d0-4556-b889-0cf09d8a84f7/adjust-points' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-raw '{
"accountId": "01e34b81-4e48-43e4-b178-c84f3b968574",
"description": "Sync from external program",
"balance": 15,
"revision": "3"
}'
{
"transactionId": "9d29cf95-fd2c-4db4-8f4d-2d65c52cacb9",
"account": {
"id": "e6f39a5b-a6d0-4556-b889-0cf09d8a84f7",
"contactId": "88615e02-3e8a-4297-8939-5d0a432b322a",
"memberId": "a517751b-a1ca-4423-8d91-aaf8f5b34215",
"points": {
"balance": 15,
"earned": 10,
"redeemed": 0,
"adjusted": 5
},
"rewardAvailable": true,
"createdDate": "2021-12-06T14:33:19.114Z",
"updatedDate": "2021-12-07T07:30:23.749Z",
"revision": "4",
"tier": {
"id": "1415f107-640c-4e04-870f-149cdd562093",
"updatedDate": "2021-12-07T07:30:23.749Z",
"recalculationDate": null,
"points": 15
},
"lastActivityDate": "2021-12-07T07:30:23.749Z",
"contact": {
"id": "7728152f-7deb-45f8-913f-7fdff4abbebe",
"name": "Johna Linskey",
"picture": null,
"email": "johna.linskey@yopmail.com",
"displayName": "Johna Linskey"
},
"points_expiration": {
"expiration_date": "2022-05-07T07:30:23.749Z",
"expiring_points_amount": 5
}
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.