# Reserve and use rewards

> Preview: hold a member's reward for one basket, then commit it when paid or release it.

Source: https://developers.loyx.se/preview/hold-commit-release/

**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.
:::

Using a reward at the till takes two steps, so a coupon cannot be used twice while payment is in progress, and is not lost when a payment fails.

```
   hold ──► HELD ──► commit (paid) ──► COMMITTED  (reward used)
              │
              ├──► release (removed, voided, payment failed) ──► RELEASED (reward back)
              └──► time runs out ──► EXPIRED (reward back)
```

1. **Hold.** When the cashier adds a reward, hold it for this basket. While held, it cannot be used anywhere else: not in the app, not at another till. The member's app shows it as reserved.
2. **Commit.** When the sale is paid, commit the hold with your receipt id. The reward is used.
3. **Release.** If the reward is removed, the sale is voided or the payment fails, release the hold. The reward is available again.

## Rules

- **One hold per basket.** Your basket or cart id is the key. Holding again for the same basket replaces the set of rewards held.
- **Holds expire.** Default: 15 minutes in shops, 4 hours in restaurants. The brand can adjust it, up to 24 hours. An expired hold gives the reward back.
- **Late commit.** Committing an expired hold still works if the reward is still available. If it was used elsewhere in the meantime, the answer says so; the sale stands and the brand's policy decides.
- **The sale can commit for you.** A sale that names its hold commits it, so a lost commit call does not lose the redemption.
- **Committed is final.** To undo a used reward, record a [return](/preview/returns/) of the receipt. Release does not undo a commit.
- **Pending members** (joined by phone, not yet confirmed) cannot hold rewards.
- **No holds offline.** A till that is offline cannot reserve rewards.

## Planned shape

```
POST /v1/holds                    { context: { store, basket_id }, member_id, items: [{ reward_id }] }
POST /v1/holds/{hold_id}/commit   { context: { receipt_id } }
POST /v1/holds/{hold_id}/release  { reason: "item_removed" }
```

Expected refusal reasons include `held_elsewhere`, `hold_released`, `hold_committed`, `hold_expired` and `member_pending`, each with a short text that is safe to show the cashier.

## Events

`reward.held`, `reward.redeemed`, `reward.released` and `hold.expired`. See [Webhooks](/preview/webhooks/).
