Update Voucher
Update an existing voucher or gift card.
Endpointโ
PATCH /v1/vouchers/{id}
Authenticationโ
Requires an API key with the promotions:write scope.
Path Parametersโ
| Parameter | Type | Description |
|---|---|---|
id | integer | The voucher ID |
Request Bodyโ
All fields are optional. Only include fields you want to update.
| Field | Type | Description |
|---|---|---|
code | string | Voucher code |
original_value | number | Original voucher value |
remaining_value | number | Remaining balance |
valid_from | string | Start date (ISO 8601) |
valid_until | string | Expiration date (ISO 8601) |
status | string | active, inactive, or fully_redeemed |
purchaser_name | string | Name of purchaser |
purchaser_email | string | Email of purchaser |
recipient_name | string | Name of gift recipient |
recipient_email | string | Email of gift recipient |
personal_message | string | Gift message |
Example Requestโ
curl -X PATCH "https://app.equipdash.com/api/v1/vouchers/1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"valid_until": "2027-12-31T23:59:59Z",
"remaining_value": 50.00
}'
Responseโ
{
"data": {
"id": 1,
"code": "GC-ABC123XYZ",
"original_value": 100.00,
"remaining_value": 50.00,
"currency": "USD",
"valid_from": "2025-12-25T00:00:00+00:00",
"valid_until": "2027-12-31T23:59:59+00:00",
"status": "active",
"source": "online_purchase",
"purchaser": {
"name": "John Doe",
"email": "john@example.com"
},
"recipient": {
"name": "Jane Doe",
"email": "jane@example.com",
"personal_message": "Happy Birthday!"
},
"is_expired": false,
"is_redeemable": true,
"payment_status": "paid",
"created_at": "2025-12-20T00: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"
}
}
Errorsโ
| Status | Code | Description |
|---|---|---|
| 401 | authentication_required | No API key provided |
| 403 | insufficient_scope | API key lacks promotions:write scope |
| 403 | forbidden | Voucher belongs to different supplier |
| 404 | resource_not_found | Voucher does not exist |
| 422 | validation_error | Invalid request data |
Notesโ
- Cannot change code to one that already exists
- Adjusting
remaining_valuedoes not create usage records - Setting
statustofully_redeemedis different fromremaining_value: 0