The Loyalty Transactions API allows you to query transactions related to account activity.
Transaction are created by Loyalty accounts performing various actions:
Note: You can't create transactions, only retrieve them. Transactions are read-only.
Loyalty transaction.
Transaction ID.
Account ID.
Date and time the transaction was created.
The number of points earned, adjusted, redeemed, or expired in the transaction.
EARN
: Number of points earned by the customer taking an action. Example: 20
REDEEM
: The number of points redeemed by the customer for a reward. Example: -50
ADJUST
: The number of points refunded for a previously redeemed reward. Examples: 20
, -30
REFUND
: The number of points refunded for a previously redeemed reward. Example: 60
EXPIRE
: The number of points that expired due to customer inactivity for a configured period. Example: -70
Transaction types.
Transaction description.
Unique identifier, generated by the client. Used to recognize repeated attempts of the same request. Only present when manually adding points using the Earn Points endpoint.
Information on points earned.
Information on points redeemed.
Information on points adjusted.
Information on points refunded.
Information on points expired.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a transaction.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the loyalty transaction to be retrieved.
Requested Loyalty Transaction
object.
curl -X GET \
'https://www.wixapis.com/loyalty-transactions/v1/loyalty-transactions/18ddc2a5-248b-47ac-8ec0-603550f1f6b9' \
-H 'Authorization: <AUTH>'
{
"loyaltyTransaction": {
"id": "18ddc2a5-248b-47ac-8ec0-603550f1f6b9",
"accountId": "bf14421a-0ccb-4656-a91f-84119e8fc994",
"createdDate": "2024-02-15T11:32:26.076Z",
"amount": 50,
"transactionType": "EARN",
"description": "Sign up to the site",
"idempotencyKey": "ca243bcf-9f36-303e-a6b9-9168cb67a23e",
"earnInfo": {
"appId": "SiteMembers",
"activityType": "c138c707-029a-461b-a6b7-9ba796e61fca",
"orderId": null
}
}
}
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 transactions, given the provided paging, filtering, and sorting.
Supported fields for filtering and sorting:
id
, accountId
, idempotencyKey
, transactionType
, amount
, description
To learn how to query Loyalty Transactions, see API Query Language.
You can only call this method when authenticated as a Wix app or Wix user identity.
Loyalty transaction query parameters.
List of loyalty transactions.
Paging metadata.
curl -X POST \
'https://www.wixapis.com/loyalty-transactions/v1/loyalty-transactions/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-binary '{
"query": {
"filter": {
"transactionType": {
"$eq": "EARN"
}
}
}
}'
{
"loyaltyTransactions": [
{
"id": "18ddc2a5-248b-47ac-8ec0-603550f1f6b9",
"accountId": "bf14421a-0ccb-4656-a91f-84119e8fc994",
"createdDate": "2024-02-15T11:32:26.076Z",
"amount": 50,
"transactionType": "EARN",
"earnInfo": {
"appId": "SiteMembers",
"activityType": "c138c707-029a-461b-a6b7-9ba796e61fca"
},
"description": "Sign up to the site",
"idempotencyKey": "ca243bcf-9f36-303e-a6b9-9168cb67a23e"
},
{
"id": "4d5085b9-1ba4-459b-b93a-e6691a8f117e",
"accountId": "378ba51f-e6d5-4ea2-8187-5907721a33b4",
"createdDate": "2024-02-23T09:51:55.677Z",
"amount": 50,
"transactionType": "EARN",
"earnInfo": {
"appId": "SiteMembers",
"activityType": "c138c707-029a-461b-a6b7-9ba796e61fca"
},
"description": "Sign up to the site",
"idempotencyKey": "911271c3-d383-3296-9d1a-195cff81610b"
}
],
"pagingMetadata": {
"count": 2,
"cursors": {},
"hasNext": false
}
}