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โ
| Parameter | Type | Description |
|---|---|---|
id | integer | The promo code ID |
Request Bodyโ
All fields are optional. Only include fields you want to update.
| Field | Type | Description |
|---|---|---|
code | string | Unique promo code (auto-uppercased). Letters, numbers, hyphens and underscores only โ anything else returns a 422. |
name | string | Display name for the promo |
description | string | Description (max 500 chars) |
discount_type | string | percentage or flat |
discount_value | number | Discount amount (percentage or flat amount) |
min_booking_amount | number | Minimum booking total required |
max_discount_amount | number | Maximum discount cap |
valid_from | string | Start date (ISO 8601) |
valid_until | string | Expiration date (ISO 8601) |
max_uses | integer | Total usage limit |
max_uses_per_customer | integer | Per-customer usage limit |
apply_to_all_products | boolean | Apply to all rental products |
apply_to_all_experiences | boolean | Apply to all experiences |
product_ids | array | Specific product IDs to apply to |
product_category_ids | array | Product category IDs to apply to |
experience_ids | array | Specific experience IDs to apply to |
experience_category_ids | array | Experience category IDs to apply to |
status | string | active 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โ
| Status | Code | Description |
|---|---|---|
| 401 | authentication_required | No API key provided |
| 403 | insufficient_scope | API key lacks promotions:write scope |
| 403 | forbidden | Promo code belongs to different supplier |
| 404 | resource_not_found | Promo code does not exist |
| 422 | validation_error | Invalid request data |
Notesโ
- Promo codes are auto-uppercased
- Cannot change code to one that already exists
discount_valuefor percentage type cannot exceed 100- Updating assignables replaces existing associations