Create Promo Code
Create a new promotional code with discount rules.
Endpointโ
POST /v1/promo-codes
Request Bodyโ
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Unique promo code (auto-uppercased). Letters, numbers, hyphens and underscores only โ anything else returns a 422. |
name | string | No | Display name for the promo |
description | string | No | Description (max 500 chars) |
discount_type | string | Yes | percentage or flat |
discount_value | number | Yes | Discount amount (percentage or fixed amount) |
min_booking_amount | number | No | Minimum booking total required |
max_discount_amount | number | No | Maximum discount cap |
valid_from | string | No | Start date (ISO 8601) |
valid_until | string | No | Expiration date (ISO 8601) |
max_uses | integer | No | Total usage limit |
max_uses_per_customer | integer | No | Per-customer usage limit |
apply_to_all_products | boolean | No | Apply to all rental products |
apply_to_all_experiences | boolean | No | Apply to all experiences |
product_ids | array | No | Specific product IDs to apply to |
product_category_ids | array | No | Product category IDs to apply to |
experience_ids | array | No | Specific experience IDs to apply to |
experience_category_ids | array | No | Experience category IDs to apply to |
status | string | No | active or inactive (default: active) |
Example Request - Simple Percentage Discountโ
curl -X POST "https://app.equipdash.com/api/v1/promo-codes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "SUMMER10",
"name": "Summer Sale 10% Off",
"discount_type": "percentage",
"discount_value": 10,
"apply_to_all_products": true,
"apply_to_all_experiences": true
}'
Example Request - Fixed Discount with Restrictionsโ
curl -X POST "https://app.equipdash.com/api/v1/promo-codes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "SAVE25",
"name": "$25 Off First Rental",
"discount_type": "flat",
"discount_value": 25.00,
"min_booking_amount": 100.00,
"max_uses_per_customer": 1,
"valid_from": "2026-02-01T00:00:00Z",
"valid_until": "2026-03-31T23:59:59Z",
"product_ids": [1, 2, 5]
}'
Responseโ
{
"data": {
"id": 1,
"code": "SUMMER10",
"name": "Summer Sale 10% Off",
"description": null,
"discount_type": "percentage",
"discount_value": 10.00,
"min_booking_amount": null,
"max_discount_amount": null,
"valid_from": null,
"valid_until": null,
"max_uses": null,
"max_uses_per_customer": null,
"uses_count": 0,
"status": "active",
"applies_to": "All Products & Experiences",
"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"
}
}
Discount Typesโ
| Type | Description | Example |
|---|---|---|
percentage | Percentage off eligible items | 10 = 10% off |
flat | Fixed amount off | 25 = $25 off |
Applying to Specific Itemsโ
You can control what the promo code applies to:
All Products and/or Experiencesโ
{
"apply_to_all_products": true,
"apply_to_all_experiences": true
}
Specific Productsโ
{
"product_ids": [1, 2, 5]
}
Product Categoriesโ
{
"product_category_ids": [1, 3]
}
Mixed (Products + Experiences)โ
{
"apply_to_all_products": true,
"experience_ids": [10, 15]
}
Notesโ
-
To create many codes at once, use Import Promo Codes
-
Promo codes are auto-uppercased
-
A code may only contain letters, numbers, hyphens and underscores, so that a customer can type it at checkout. A code with a space or punctuation is rejected:
{
"error": {
"code": "validation_error",
"message": "The given data was invalid.",
"details": [
{ "field": "code", "message": "The code can only contain letters, numbers, hyphens and underscores." }
]
}
} -
discount_valuefor percentage type cannot exceed 100 -
If no apply_to fields are set, the code applies to everything
-
max_discount_amountcaps the total discount for percentage codes