Skip to main content

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โ€‹

ParameterTypeDescription
idintegerThe voucher ID

Request Bodyโ€‹

All fields are optional. Only include fields you want to update.

FieldTypeDescription
codestringVoucher code
original_valuenumberOriginal voucher value
remaining_valuenumberRemaining balance
valid_fromstringStart date (ISO 8601)
valid_untilstringExpiration date (ISO 8601)
statusstringactive, inactive, or fully_redeemed
purchaser_namestringName of purchaser
purchaser_emailstringEmail of purchaser
recipient_namestringName of gift recipient
recipient_emailstringEmail of gift recipient
personal_messagestringGift 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โ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
403insufficient_scopeAPI key lacks promotions:write scope
403forbiddenVoucher belongs to different supplier
404resource_not_foundVoucher does not exist
422validation_errorInvalid request data

Notesโ€‹

  • Cannot change code to one that already exists
  • Adjusting remaining_value does not create usage records
  • Setting status to fully_redeemed is different from remaining_value: 0