> ## 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.

# Create Refund Session Voucher

> Create a refund session with a reserved voucher.

`POST /api/v1/widgets/refund-sessions/create-session-voucher`

Creates a refund session and reserves a voucher in a single request. The voucher is linked to the refund session and can be used to track the refund through the voucher lifecycle.

## Parameters

### Body

| Name               | Type     | Required | Description                                   |
| ------------------ | -------- | -------- | --------------------------------------------- |
| `depositSessionId` | `string` | Yes      | The confirmed deposit session ID to refund    |
| `code`             | `string` | Yes      | Voucher redemption code, exactly 6 characters |

## Request example

```shell theme={null}
curl --request POST 'https://payments.bleepay.com/api/v1/widgets/refund-sessions/create-session-voucher' \
  --header 'Authorization: Bearer <business_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "depositSessionId": "dep_a1b2c3d4e5f6",
    "code": "ABC123"
  }'
```

## Response

### Response schema

Returns an object with both the voucher and the refund session.

**Voucher fields:**

| Field            | Type     | Description                 |
| ---------------- | -------- | --------------------------- |
| `voucher.id`     | `string` | Unique voucher identifier   |
| `voucher.code`   | `string` | Voucher redemption code     |
| `voucher.status` | `string` | Voucher status — `RESERVED` |

**Refund session fields:** See [Create Refund Session](/api-reference/widgets/refunds/create-session) for the full schema.

### Example response

```json theme={null}
{
  "voucher": {
    "id": "vchr_a1b2c3d4e5f6",
    "code": "BLEEP-ABCD-1234",
    "status": "RESERVED"
  },
  "refundSession": {
    "id": "ref_a1b2c3d4e5f6",
    "businessId": "biz_abc123",
    "widgetId": "wdgt_abc",
    "depositSessionId": "dep_a1b2c3d4e5f6",
    "paymentStatus": "CREATED",
    "amount": "100",
    "amountRaw": "100000000",
    "currency": "USDC",
    "network": "polygon",
    "currencyAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
    "dstAddress": "0xPayerWalletAddress",
    "value": "100.00",
    "valueRaw": "10000",
    "expiresAt": "2026-06-09T12:30:00.000Z",
    "createdAt": "2026-06-09T12:00:00.000Z",
    "updatedAt": "2026-06-09T12:00:00.000Z"
  }
}
```

### Error responses

| Status | Code                | Description                                                  |
| ------ | ------------------- | ------------------------------------------------------------ |
| `400`  | `validation_failed` | Invalid parameters or deposit session not in confirmed state |
| `401`  | `unauthorized`      | Missing or invalid authentication                            |
| `404`  | `not_found`         | Deposit session not found                                    |
