Introduction

The Loyalty Transactions API allows you to query transactions related to account activity.

Transaction are created by Loyalty accounts performing various actions:

  • Earning points by making purchases.
  • Redeeming points by getting rewards.
  • On points adjustment.
  • When points are refunded for a previously redeemed reward.
  • When points expire.

Note: You can't create transactions, only retrieve them. Transactions are read-only.

Did this help?

Loyalty Transaction Object


Loyalty transaction.

Properties
idstringformat GUID

Transaction ID.


accountIdstringformat GUID

Account ID.


createdDatestringRead-onlyformat date-time

Date and time the transaction was created.


amountinteger

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

transactionTypestring

Transaction types.


descriptionstringmaxLength 100

Transaction description.


idempotencyKeystringmaxLength 128

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.


ONE OF:

earnInfoEarnInfo

Information on points earned.


redeemInfoRedeemInfo

Information on points redeemed.


adjustInfoAdjustInfo

Information on points adjusted.


refundInfoRefundInfo

Information on points refunded.


expireInfoExpireInfo

Information on points expired.

Did this help?

GET

Get Loyalty Transaction


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 transaction.

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://manage.wix.com/_api/loyalty-transactions/v1/loyalty-transactions/{loyaltyTransactionId}

Path Params
loyaltyTransactionIdstringRequired

ID of the loyalty transaction to be retrieved.

Response Object
loyaltyTransactionLoyaltyTransaction

Requested Loyalty Transaction object.

Get loyalty transaction
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-transactions/v1/loyalty-transactions/18ddc2a5-248b-47ac-8ec0-603550f1f6b9' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "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 } } }
Did this help?

POST

Query Loyalty Transactions


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 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.

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://manage.wix.com/_api/loyalty-transactions/v1/loyalty-transactions/query

Body Params
queryQuery

Loyalty transaction query parameters.

Response Object
loyaltyTransactionsArray <LoyaltyTransaction>

List of loyalty transactions.


pagingMetadataPagingMetadata

Paging metadata.

Query loyalty transactions
Request
cURL
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" } } } }'
Response
JSON
{ "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 } }
Did this help?