Skip to main content

Create Promo Code

Create a new promotional code with discount rules.

Endpointโ€‹

POST /v1/promo-codes

Request Bodyโ€‹

FieldTypeRequiredDescription
codestringYesUnique promo code (auto-uppercased). Letters, numbers, hyphens and underscores only โ€” anything else returns a 422.
namestringNoDisplay name for the promo
descriptionstringNoDescription (max 500 chars)
discount_typestringYespercentage or flat
discount_valuenumberYesDiscount amount (percentage or fixed amount)
min_booking_amountnumberNoMinimum booking total required
max_discount_amountnumberNoMaximum discount cap
valid_fromstringNoStart date (ISO 8601)
valid_untilstringNoExpiration date (ISO 8601)
max_usesintegerNoTotal usage limit
max_uses_per_customerintegerNoPer-customer usage limit
apply_to_all_productsbooleanNoApply to all rental products
apply_to_all_experiencesbooleanNoApply to all experiences
product_idsarrayNoSpecific product IDs to apply to
product_category_idsarrayNoProduct category IDs to apply to
experience_idsarrayNoSpecific experience IDs to apply to
experience_category_idsarrayNoExperience category IDs to apply to
statusstringNoactive 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โ€‹

TypeDescriptionExample
percentagePercentage off eligible items10 = 10% off
flatFixed amount off25 = $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_value for percentage type cannot exceed 100

  • If no apply_to fields are set, the code applies to everything

  • max_discount_amount caps the total discount for percentage codes