BillingCoupon: {
    amount_off: number | null;
    applies_to: (Exclude<BillingPlan, "free"> | BillingService | BillingAddOn)[] | null;
    code: string;
    duration_cycles: number | "forever" | "once";
    percentage_off: number | null;
    restrictions?: {
        minimum_order_value: number | null;
        only_first_time: boolean;
    };
}

Type declaration

  • amount_off: number | null

    Amount off the original value.

    Only one of amount_off and percentage_off will not be null.

  • applies_to: (Exclude<BillingPlan, "free"> | BillingService | BillingAddOn)[] | null

    Services, plans, and add-ons the coupon is applicable to. Applies to everything when null.

  • code: string

    Coupon promotional code (if customer-facing) or coupon name.

  • duration_cycles: number | "forever" | "once"

    Duration cycles for the coupon.

    Number is months, once means the coupon is only valid for one purchase or one billing.

  • percentage_off: number | null

    Percentage off the original value.

    Only one of amount_off and percentage_off will not be null.

  • Optional restrictions?: {
        minimum_order_value: number | null;
        only_first_time: boolean;
    }

    Restrictions for coupon usage.

    • minimum_order_value: number | null

      Minimum value of the purchase so this coupon is applicable.

    • only_first_time: boolean

      Whether the coupon can only be used on the first purchase.