Customers and loyalty
A shop keeps its customers, and can run a loyalty program: customers earn points, and unlock rewards with them. This page explains how these entities fit together. Every field is described in the GraphQL schema.
Customers
A Customer is a customer of a shop, of one of two kinds (kind):
CONSUMER: a private individual.BUSINESS: a company.companyNameis required, and the customer can have invoicing details such assiretorintraCommunityVAT.
A customer has contact details (email, phoneNumber…), addresses (locations, with a default billing and delivery address), and can have a price list (price).
The API can create, update, archive and unarchive customers (createCustomer, updateCustomer, archiveCustomer, unarchiveCustomer). Unlike most lists, customers returns archived customers too: add filterBy: { archived: EXCLUDED } to hide them.
Loyalty program
The loyalty program is read-only in the API.
hasSubscribedToLoyaltyProgramsays whether the customer takes part.loyalty.pointsgives their current balance.- Each change of the balance is a
LoyaltyActivity:GAINadds points,LOSSremoves points,RESETsets the balance.
Rewards and vouchers
- A
Rewardis what the program offers: a free product (OFFERED_PRODUCT) or a discount (DISCOUNT), usually unlocked with a number of points (pointsToUnlock). - A
Voucheris a reward given to one customer. ItsstatusisLOCKED(not unlocked yet),UNLOCKED(ready to use) orUSED. A customer's vouchers are inlockedVouchersandunlockedVouchers.