The `subscription_discounts` table lists the discounts currently applied to a subscription.

Columns

No match found

id string, not null
An auto-generated, unique identifier for the discount.

subscription_id string, not null
Foreign Key subscriptions.id
The unique identifier of the `subscription` this discount applies to.

item_price_id string, null
Foreign Key item_prices.id
The identifier of the `item_price` to which the discount is applied. This is relevant only when `apply_on` is `specific_item_price`.

coupon_id string, not null
Foreign Key coupons.id

Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.


amount long, null
The value of the discount. The format of this value depends on the kind of currency. This is only applicable when `discount.type` is `fixed_amount`.

applied_count null
Specifies the number of times the discount has been applied.

apply_on string, not null
Specifies where the discount is applied on the invoice. It can be `invoice_amount`, which applies the discount to the invoice subtotal, or `specific_item_price`, which applies it to a specific item price on the invoice.

apply_till timestamp, null
Specifies until when the limited period discount is applicable. This field is sent in the response only for `limited_period` duration type discount.

created_at timestamp, not null
The timestamp indicating when this discount was created.

currency_code string, null
The currency code (ISO 4217 format) of the discount. This is only applicable when `discount.type` is `fixed_amount`.

duration_type string, not null, default=forever
Specifies the time duration for which this discount is attached to the subscription. The types of discounts available are `forever`, `limited_period`, and `one_time`.

included_in_mrr boolean, not null
Indicates whether the discount is included in MRR calculations for your site. This field is only applicable when `duration_type` is `one_time` and when the feature is enabled in Chargebee. Also, if the site-level setting is to exclude one-time discounts from MRR calculations, this value is always `false`.

index not null
The index number of the subscription to which the item price is added. This is a unique number between `0` and `4` (inclusive) for each subscription that is created.

invoice_name string, null
The name of the discount as it appears on customer-facing pages and documents, such as invoices and hosted pages. This is auto-generated based on the `type`, `amount`, and `currency_code` of the discount. For example, it can be `10% off` or `10$ off`.

percentage double, null
The percentage of the original amount that should be deducted. This is only applicable when `discount.type` is percentage.

period null
The duration of time for which the discount is attached to the subscription, in `period_units`. This is applicable only when `duration_type` is `limited_period`.

period_unit string, null
The unit of time for `period`. This is applicable only when `duration_type` is `limited_period`. The types of `period_unit` are `day`, `month`, `week`, and `year`.

type string, not null, default=percentage
The types of discounts available are `fixed_amount` and `percentage`.