Skip to main content

Update Promo Code

Update an existing promotional code.

Endpointโ€‹

PATCH /v1/promo-codes/{id}

Authenticationโ€‹

Requires an API key with the promotions:write scope.

Path Parametersโ€‹

ParameterTypeDescription
idintegerThe promo code ID

Request Bodyโ€‹

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

FieldTypeDescription
codestringUnique promo code (auto-uppercased). Letters, numbers, hyphens and underscores only โ€” anything else returns a 422.
namestringDisplay name for the promo
descriptionstringDescription (max 500 chars)
discount_typestringpercentage or flat
discount_valuenumberDiscount amount (percentage or flat amount)
min_booking_amountnumberMinimum booking total required
max_discount_amountnumberMaximum discount cap
valid_fromstringStart date (ISO 8601)
valid_untilstringExpiration date (ISO 8601)
max_usesintegerTotal usage limit
max_uses_per_customerintegerPer-customer usage limit
apply_to_all_productsbooleanApply to all rental products
apply_to_all_experiencesbooleanApply to all experiences
product_idsarraySpecific product IDs to apply to
product_category_idsarrayProduct category IDs to apply to
experience_idsarraySpecific experience IDs to apply to
experience_category_idsarrayExperience category IDs to apply to
statusstringactive or inactive

Example Requestโ€‹

curl -X PATCH "https://app.equipdash.com/api/v1/promo-codes/1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"discount_value": 15,
"valid_until": "2026-06-30T23:59:59Z",
"status": "active"
}'

Responseโ€‹

{
"data": {
"id": 1,
"code": "SUMMER10",
"name": "Summer Sale",
"description": null,
"discount_type": "percentage",
"discount_value": 15.00,
"min_booking_amount": null,
"max_discount_amount": null,
"valid_from": null,
"valid_until": "2026-06-30T23:59:59+00:00",
"max_uses": null,
"max_uses_per_customer": null,
"uses_count": 10,
"status": "active",
"applies_to": "All Products & Experiences",
"created_at": "2026-01-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"
}
}

Update Assignables Exampleโ€‹

To change which products/experiences the promo code applies to:

curl -X PATCH "https://app.equipdash.com/api/v1/promo-codes/1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"apply_to_all_products": false,
"apply_to_all_experiences": false,
"product_ids": [1, 5, 10],
"experience_ids": [2, 3]
}'

Errorsโ€‹

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

Notesโ€‹

  • Promo codes are auto-uppercased
  • Cannot change code to one that already exists
  • discount_value for percentage type cannot exceed 100
  • Updating assignables replaces existing associations