Skip to main content

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. companyName is required, and the customer can have invoicing details such as siret or intraCommunityVAT.

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.

  • hasSubscribedToLoyaltyProgram says whether the customer takes part. loyalty.points gives their current balance.
  • Each change of the balance is a LoyaltyActivity: GAIN adds points, LOSS removes points, RESET sets the balance.

Rewards and vouchers​

  • A Reward is what the program offers: a free product (OFFERED_PRODUCT) or a discount (DISCOUNT), usually unlocked with a number of points (pointsToUnlock).
  • A Voucher is a reward given to one customer. Its status is LOCKED (not unlocked yet), UNLOCKED (ready to use) or USED. A customer's vouchers are in lockedVouchers and unlockedVouchers.