> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lekalao.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sales

> Report what your e-mails earn, so each campaign shows its revenue.

When a customer buys, your shop tells Lekalao. Lekalao credits the sale to the last e-mail that could have caused it, and the campaign's [statistics](/campaigns/statistics) show its revenue.

## Report a sale

```bash theme={null}
curl -X POST https://lekalao.example.com/api/v1/conversions \
  -H "Authorization: Bearer $LEKALAO_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "email": "ada@example.com",
    "amount": 12500,
    "currency": "XAF",
    "reference": "order-2026-00481",
    "occurred_at": "2026-09-17T10:14:00+01:00",
    "meta": { "channel": "online-shop" }
  }'
```

| Field         |                                                                                             |
| ------------- | ------------------------------------------------------------------------------------------- |
| `email`       | The buyer. Required.                                                                        |
| `list`        | A list's `id`, when the same address is on several. Otherwise the most recent subscription. |
| `amount`      | An integer, in the smallest unit: `1250` is 12.50 €, `12500` is 12,500 FCFA.                |
| `currency`    | A three-letter code: `XAF`, `EUR`, `USD`…                                                   |
| `reference`   | Your own order number. **The same reference never counts twice.**                           |
| `occurred_at` | When the sale happened. Now, by default.                                                    |
| `meta`        | A free object, kept as it is.                                                               |

Answer:

```json theme={null}
{
    "data": {
        "id": "a7f2…",
        "amount": 12500,
        "currency": "XAF",
        "reference": "order-2026-00481",
        "campaign": "0c9e3f5a-…",
        "attributed": true,
        "occurred_at": "2026-09-17T09:14:00+00:00"
    }
}
```

`201` for a new sale; `200` when the `reference` already existed and the sale was updated. `404` when the address is on no list.

## How a sale is credited

Among the e-mails sent to that person **in the 14 days before the sale** (the installation can change the window) and which they **opened or clicked**, Lekalao takes:

1. the one with the most clicks;
2. on a tie, the most recent one.

Campaigns and automation e-mails both count, A/B variants included. With no e-mail that fits, the sale is recorded with `"attributed": false` and counts for no campaign.

## Refunds

```bash theme={null}
curl -X DELETE https://lekalao.example.com/api/v1/conversions/a7f2… \
  -H "Authorization: Bearer $LEKALAO_TOKEN" -H "Accept: application/json"
```

The sale leaves the figures. For a partial refund, report the same `reference` again with the new amount.

## Good habits

* Report the sale **once it is paid**, from the server, not from the thank-you page a customer can reload.
* **Always** send a `reference`: repeats and duplicates then inflate nothing.
* Keep one currency per team if you want totals that read well.
