# Returns

> Preview: record a return linked to the original sale by your receipt id, so points are reversed.

Source: https://developers.loyx.se/preview/returns/

**Preview: this feature is planned and not live. The shape may change. Do not build against it yet.**

:::caution[Preview — not live, shape may change]
This feature is planned. Nothing on this page can be called yet.
:::

When goods come back, tell LoyX which receipt they came from. LoyX finds the original sale by **your own receipt id** (the `external_transaction_id` you sent with it) and reverses what that sale earned on the returned lines.

## Rules

- **Link by your receipt id.** The original may be from another store of the same brand.
- **The member comes from the original.** You do not have to identify the customer again.
- **Partial and repeated returns work.** Each reverses only its own lines, net of their discounts, and never more than the original paid.
- **Never send a negative sale.** Send a return instead.
- **A return that arrives before its sale waits.** If the original is not in LoyX yet, the return is kept as "awaiting original" and linked when the sale arrives. It is not closed with nothing reversed.
- **Returns without a reference** are stored but reverse nothing; the brand can review them.
- **Points are reversed after the return**, like earning. Read the card or listen for the event.
- **Used rewards stay used** by default. The brand can choose to restore them.
- A whole-receipt cancellation is a return of every line.

## Planned shape

```
POST /v1/returns
{
  "context": { "store": { "external_store_id": "store12" }, "receipt_id": "store12-reg3-000187", "occurred_at": "...", "currency": "SEK" },
  "original": { "receipt_id": "store12-reg3-000123" },
  "kind": "return",
  "lines": [ { "product": { "till_product_id": "SKU-1001" }, "quantity": { "value": 1, "unit": "ea" }, "refund_minor": 4500 } ]
}
```

The answer says whether the return is `linked`, `awaiting_original` or `unlinked`. The return's own receipt id is its duplicate key, the same way sales work today.

## Events

`return.recorded`, `return.linked` and `points.reversed`. See [Webhooks](/preview/webhooks/).
