Occurs whenever a discount code is created for a partner.
This event is sent when a discount code is created via the API, the dashboard, or auto-provisioning when a partner joins a group.
If the discount uses the custom provider, listen to this webhook to create the corresponding promo code in your own system. For Stripe and Shopify discounts, Dub creates the code in the connected provider automatically.
Response body parameters
All webhook payloads follow a consistent top-level structure with event-specific data nested within the data object.
discount_code.created).discount_code.created event contains the following parameters:Show object parametersHide object parameters
Unique identifier for the discount code (e.g. dcode_...).
The alphanumeric discount code customers can apply at checkout.
ID of the partner this discount code is assigned to.
ID of the partner's referral link this discount code is associated with.
ISO 8601 timestamp when the code was disabled, or null if it is
active.
The discount this code belongs to.
Show discount objectHide discount object
Unique identifier for the discount.
Discount amount. For percentage discounts this is the
percent off (e.g. 10 = 10% off). For flat
discounts this is the amount in cents (e.g. 500 = $5.00).
Discount type: percentage or flat.
Maximum duration in months. 0 is one-time,
null is lifetime.
Discount provider: stripe, shopify, or
custom.