Loyalty Catalogue

Retrieves freebies available for a particular loyalty card. It first ensures that the provided loyalty card exists within the loyalty system. Then, it determines the pagination parameters for the request. Next, it fetches the freebies associated with the loyalty card, including related data such as vouchers, item groups, and freebie filter attribute option mappings, ordering them by worth. Pagination is applied to limit the number of results per page. The function maps over the retrieved freebies, determining each one's eligibility based on the user's loyalty points, if applicable. Finally, it returns a success response containing the formatted freebies ready for presentation to the user. This function streamlines the process of displaying available freebies associated with a specific loyalty card to users.

Language
Credentials
Header
Click Try It! to start a request and see the response here!