Coupon Webhook Parameters

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.

ParameterDescription
emailThe 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.
amountThe discount value. For a percentage coupon this is the percent, for a fixed coupon this is the currency amount.
discount_typeThe 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).

ParameterDescription
date_expiresAn explicit expiry date, normalized to the Y-m-d format.
daysNumber 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.

ParameterDescriptionDefault
individual_usePrevents the coupon from being combined with other coupons.true
usage_limitTotal number of times the coupon can be used before it is void.1
usage_limit_per_userNumber of times a single customer can use the coupon.None
limit_usage_to_x_itemsMaximum number of matching items the discount applies to.None
free_shippingGrants free shipping when the coupon is applied.None
product_idsArray of product IDs the coupon is restricted to.Empty
exclude_product_idsArray of product IDs the coupon cannot be used on.Empty
product_categoriesArray of category IDs the coupon is restricted to.Empty
excluded_product_categoriesArray of category IDs the coupon cannot be used on. Alias: excluded_categories.Empty
exclude_sale_itemsPrevents the coupon from applying to items already on sale.None
minimum_amountMinimum cart subtotal required to use the coupon.None
maximum_amountMaximum cart subtotal allowed to use the coupon.None
email_restrictionsArray of email addresses allowed to use the coupon.Empty
descriptionInternal description shown in the WooCommerce coupon admin.None
meta_dataArray 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_coupon set to 1
  • _wpgens_dck_klaviyo_email set to the recipient email address

Backward Compatible Aliases

A few parameters accept an alternate name so older integrations keep working:

  • type is accepted as an alias for discount_type
  • excluded_categories is accepted as an alias for excluded_product_categories
  • days is an alternative to date_expires for 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 propertyDescription
dck_woo_couponThe generated coupon code, stored as text.
dck_coupon_expiry_dateThe 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|lookup returns the value exactly as stored, and Klaviyo’s date formatting filters cannot reformat it into another format such as dd.mm.yyyy.
  • The value is intentionally the last day the coupon is valid. A WooCommerce coupon expires at the very start of its date_expires day, 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.

Browse our plugins

Lightweight WooCommerce plugins built for speed. No bloat, no frameworks -- just clean code that works.

View all plugins
Stay in the loop

Get notified when we launch new plugins. No spam, just product updates.