This recipe explains how to leverage the Snag API to fetch loyalty points balances for your users, which can be used to build features like a leaderboard in your application.
GET /api/loyalty/accounts
endpoint enables you to fetch loyalty points balances for your users, which can be used to build features like a leaderboard in your application. With sorting and pagination options, the endpoint allows you to manage large datasets and customize the display order, making it easy to highlight the top users based on their points. Below is an example and detailed instructions for constructing a leaderboard.
GET /api/loyalty/accounts
endpoint allows for fetching of loyalty points balances for your users.
This endpoints provides various filters to allow sorting, pagination and other filters.
loyaltyCurrencyId
filter to query for the specific currency you wish to target.GET /api/loyalty/accounts
endpoint supports various query parameters that allow you to retrieve and manage data efficiently:
startingAfter
property to subsequent requests.