# Redeem a benefit (https://docs.loybox.com.ar/en/api-reference/beneficios/canjear)



<Endpoint method="POST" path="/v1/benefits/redeem" auth="api-key" />

Redeems the benefit using the code the member holds. It is the last step of the
flow: from here on the code is burned and cannot be used again.

<Callout type="warn" title="There is no going back">
  Call this endpoint only once the sale is closed and the discount applied. If you
  call it earlier and the sale falls through, the member loses the reward and there
  is no way to give it back over the API.

  To see which reward it is without burning it, use
  [look up a code](https://docs.loybox.com.ar/api-reference/beneficios/consultar-codigo).
</Callout>

## Body
<Fields>
  <Field name="client_benefit_code" type="integer" required="true">
    The redemption code the member holds.
  </Field>
</Fields>

## Example
```bash
curl -X POST https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/benefits/redeem \
  -H "Authorization: Bearer $LOYBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "client_benefit_code": 887766
  }'
```

```json
// 200 OK
{
  "message": "Benefit redeemed successfully"
}
```

## Errors
| Code  | When                                           |
| ----- | ---------------------------------------------- |
| `400` | The benefit was already used.                  |
| `404` | The benefit does not exist.                    |
| `422` | The field is missing, or it is not an integer. |

<Callout type="info" title="The 400 is the case to cover in your UI">
  It is what happens when someone tries to use the same code twice. It is not a bug
  in your integration: it is worth showing whoever is at the counter a clear "this
  code was already used" message instead of a generic error.
</Callout>
