# Consumptions (https://docs.loybox.com.ar/en/api-reference/consumos)



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 code                                                  | By email                                                 |
| -------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| **Identifies the member with**   | Their `client_code`                                      | Their email                                              |
| **If the member does not exist** | Returns `404`                                            | Records the consumption anyway and invites them by email |
| **When to use it**               | A point of sale or app where the member gives their code | An online checkout, where you already have the email     |

<Cards>
  <Card title="Create consumption by code" icon="User" description="When the member identifies with their Loybox code." href="/api-reference/consumos/crear-por-codigo" />

  <Card title="Create consumption by email" icon="Mail" description="When you already have the email, even if the member is not registered." href="/api-reference/consumos/crear-por-email" />
</Cards>

## 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](https://docs.loybox.com.ar/referencia-tecnica#cálculo-de-puntos).

<Callout type="warn" title="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`.
</Callout>

## Credential
Both endpoints go from your server, with the
[commerce API key](https://docs.loybox.com.ar/api-reference/credenciales#api-key-del-comercio):

```
Authorization: Bearer {api-key}
```
