Validate Voucher
Check if a voucher is valid and can be redeemed.
Endpointโ
POST /v1/vouchers/validate
Request Bodyโ
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Voucher code to validate |
amount_due | number | No | Booking amount due (to calculate redeemable amount) |
Example Requestโ
curl -X POST "https://app.equipdash.com/api/v1/vouchers/validate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "GFT-ABCD-1234",
"amount_due": 75.00
}'
Success Responseโ
{
"data": {
"valid": true,
"voucher": {
"id": 1,
"code": "GFT-ABCD-1234",
"original_value": 100.00,
"remaining_value": 100.00,
"currency": "USD",
"status": "active"
},
"redeemable_amount": 75.00
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-01T10:00:00+00:00"
}
}
The redeemable_amount is the minimum of:
remaining_value(voucher balance)amount_due(if provided)
Error Responseโ
{
"error": {
"code": "validation_error",
"message": "The given data was invalid.",
"details": [
{
"field": "code",
"message": "This voucher has expired."
}
]
}
}
Possible Validation Errorsโ
| Error | Description |
|---|---|
| Invalid voucher code | Code doesn't exist |
| This voucher is no longer active | Status is not active |
| This voucher has not been paid for yet | Payment not recorded |
| This voucher has expired | valid_until is in the past |
| This voucher is not yet valid | valid_from is in the future |
| This voucher has no remaining balance | Fully redeemed |
Check Voucher Balance
Get the current balance and usage details of a voucher.
Endpointโ
POST /v1/vouchers/balance
Request Bodyโ
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Voucher code to check |
Example Requestโ
curl -X POST "https://app.equipdash.com/api/v1/vouchers/balance" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "GFT-ABCD-1234"
}'
Responseโ
{
"data": {
"code": "GFT-ABCD-1234",
"original_value": 100.00,
"remaining_value": 45.00,
"currency": "USD",
"status": "active",
"is_redeemable": true,
"is_expired": false,
"is_paid": true,
"valid_until": "2026-12-31T23:59:59+00:00",
"times_used": 2,
"total_redeemed": 55.00
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-01T10:00:00+00:00"
}
}
Notesโ
- Balance check is read-only
- Use this endpoint to display voucher info to customers
times_usedshows how many times the voucher has been partially redeemed