Loyalty GraphQL
Product page
Loyalty & Rewards Suite — kowal.co
Description
A storefront can retrieve the signed-in customer’s loyalty summary, recent history and wallet in a single GraphQL query.
For whom
For developers building a loyalty account screen in a headless storefront.
Features
- Select the summary fields required by the screen.
- Limit recent transactions with history_limit.
- Request wallet titles and asset types alongside the balance.
Installation
This component is included in Loyalty & Rewards Suite. Follow the suite installation instructions.
Configuration
- Authenticate as a test customer and send the customer bearer token with the request to
/graphql. - Call
kowalLoyaltyCustomerwith the numeric store_id. Set history_limit to the number of recent transactions needed; its default is 20. - For a balance screen, request available_points and pending_points from summary. Add history or wallet when the screen needs them.
Requirements / notes
Customer identity comes from the authenticated request. The store_id argument selects the store context for loyalty data.
FAQ
Why does the query ask for customer authentication?
The resolver needs a signed-in customer to identify whose account to read. Use the token for the test participant.
Verify the installation
bin/magento module:status Kowal_LoyaltyGraphQl
For store ID 1, try { kowalLoyaltyCustomer(store_id: 1, history_limit: 3) { summary { available_points pending_points } history { amount status } } }. Substitute your store ID and compare the result with that customer’s loyalty account.