Use this endpoint to refund an amount back to a voucher (e.g., when a booking is cancelled).
Bearer token with marketing:write scope
Request body
Amount to add in minor units
The booking ID being refunded
The customer ID receiving the refund
ID of the original redemption transaction being reversed
Description for the transaction record
Response
Returns the transaction record and updated voucher details.
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"
}'
{
"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 |
If the voucher was depleted and a refund is issued, the status automatically changes back to active.