Skip to main content
Use this endpoint to redeem a voucher during checkout. This deducts the specified amount from the voucher balance.
Authorization
string
required
Bearer token with marketing:write scope
id
string
required
The voucher ID

Request body

amount_minor
integer
required
Amount to deduct in minor units (must not exceed current balance)
booking_id
string
The booking ID where the voucher was applied
customer_id
string
The customer ID who redeemed the voucher
description
string
Description for the transaction record

Response

Returns the transaction record and updated voucher details.
Request
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"
  }'
Response
{
  "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

StatusErrorDescription
400Voucher is Voucher is not active
400Insufficient balanceRequested amount exceeds current balance
404Voucher not foundNo voucher exists with the given ID
When the voucher balance reaches zero, its status automatically changes to depleted.