Create Voucher / Gift Card
Create a new voucher (gift card) that can be redeemed for bookings.
Endpointโ
POST /v1/vouchers
Request Bodyโ
| Field | Type | Required | Description |
|---|---|---|---|
code | string | No | Unique code (auto-generated if not provided) |
original_value | number | Yes | Initial value of the voucher |
valid_from | string | No | Start date (ISO 8601) |
valid_until | string | No | Expiration date (ISO 8601) |
purchaser_name | string | No | Name of the purchaser |
purchaser_email | string | No | Email of the purchaser |
recipient_name | string | No | Name of the recipient |
recipient_email | string | No | Email of the recipient |
personal_message | string | No | Gift message (max 1000 chars) |
status | string | No | active or inactive (default: active) |
send_emails | boolean | No | Send confirmation/gift emails |
Example Request - Gift Cardโ
curl -X POST "https://app.equipdash.com/api/v1/vouchers" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"original_value": 100.00,
"purchaser_name": "John Doe",
"purchaser_email": "john@example.com",
"recipient_name": "Jane Smith",
"recipient_email": "jane@example.com",
"personal_message": "Happy Birthday! Enjoy your adventure!",
"valid_until": "2026-12-31T23:59:59Z",
"send_emails": true
}'
Example Request - Custom Codeโ
curl -X POST "https://app.equipdash.com/api/v1/vouchers" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "BIRTHDAY2026",
"original_value": 50.00
}'
Responseโ
{
"data": {
"id": 1,
"code": "GFT-ABCD-1234",
"original_value": 100.00,
"remaining_value": 100.00,
"currency": "USD",
"status": "active",
"valid_from": null,
"valid_until": "2026-12-31T23:59:59+00:00",
"purchaser_name": "John Doe",
"purchaser_email": "john@example.com",
"recipient_name": "Jane Smith",
"recipient_email": "jane@example.com",
"personal_message": "Happy Birthday! Enjoy your adventure!",
"is_redeemable": false,
"is_expired": false,
"is_paid": false,
"payment_status": "unpaid",
"source": "api",
"created_at": "2026-02-01T10:00:00+00:00",
"updated_at": "2026-02-01T10:00:00+00:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-01T10:00:00+00:00"
}
}
Code Generationโ
If no code is provided, a unique code is automatically generated in the format:
GFT-XXXX-XXXX
Email Notificationsโ
When send_emails: true:
- Purchaser Confirmation - Sent to
purchaser_emailwith voucher details - Gift Card Email - Sent to
recipient_emailwith the voucher code and personal message
Voucher Statesโ
| State | Description |
|---|---|
is_paid: false | Voucher cannot be redeemed until payment is recorded |
is_redeemable: true | Voucher can be used for bookings |
is_expired: true | valid_until has passed |
Notesโ
- Vouchers must be paid before they can be redeemed
- Use the admin interface or payment API to record voucher payments
- Currency is automatically set to your account's currency
remaining_valuestarts equal tooriginal_value