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

# Redeem Voucher

> Deduct balance from a voucher

Use this endpoint to redeem a voucher during checkout. This deducts the specified amount from the voucher balance.

<ParamField header="Authorization" type="string" required>
  Bearer token with `marketing:write` scope
</ParamField>

<ParamField path="id" type="string" required>
  The voucher ID
</ParamField>

## Request body

<ParamField body="amount_minor" type="integer" required>
  Amount to deduct in minor units (must not exceed current balance)
</ParamField>

<ParamField body="booking_id" type="string">
  The booking ID where the voucher was applied
</ParamField>

<ParamField body="customer_id" type="string">
  The customer ID who redeemed the voucher
</ParamField>

<ParamField body="description" type="string">
  Description for the transaction record
</ParamField>

## Response

Returns the transaction record and updated voucher details.

```bash Request theme={null}
curl -X POST "https://api.voyantcloud.com/v1/vouchers/voucher_abc123/redeem" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_minor": 5000,
    "booking_id": "booking_789",
    "customer_id": "cust_456",
    "description": "Payment for Booking #789"
  }'
```

```json Response theme={null}
{
  "data": {
    "transaction": {
      "id": "txn_xyz",
      "workspaceId": "ws_xyz",
      "voucherId": "voucher_abc123",
      "type": "redemption",
      "amountMinor": -5000,
      "balanceAfterMinor": 2500,
      "currency": "EUR",
      "bookingId": "booking_789",
      "customerId": "cust_456",
      "description": "Payment for Booking #789",
      "createdAt": "2024-07-20T14:30:00Z"
    },
    "voucher": {
      "id": "voucher_abc123",
      "code": "GC1A2B3C4D",
      "previous_balance_minor": 7500,
      "new_balance_minor": 2500,
      "status": "active"
    }
  }
}
```

## Errors

| Status | Error                | Description                              |
| ------ | -------------------- | ---------------------------------------- |
| 400    | Voucher is {status}  | Voucher is not active                    |
| 400    | Insufficient balance | Requested amount exceeds current balance |
| 404    | Voucher not found    | No voucher exists with the given ID      |

<Note>
  When the voucher balance reaches zero, its status automatically changes to `depleted`.
</Note>
