Skip to main content
Dub

discount_code.deleted

2 min read

Occurs whenever a discount code for a partner is deleted.

Tip

This event is also sent when a discount code is removed automatically — for example when a partner is banned or deactivated, a linked referral link is deleted, or a partner is moved to a group without an equivalent discount.

If the discount uses the custom provider, listen to this webhook to disable the corresponding promo code in your own system. For Stripe and Shopify discounts, Dub disables 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.

idstring#
The event ID.
eventstring#
The event type that triggered the webhook (e.g., discount_code.deleted).
createdAtstring#
ISO 8601 timestamp when the webhook event was created.
dataobject#
Event-specific data containing detailed information about the event. The data object for the discount_code.deleted event contains the following parameters:
Show object parameters
idstring#

Unique identifier for the discount code (e.g. dcode_...).

codestring#

The alphanumeric discount code that was deleted.

partnerIdstring#

ID of the partner this discount code was assigned to.

linkIdstring#

ID of the partner's referral link this discount code was associated with.

disabledAtstring | null#

ISO 8601 timestamp when the code was disabled. Set when a partner is banned or deactivated; otherwise null.

discountobject | null#

The discount this code belonged to.

Show discount object
idstring#

Unique identifier for the discount.

amountnumber#

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).

typestring#

Discount type: percentage or flat.

maxDurationnumber | null#

Maximum duration in months. 0 is one-time, null is lifetime.

providerstring#

Discount provider: stripe, shopify, or custom.