Consumptions

Recording your members' purchases so they earn points, by client code or by email.

A consumption is the record of a purchase. It is what triggers the point calculation: every time a member buys, your system tells Loybox and Loybox adds the points that apply.

It is the minimum integration of a loyalty program. If you are only going to call one endpoint in this whole API, it is one of these two.

The two endpoints

They do the same thing and differ only in how they identify the member:

By codeBy email
Identifies the member withTheir client_codeTheir email
If the member does not existReturns 404Records the consumption anyway and invites them by email
When to use itA point of sale or app where the member gives their codeAn online checkout, where you already have the email

How many points it earns

The call does not decide that: the commerce's configuration does. You send the purchase amount and Loybox applies the money-per-point rule, double points if they are running, and the member's tier bonus, in that order.

The formula and the order of the multipliers are in Technical reference.

The amount is an integer

The amount field is an integer: whole units of the commerce's currency, no decimals. A purchase of 1,750.50 is sent as 1750.

Credential

Both endpoints go from your server, with the commerce API key:

Authorization: Bearer {api-key}