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

# Redeem Voucher

> Set the payment terms for a reserved voucher — creates a SIMPLE or CUSTOM voucher.

`POST /api/v1/vouchers/:voucherId/redeem-voucher`

Redeeming defines what the payee expects to receive. The voucher type is automatically determined:

* Provide `expectedPayment` → **SIMPLE** voucher (automatic network selection, supports FX)
* Provide `networks`, `payments`, or `extras` → **CUSTOM** voucher (full control, no FX)

You cannot provide both `expectedPayment` and `networks`/`payments`/`extras` — the system picks one based on what you supply.

## Parameters

### Path

| Name        | Type     | Required | Description                              |
| ----------- | -------- | -------- | ---------------------------------------- |
| `voucherId` | `string` | Yes      | The voucher ID from the reserve response |

### Body — SIMPLE voucher

Use `expectedPayment` for straightforward token transfers:

| Name                              | Type     | Required | Description                                           |
| --------------------------------- | -------- | -------- | ----------------------------------------------------- |
| `expectedPayment`                 | `object` | See note | The payment the payee expects to receive              |
| `expectedPayment.network`         | `string` | Yes      | Blockchain network (e.g. `polygon`, `ethereum`)       |
| `expectedPayment.currency`        | `string` | Yes      | Settlement currency symbol (e.g. `EURC`, `USDC`)      |
| `expectedPayment.currencyAddress` | `string` | Yes      | Contract address of the settlement token on-chain     |
| `expectedPayment.amount`          | `string` | Yes      | Amount to receive, as a decimal string (e.g. `"100"`) |
| `expectedPayment.wallet`          | `object` | Yes      | Destination wallet                                    |
| `expectedPayment.wallet.address`  | `string` | Yes      | Payee's wallet address where funds are sent           |

### Body — CUSTOM voucher

Use `networks`, `payments`, and `extras` for smart contract interactions:

| Name                     | Type     | Required | Description                                                     |
| ------------------------ | -------- | -------- | --------------------------------------------------------------- |
| `networks`               | `array`  | Yes      | 1–3 blockchain network specifications                           |
| `networks[].network`     | `string` | Yes      | Network name (e.g. `ethereum`)                                  |
| `networks[].type`        | `string` | Yes      | Network type (`evm`, `solana`)                                  |
| `networks[].chainId`     | `string` | Yes      | Chain ID (e.g. `"1"`)                                           |
| `payments`               | `array`  | Yes      | 1 payment instruction                                           |
| `payments[].type`        | `string` | Yes      | `send_transaction`                                              |
| `payments[].input.from`  | `string` | Yes      | `{payer}` — substituted by the wallet at resolution             |
| `payments[].input.to`    | `string` | Yes      | Contract address to call                                        |
| `payments[].input.value` | `string` | Yes      | Native currency value to send (`"0"` for contract calls)        |
| `payments[].input.data`  | `string` | Yes      | ABI-encoded calldata                                            |
| `extras`                 | `array`  | No       | 0–5 additional instructions (e.g. `call_transaction` for reads) |
| `payeeInfo`              | `object` | No       | Additional payee information                                    |

## Request examples

### SIMPLE voucher (EURC payment)

```shell theme={null}
curl --request POST 'https://payments.bleepay.com/api/v1/vouchers/vch_482916/redeem-voucher' \
  --header 'Authorization: Bearer <payee_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "expectedPayment": {
      "network": "polygon",
      "currency": "EURC",
      "currencyAddress": "0x73b3db5a96a4b9d9bcfc22b8f1b3d85a5e5b5e5b",
      "amount": "100",
      "wallet": {
        "address": "0xYourWalletAddress"
      }
    }
  }'
```

### CUSTOM voucher (staking contract call)

```shell theme={null}
curl --request POST 'https://payments.bleepay.com/api/v1/vouchers/vch_591234/redeem-voucher' \
  --header 'Authorization: Bearer <payee_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "networks": [
      {
        "network": "ethereum",
        "type": "evm",
        "chainId": "1"
      }
    ],
    "payments": [
      {
        "type": "send_transaction",
        "input": {
          "from": "{payer}",
          "to": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
          "value": "0",
          "data": "0xa694fc3a0000000000000000000000000000000000000000000000000de0b6b3a7640000"
        }
      }
    ],
    "extras": []
  }'
```

## Response

### Response schema

| Field             | Type     | Description                                       |
| ----------------- | -------- | ------------------------------------------------- |
| `id`              | `string` | Voucher identifier                                |
| `status`          | `string` | Voucher status — `REDEEMED`                       |
| `type`            | `string` | `SIMPLE` or `CUSTOM`                              |
| `expectedPayment` | `object` | Present for SIMPLE vouchers (see body parameters) |
| `networks`        | `array`  | Present for CUSTOM vouchers                       |
| `payments`        | `array`  | Present for CUSTOM vouchers                       |
| `extras`          | `array`  | Present for CUSTOM vouchers                       |

### Example response (SIMPLE)

```json theme={null}
{
  "id": "vch_482916",
  "status": "REDEEMED",
  "type": "SIMPLE",
  "expectedPayment": {
    "network": "polygon",
    "currency": "EURC",
    "currencyAddress": "0x73b3db5a96a4b9d9bcfc22b8f1b3d85a5e5b5e5b",
    "amount": "100",
    "wallet": {
      "address": "0xYourWalletAddress"
    }
  }
}
```

### Error responses

| Status | Code                | Description                                                                                       |
| ------ | ------------------- | ------------------------------------------------------------------------------------------------- |
| `400`  | `already_redeemed`  | The voucher has already been redeemed                                                             |
| `400`  | `validation_failed` | Invalid parameters — check that `expectedPayment` and `networks`/`payments` are not both provided |
| `401`  | `unauthorized`      | Missing or invalid bearer token                                                                   |
| `404`  | `not_found`         | Voucher not found                                                                                 |
