When a Klaviyo flow calls the plugin’s Webhook URL, the JSON body you send controls exactly how the WooCommerce coupon is created. This page is a complete reference of every parameter the coupon endpoint accepts, along with its default value. For the step by step flow setup, see Create Dynamic Coupons using Klaviyo Webhooks.
Required Parameters
These three fields must be present in every request. If any is missing, the coupon is not created and the endpoint returns an error.
| Parameter | Description |
|---|---|
email | The recipient’s email address. It is used to look up the matching Klaviyo profile so the coupon code can be written back to that profile. |
amount | The discount value. For a percentage coupon this is the percent, for a fixed coupon this is the currency amount. |
discount_type | The type of discount: percent, fixed_cart, or fixed_product. The alias type is also accepted. |
Expiration
Set the coupon expiry using one of the following. If you send neither, the coupon uses the default number of days configured in the plugin settings (3 days by default).
| Parameter | Description |
|---|---|
date_expires | An explicit expiry date, normalized to the Y-m-d format. |
days | Number of days from now until the coupon expires. |
| (neither sent) | Falls back to the Default Expiry Days plugin setting (3 days by default). |
Optional Parameters
All of the following are optional. Each maps to a standard WooCommerce coupon setting. When a parameter is omitted, WooCommerce applies the default shown in the last column.
| Parameter | Description | Default |
|---|---|---|
individual_use | Prevents the coupon from being combined with other coupons. | true |
usage_limit | Total number of times the coupon can be used before it is void. | 1 |
usage_limit_per_user | Number of times a single customer can use the coupon. | None |
limit_usage_to_x_items | Maximum number of matching items the discount applies to. | None |
free_shipping | Grants free shipping when the coupon is applied. | None |
product_ids | Array of product IDs the coupon is restricted to. | Empty |
exclude_product_ids | Array of product IDs the coupon cannot be used on. | Empty |
product_categories | Array of category IDs the coupon is restricted to. | Empty |
excluded_product_categories | Array of category IDs the coupon cannot be used on. Alias: excluded_categories. | Empty |
exclude_sale_items | Prevents the coupon from applying to items already on sale. | None |
minimum_amount | Minimum cart subtotal required to use the coupon. | None |
maximum_amount | Maximum cart subtotal allowed to use the coupon. | None |
email_restrictions | Array of email addresses allowed to use the coupon. | Empty |
description | Internal description shown in the WooCommerce coupon admin. | None |
meta_data | Array of { "key": "...", "value": "..." } objects saved as custom coupon meta. | Empty |
Example JSON Body
A typical webhook body for a 10% off coupon that expires in 7 days and requires a minimum spend:
{
"email": "{{ person.email }}",
"discount_type": "percent",
"amount": "10",
"days": 7,
"individual_use": true,
"usage_limit": 1,
"free_shipping": false,
"minimum_amount": "50",
"description": "10% off for new subscribers"
}
Automatically Added Metadata
In addition to any meta_data you send, the plugin always stores the following on every coupon it creates, so it can identify and manage Klaviyo generated coupons:
_wpgens_dck_klaviyo_couponset to1_wpgens_dck_klaviyo_emailset to the recipient email address
Backward Compatible Aliases
A few parameters accept an alternate name so older integrations keep working:
typeis accepted as an alias fordiscount_typeexcluded_categoriesis accepted as an alias forexcluded_product_categoriesdaysis an alternative todate_expiresfor setting expiry
Klaviyo Profile Properties
The metadata above lives on the WooCommerce coupon itself. Separately, once a coupon is created the plugin writes two properties back to the recipient’s Klaviyo profile. These are the values you reference inside your Klaviyo email or flow, for example with person|lookup:"dck_coupon_expiry_date".
| Profile property | Description |
|---|---|
dck_woo_coupon | The generated coupon code, stored as text. |
dck_coupon_expiry_date | The coupon expiry date, stored as text. |
Expiry Date Format
dck_coupon_expiry_date is written in US format MM/DD/YYYY, for example 09/07/2026. Two important details:
- It is stored as a plain text string, not as a native Klaviyo date property. That means
person|lookupreturns the value exactly as stored, and Klaviyo’s date formatting filters cannot reformat it into another format such asdd.mm.yyyy. - The value is intentionally the last day the coupon is valid. A WooCommerce coupon expires at the very start of its
date_expiresday, so the plugin stores the date one day earlier to show the true last usable day to your customer.
To display the expiry date in your Klaviyo template, use:
{{ person|lookup:"dck_coupon_expiry_date"|default:'' }}
Which fields are required to create a coupon?
You must send email, amount, and discount_type. All other fields are optional and fall back to sensible defaults.
What happens if I do not set an expiry date?
If you send neither date_expires nor days, the coupon expires after the Default Expiry Days value in the plugin settings, which is 3 days by default.
Can I restrict the coupon to specific products or categories?
Yes. Use product_ids or product_categories to limit the coupon, and exclude_product_ids or excluded_product_categories to block specific items.
How do I add custom data to a coupon?
Send a meta_data array of key and value pairs. Each pair is saved as custom coupon meta in WooCommerce.
What format is the coupon expiry date in Klaviyo?
The dck_coupon_expiry_date profile property is stored as plain text in US format MM/DD/YYYY, for example 09/07/2026. Because it is a text string and not a native date property, Klaviyo date filters cannot reformat it into another format such as dd.mm.yyyy.