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

# Refund to Voucher

> Add balance back to a voucher

Use this endpoint to refund an amount back to a voucher (e.g., when a booking is cancelled).

<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 add in minor units
</ParamField>

<ParamField body="booking_id" type="string">
  The booking ID being refunded
</ParamField>

<ParamField body="customer_id" type="string">
  The customer ID receiving the refund
</ParamField>

<ParamField body="original_transaction_id" type="string">
  ID of the original redemption transaction being reversed
</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/refund" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_minor": 5000,
    "booking_id": "booking_789",
    "customer_id": "cust_456",
    "original_transaction_id": "txn_xyz",
    "description": "Refund for cancelled Booking #789"
  }'
```

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

## Errors

| Status | Error             | Description                         |
| ------ | ----------------- | ----------------------------------- |
| 404    | Voucher not found | No voucher exists with the given ID |

<Note>
  If the voucher was `depleted` and a refund is issued, the status automatically changes back to `active`.
</Note>
