About Loyalty Accounts

The loyalty accounts API allows a site owner to create and manage its customers' loyalty accounts. The loyalty accounts maintain a customer's balance of loyalty points.

With the loyalty accounts API, you can:

  • Create a new loyalty account.
  • Adjust the balance of a loyalty account.
  • Earn points to a loyalty account.
  • Retrieve loyalty accounts.
  • Handle webhooks when an account is updated or adjusted.

Note: Before loyalty accounts can be created, the site's loyalty program must be active. See the activate loyalty program endpoint to learn how to activate the loyalty program using the API.

Did this help?

Accounts: Supported Filters and Sorting

The following table shows field support for filters and sorting for the Account object:

FieldQuery Filter OperatorsSortable
id$eq, $ne, $hasSome, $startsWith, $in, $nin, $existsSortable
contactId$eq, $ne, $hasSome, $startsWith, $in, $nin, $existsSortable
memberId$eq, $ne, $hasSome, $startsWith, $in, $nin, $existsSortable
tier.id$eq, $ne, $hasSome, $startsWith, $in, $nin, $existsSortable
points.balance$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
points.earned$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
points.adjusted$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
points.redeemed$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
points.expired$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
createdDate$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
lastActivityDate$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
pointsExpiration.expirationDate$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
pointsExpiration.expiringPointsAmount$eq, $ne, $hasSome, $in, $nin, $exists, $lt, $lte, $gt, $gteSortable
Did this help?

Account Object


A loyalty account stores a customer's loyalty points balance. A site's customers can earn points to their account and redeem those points for rewards.

Properties
idstringRead-onlyformat GUID

Account ID.


contactIdstringRead-onlyformat GUID

Account owner's contact ID. See the Contacts API to learn more about a site's contacts.


memberIdstringRead-onlyformat GUID

Account owner's member ID. See the Members API to learn more about a site's members.


pointsPointsRead-only

Information about the account totals.


rewardAvailablebooleanRead-only

Whether the account has a reward available. true if the amount of points in points.balance are enough to redeem for a reward.


createdDatestringRead-onlyformat date-time

Date and time the account was created.


updatedDatestringRead-onlyformat date-time

Date and time the account was last updated.


lastActivityDatestringRead-onlyformat date-time

Account's last activity date and time.


revisionnumber

Revision number, which increments by 1 each time the loyalty account is updated.

To prevent conflicting changes, the current revision must be passed when updating the loyalty account.

Ignored when creating an account.


tierTierRead-only

Tier information.


contactContactRead-only

Contact information.


pointsExpirationPointsExpirationRead-only

Points expiration information

LoyaltyAccount
JSON
{ "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 } } }
Did this help?

GET

List Accounts


Deprecated

This method has been replaced with Query Loyalty Accounts, and will be removed on June 1, 2025.

Deprecation Notice

This method has been replaced with Query Loyalty Accounts and will be removed on June 30, 2025. If your app uses this method, we recommend updating your code as soon as possible.

Retrieves a list of accounts, given the provided filters.

You can retrieve selected loyalty accounts with an array of contactIds or retrieve a list of all of a site's loyalty accounts with an empty request parameter. Use the cursorPaging parameters to limit how many items load at a time.

Deprecated endpoint, please use QueryLoyaltyAccounts or SearchAccounts instead.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/loyalty-accounts/v1/accounts

Query Params
contactIdsArray <string>

List of contact IDs. See the Contacts API to learn more.


cursorPaging.limitintegerminimum 0maximum 100format int32

Maximum number of items to return in the results.


cursorPaging.cursorstringmaxLength 16000

Pointer to the next or previous page in the list of results.

Pass the relevant cursor token from the pagingMetadata object in the previous call's response. Not relevant for the first request.

Response Object
accountsArray <LoyaltyAccount>

Loyalty accounts.


pagingMetadataPagingMetadata

Details on the paged set of results returned.

Get a list of accounts, filtered by contact ids
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts?contactIds[]=88615e02-3e8a-4297-8939-5d0a432b322a&contactIds[]=fb8f125e-bfc3-4d9a-80c2-215494f24731' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "accounts": [ { "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 } }, { "id": "73618276-35cc-4d21-8380-bdd2fbebf781", "contactId": "fb8f125e-bfc3-4d9a-80c2-215494f24731", "memberId": "ddd5302e-23cf-4fd6-bf6b-461aaae3ab7d", "points": { "balance": 25, "earned": 30, "redeemed": 5, "adjusted": 0 }, "rewardAvailable": true, "createdDate": "2021-12-06T14:33:19.114Z", "updatedDate": "2021-12-07T07:30:23.749Z", "revision": "4", "tier": { "id": null, "updatedDate": "2021-12-07T07:30:23.749Z", "recalculationDate": null, "points": 30 }, "lastActivityDate": "2021-12-07T07:30:23.749Z", "contact": { "id": "7728152f-7deb-45f8-913f-7fdff4abbebe", "name": "Aigneis Johnsson", "picture": null, "email": "aigneis.johnsson@yopmail.com", "displayName": "Aigneis Johnsson" }, "points_expiration": { "expiration_date": "2022-05-07T07:30:23.749Z", "expiring_points_amount": 5 } } ], "pagingMetadata": { "count": 2, "offset": null, "total": 2, "tooManyToCount": null, "cursors": { "next": null, "prev": null } } }
Did this help?

POST

Create Account


Creates a loyalty account for one of a site's contacts.

To create a new loyalty account, the customer must first be a site contact with a contact ID. See the Contacts API to learn more about a site's contacts. The site must also have an active loyalty program before loyalty accounts can be created. See the activate loyalty program endpoint to activate a site's loyalty program.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts

Body Params
contactIdstringRequiredformat GUID

Contact ID for a Wix site contact. See the Contacts API to learn more about a site's contacts.

Response Object
accountAccount

Loyalty account.

Create an account for the contact
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ --data-raw '{ "contactId": "88615e02-3e8a-4297-8939-5d0a432b322a" }'
Response
JSON
{ "account": { "id": "e6f39a5b-a6d0-4556-b889-0cf09d8a84f7", "contactId": "88615e02-3e8a-4297-8939-5d0a432b322a", "memberId": "3c7267de-204d-4f6c-b5a5-5d060bc3b21c", "points": { "balance": 0, "earned": 0, "redeemed": 0, "adjusted": 0 }, "rewardAvailable": false, "createdDate": "2021-12-06T14:33:19.114Z", "updatedDate": "2021-12-06T14:33:19.114Z", "revision": "1", "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": null } }
Event TriggersThis method triggers the following events:
Did this help?

POST

Earn Points


Adds points to a loyalty account.

Only a positive amount can be added using the earn points endpoint. To adjust an account's balance for a negative amount, use Adjust Points.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts/{accountId}/earn-points

Path Params
accountIdstringRequired

Loyalty account ID.

Body Params
amountintegerminimum 1maximum 9999999

Amount of points to earn. Must be a positive, whole number.

Min: 1

Max: 9999999


descriptionstringminLength 1maxLength 100

Description of how the points were earned.

Max: 100 characters


appIdstringRequiredminLength 1maxLength 100

ID of the app that initiated the transaction.

If points were earned manually, then the appId is the Loyalty app's wixAppId of 553c79f3-5625-4f38-b14b-ef7c0d1e87df. If points were earned in an automatic event, then the appId is from that automation's sourceAppId.


idempotencyKeystringRequiredminLength 1maxLength 256

Unique string identifier generated by the app. Wix uses this identifier to recognize subsequent retries of the same request.

Please use GUID format.


activityTypestringmaxLength 100

Activity type.

If points were earned through automation it should be set to trigger key.


orderIdstringmaxLength 512

Order id which was source of this transaction.


followedSocialMediaFollowedSocialMedia

Followed social media details.

Response Object
accountAccount

Updated loyalty account.


transactionIdstringformat GUID

Transaction ID associated with the points earned.

Add points to account
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/e6f39a5b-a6d0-4556-b889-0cf09d8a84f7/earn-points' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ --data-raw '{ "accountId": "e6f39a5b-a6d0-4556-b889-0cf09d8a84f7", "amount": 10, "description": "For subscribing to the newsletter", "appId": "db9c3016-ff93-4105-bdef-ff852f3c74c0", "idempotencyKey": "baa05589-20d1-45db-ba29-99920bccf37e" }'
Response
JSON
{ "transactionId": "262c8eb0-123e-4117-9fe6-4973a3551688", "account": { "id": "e6f39a5b-a6d0-4556-b889-0cf09d8a84f7", "contactId": "88615e02-3e8a-4297-8939-5d0a432b322a", "memberId": "a517751b-a1ca-4423-8d91-aaf8f5b34215", "points": { "balance": 10, "earned": 10, "redeemed": 0, "adjusted": 0 }, "rewardAvailable": false, "createdDate": "2021-12-06T14:33:19.114Z", "updatedDate": "2021-12-07T07:26:56.417Z", "revision": "2", "tier": { "id": "1415f107-640c-4e04-870f-149cdd562093", "updated_date": "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 } } }
Event TriggersThis method triggers the following events:
Did this help?

POST

Adjust Points


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts/{accountId}/adjust-points

Path Params
accountIdstringRequired

Loyalty account ID.

Body Params
descriptionstringminLength 1maxLength 100

Description to explain the reason for the points adjustment.


revisionnumberminimum 1

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.


ONE OF:

balanceintegerminimum 0maximum 999999999

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


amountintegerminimum -9999999maximum 9999999

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

Response Object
accountAccount

Loyalty account.


transactionIdstringformat GUID

Transaction ID associated with the points adjustment.

Adjust account balance
Request
cURL
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" }'
Response
JSON
{ "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 } } }
Event TriggersThis method triggers the following events:
Did this help?

GET

Get Account


Retrieves an account using the loyalty account ID.

You can also retrieve an account using a secondary ID, such as a contact ID or a member ID by using the Get Account by Secondary ID endpoint.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/loyalty-accounts/v1/accounts/{id}

Path Params
idstringRequired

ID of the account to retrieve.

Response Object
accountAccount

Loyalty account.

Get an account
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/e6f39a5b-a6d0-4556-b889-0cf09d8a84f7' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "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 } } }
Did this help?

POST

Query Loyalty Accounts


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of loyalty accounts, given the provided paging, filtering, and sorting. Query Loyalty Accounts runs with these defaults, which you can override:

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts/query

Body Params
queryQueryRequired

Filter object. See API Query Language for more information.

Response Object
loyaltyAccountsArray <LoyaltyAccount>

Loyalty accounts.


pagingMetadataPagingMetadata

Paging metadata

Query Accounts by ID
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/query' \ -H 'Authorization: <AUTH>' -H 'Content-Type: application/json' \ -d '{ "query": { "filter": { "id": { "$eq": "e6f39a5b-a6d0-4556-b889-0cf09d8a84f7" } } } }'
Response
JSON
{ "accounts": [ { "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" }, "pointsExpiration": { "expirationDate": "2022-05-07T07:30:23.749Z", "expiringPointsAmount": 5 } } ], "pagingMetadata": { "count": 2, "offset": null, "total": 6, "tooManyToCount": null, "cursors": { "next": "Gh0KDnBvaW50cy5iYWxhbmMlEAEaCREAAAAJJIBhQBorCgxfdXBkYXRlZERhdGUaGyoZChcKCiR0aW1lc3RhbXASCREA4GzcPdl3QiIkYjRkYzAyMzUtMjg2OS00MThjLWJjODQtNDMwNjUxMmMzYjhl", "prev": null } } }
Did this help?

GET

Get Program Totals


Retrieves the total amount of points earned, redeemed, and adjusted for the entire loyalty program.

The balance is the current total of points outstanding, while the earned, adjusted, and redeemed amounts are the historically accumulated amounts. The totals include the amounts for all loyalty accounts.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/loyalty-accounts/v1/accounts/program-totals

Request
This endpoint does not take any parameters.
Response Object
pointsPoints

Point totals for the entire program.


tierTotalsArray <TierTotal>

Tier total for the entire program.

Get the program totals
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/program-totals' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "points": { "balance": 165, "earned": 136, "redeemed": 0, "adjusted": 29, "expired": 0 }, "tierTotals": [ { "numberOfAccounts": 5 }, { "id": "acddc0e0-5e27-4a1b-a52d-b3785ac258cb", "numberOfAccounts": 3 } ] }
Did this help?

GET

Get Current Member Account


Retrieves the currently logged-in member's account.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/loyalty-accounts/v1/accounts/my-account

Request
This endpoint does not take any parameters.
Response Object
accountAccount

Loyalty account.

Get currently logged-in member account
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/my-account' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "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 } } }
Did this help?

GET

Get Account By Secondary Id


Retrieves the account belonging to the specified contact or member.

This endpoint retrieves loyalty accounts using either a customer's contact ID or member ID. Your app can also retrieve an account using the loyalty account ID by using the Get Account endpoint.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/loyalty-accounts/v1/accounts/fetch-by

Request
This endpoint does not take any parameters.
Response Object
accountAccount

Loyalty account.

Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/fetch-by?contactId=88615e02-3e8a-4297-8939-5d0a432b322a' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "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 } } }
Did this help?

POST

Search Accounts


Retrieves a list of accounts, given the provided filters and search capabilities. Search is executed on the account's name and email values.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts/search

Body Params
searchSearch

Search options.

Response Object
accountsArray <LoyaltyAccount>

Found accounts.


pagingMetadataPagingMetadata

Paging metadata.


aggregationDataAggregationData

Aggregation data

Search accounts, given the provided filters
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/search' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "search": { "search": {"expression": "John"}, "cursor_paging": {"limit": 2} } }'
Response
JSON
{ "accounts": [ { "id": "0d1ce314-084a-4edd-a0c7-8a885c6248ba", "contactId": "f96d2d30-a267-41e8-832c-615fae1bfee3", "memberId": null, "points": { "balance": 573, "earned": 0, "redeemed": 0, "adjusted": 0 }, "rewardAvailable": true, "createdDate": "2023-10-06T11:09:01.443Z", "updatedDate": "2023-10-19T22:07:15.618Z", "revision": "14", "tier": { "id": "1415f107-640c-4e04-870f-149cdd562093", "updatedDate": "2021-12-07T07:30:23.749Z", "recalculationDate": null, "points": 15 }, "lastActivityDate": "2023-10-10T15:34:44.864Z", "contact": { "id": "f96d2d30-a267-41e8-832c-615fae1bfee3", "name": "Johna Linskey", "picture": null, "email": "johna.linskey@yopmail.com", "displayName": "Johna Linskey" }, "points_expiration": { "expiration_date": "2024-05-07T07:30:23.749Z", "expiring_points_amount": 5 } }, { "id": "19b378db-896d-480d-a75e-cb4e5b77bf26", "contactId": "63f477d4-a278-4a1d-8d4c-2a2786970f90", "memberId": null, "points": { "balance": 474, "earned": 0, "redeemed": 0, "adjusted": 0 }, "rewardAvailable": true, "createdDate": "2023-10-05T14:08:44.221Z", "updatedDate": "2023-10-19T22:06:23.608Z", "revision": "20", "tier": { "id": null, "updatedDate": "2021-12-07T07:30:23.749Z", "recalculationDate": null, "points": 30 }, "lastActivityDate": "2023-10-10T15:33:34.088Z", "contact": { "id": "63f477d4-a278-4a1d-8d4c-2a2786970f90", "name": "Aigneis Johnsson", "picture": null, "email": "aigneis.johnsson@yopmail.com", "displayName": "Aigneis Johnsson" }, "points_expiration": { "expiration_date": "2024-05-07T07:30:23.749Z", "expiring_points_amount": 5 } } ], "pagingMetadata": { "count": 2, "cursors": { "next": "19b378db-896d-480d-a75e-cb4e5b77bf26,1.0", "prev": null }, "hasNext": true }, "aggregationData": null }
Did this help?

POST

Count Accounts


Retrieves the count of found accounts, given the provided filters and search capabilities.

This endpoint can help find the total count of accounts when used alongside Search Accounts.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts/count

Body Params
filterstruct

Filter object.


searchSearch

Free text to match in searchable fields.

Response Object
countintegerminimum 0
Count accounts, given the provided filters
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-accounts/v1/accounts/count' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "search": {"expression": "John"}, "filter": {"points.balance": {"$gte": 50}} }'
Response
JSON
{ "count": 2 }
Did this help?

POST

Bulk Adjust Points


Updates points balance of multiple accounts. Depending on the BulkAdjustPointsRequest.type: amount - provided amount of points is appended to the accounts balance balance - accounts balance is set to the provided amount

Returns id of the asyncInfra job that takes care of the points adjustment.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/loyalty-accounts/v1/accounts/bulk-adjust

Body Params
searchSearch

ONE OF:

balanceintegerminimum 0maximum 999999999

amountintegerminimum -9999999maximum 9999999
Response Object
asyncJobIdstringformat GUID
Did this help?

Loyalty Account Created


Triggered when a loyalty account is created.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.account.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.account_created", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }
Did this help?

Points Updated


Triggered when the points of a loyalty account are adjusted, earned, or redeemed.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.account.


slugstring

Event name. Expected points_updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


actionEventActionEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.account_points_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

PointsUpdated
JSON
{ "id": "48b171b8-e2c1-46da-92ff-5ce4b173c751", "entityFqdn": "wix.loyalty.v1.account", "slug": "points_updated", "entityId": "2bdbac7d-b121-4191-84bf-a359b20bc8c6", "actionEvent": { "body": { "account": { "rewardAvailable": false, "revision": "3", "points": { "balance": 1, "earned": 0, "adjusted": 1, "redeemed": 0 }, "id": "fe0ca230-61a6-4ebf-9199-9c0d238619aa", "contactId": "87bbd811-f753-4de4-994d-69b24d22cb56", "memberId": "87bbd811-f753-4de4-994d-69b24d22cb56", "updatedDate": "2021-12-29T14:06:50.092Z", "createdDate": "2021-12-29T13:55:32.505Z", "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" } } } }, "eventTime": "2021-12-29T14:06:50.106622Z", "triggeredByAnonymizeRequest": false }
Did this help?

Account Reward Availability Updated


Triggered when rewardAvailable field is changed on Account.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.account.


slugstring

Event name. Expected reward_availability_updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


actionEventActionEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.account_reward_availability_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }
Did this help?

Loyalty Account Updated


Triggered when a loyalty account is updated, including when points are adjusted, earned, or redeemed.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.account.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.account_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }
Did this help?