Coupon Object
Overview
The coupon object represents a single discount code or promotional offer applied to an order or product. It captures the discount value, tax implications, and coupon classification for promotion tracking and marketing analytics.
Coupons can be applied at two levels:
- Order-level — in the top-level
couponsarray, applied to the entire order - Product-level — inside a product's
couponsarray, applied to a specific product
Complete Reference
coupons[0] object
name string required
Coupon name or code.
name: "FREE SHIPPING"
value number recommended
Coupon discount value.
value: 123.99
tax_included boolean recommended
Whether coupon value includes taxes
tax_included: true
tax_percent number recommended
Tax percentage for the coupon
tax_percent: 21
id string
Coupon internal identifier.
id: "COUPON_INTERNAL_ID"
type string
Coupon type. Free-form string, use consistent naming (e.g. "LOYALTY", "SEASONAL", "FIRST_ORDER", "SHIPPING").
type: "SHIPPING"
currency string required-if-applicable
Currency code. Specifies the currency code when it differs from event.currency.
currency: "USD"
exchange_rate number
Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.
exchange_rate: 1
Examples
- Percentage Discount
- Fixed Amount
- Free Shipping
- Multiple Coupons
{
"name": "SUMMER10",
"value": 29.99,
"tax_included": true,
"tax_percent": 19,
"id": "SUMMER10_2024",
"type": "SEASONAL",
"currency": "EUR",
"exchange_rate": 1
}
{
"name": "SAVE25",
"value": 25.00,
"tax_included": true,
"tax_percent": 19,
"id": "SAVE25_PROMO",
"type": "FIXED_AMOUNT",
"currency": "EUR",
"exchange_rate": 1
}
{
"name": "FREESHIP",
"value": 15.99,
"tax_included": true,
"tax_percent": 0,
"id": "FREESHIP_001",
"type": "SHIPPING"
}
[
{
"name": "NEWCUSTOMER20",
"value": 60.00,
"tax_included": true,
"tax_percent": 19,
"id": "NEW20_001",
"type": "FIRST_ORDER"
},
{
"name": "FREESHIP50",
"value": 12.99,
"tax_included": true,
"tax_percent": 0,
"id": "FREESHIP_001",
"type": "SHIPPING"
}
]
Order-Level vs Product-Level
Order-Level Coupons
Applied to the entire order in the top-level coupons array:
{
"event": { "name": "checkout_completed", "id": "ORD_123" },
"coupons": [
{
"name": "ORDER_WIDE_15OFF",
"value": 45.00,
"tax_included": true,
"tax_percent": 19,
"type": "PROMOTIONAL"
}
]
}
Product-Level Coupons
Applied to a specific product inside the product's coupons array:
{
"products": [
{
"id": "LAPTOP_001",
"name": "Gaming Laptop",
"price": 999.99,
"coupons": [
{
"name": "LAPTOP_DEAL",
"value": 100.00,
"tax_included": true,
"tax_percent": 19,
"type": "PRODUCT_SPECIFIC"
}
]
}
]
}
Best Practices
- Accurate values — ensure coupon values reflect the actual discount amount applied, not the coupon's potential value
- Consistent naming — use standardized coupon code naming conventions
- Tax information — include accurate tax calculations; if
tax_percentis not provided, the default from your account configuration is used - Currency — only specify
currencyandexchange_ratewhen the coupon's currency differs from the event currency - Type classification — use consistent
typevalues for campaign analytics (e.g. "SEASONAL", "LOYALTY", "FIRST_ORDER", "SHIPPING", "PROMOTIONAL")