Coupons represent deductions applied to invoices or invoice line items. Each coupon is defined as either a fixed amount or a percentage of the applicable amount. Coupons are typically associated with customer usage and are reflected in billing data.

Columns

No match found

id string, not null
Primary Key

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


apply_on string, not null
The amount on the invoice to which the coupon is applied.

archived_at timestamp, null
Timestamp indicating when this coupon was archived.

created_at timestamp, not null
Timestamp indicating when this coupon is created.

currency_code string, null
The currency code (ISO 4217 format) of the coupon. Applicable for fixed_amount coupons table alone.

discount_amount long, null
The value of the deduction. The format of this value depends on the kind of currency.

discount_percentage double, null
The percentage of the original amount that should be deducted from it.

discount_type string, not null, default=percentage
The type of deduction applied by the coupon.

duration_type string, not null, default=forever
Specifies the duration for which the coupon remains associated with a subscription.

invoice_name string, null
Display name used in invoice table. If it is not configured then name is used in invoice.

invoice_notes string, null
A customer-facing note added to all invoices associated with this coupon. This note appears alongside other notes on the invoice PDF.

max_redemptions null

Maximum number of times this coupon can be redeemed.


meta_data string, null

name string, not null

The display name used in web interface for identifying the coupon.


period null
The duration of time for which the coupon is attached to the subscription, in period_units. Applicable only when duration_type is limited_period.

period_unit string, null
The unit of time for period. Applicable only when duration_type is limited_period.

redemptions null
The number of times this coupon has been redeemed.

resource_version long, null
The version number of this table. For every change made to the table, resource_version is updated with a new timestamp in milliseconds.

status string, null, default=active
The current status of the coupon.

updated_at timestamp, null
Timestamp indicating when this coupon was last updated.
Note that this does not change when the redemptions field is changed. This field will be present only if the table has been updated after 2016-11-09.

valid_till timestamp, null
Date upto which the coupon can be applied to new subscriptions.

record_extracted_at timestamp
The column represents the timestamp when the updated data became available in Chargebee's data lakehouse.

record_exported_at timestamp
The column represents the timestamp when the data was exported to the configured destination.

change_type string
The column indicates the type of change [create, update, delete, read] and can be used to load data into the warehouse accordingly.

Sample Queries

Subscriptions with Coupons Applied

Finds the list of subscriptions that have coupons applied, along with coupon details.

copy
Click to Copy
      SELECT
  s.id as subs_id,
  s.status as subs_status,
  c.name AS coupon_name,
  c.redemptions,
  sc.coupon_code
FROM
  subscriptions s
  JOIN subscription_coupons sc ON s.id = sc.subscription_id
  JOIN coupons c ON sc.coupon_id = c.id;