Coupons are deductions applied to invoices or invoice line items. They're designed to be consumed by your customers directly. A coupon deduction can either be for a fixed amount or for a percentage of the amount of the invoice or line item.
Note:
If you wish to provide discounts to your customers via API or the Chargebee app, see Discounts API
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:
When the coupon ID contains a special character; for example: #, the API returns an error. Make sure that you encode the coupon ID in the path parameter before making an API call.
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #, the API returns an error. Make sure that you encode the name of the coupon set in the path parameter before making an API call.
A specified number of units of the item price are offered for free. The number of free units is specified in discount_quantity.
The offer_quantity
option is valid only when apply_on
is set to each_specified_item
and the pricing_model
of the item price is per_unit.
Specifies the number of free units provided for the item price
, without affecting the total quantity sold. This parameter is applicable only when the discount_type
is set to offer_quantity
.
Specifies the time duration for which this coupon is attached to the subscription.
Possible values are
one_time
The coupon stays attached to the subscription till it is applied on an invoice once.
It is removed after that from the subscription.
forever
The coupon is attached to the subscription and applied on the invoices until explicitly removed.
limited_period
The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
.
Cannot be applied to a subscription. A coupon may expire due to exceeding max_redemptions
or valid_till
date is past. Existing associations remain unaffected.
archived
Cannot be applied to a subscription. Existing associations remain unaffected.
Timestamp indicating when this coupon was last updated.
Note that this does not change when the redemptions
attribute is changed. This attribute will be present only if the resource has been updated after 2016-11-09.
A customer-facing note added to all invoices associated with this API resource. This note becomes one among all the notes
displayed on the invoice PDF.
The coupon can be redeemed up to a set number of times for a specific resource type. The maximum redemptions are specified using value
, and the resource type is specified using entity_type.
For example, if entity_type
is customer
and value
is 10
then the coupon can only be redeemed up to 10 times for any particular customer
record.
unique_by
Indicates-when entity_type
is customer
that the coupon can be redeemed only once for every unique value of a specified customer
attribute. The customer
attribute is specified using value.
For example, if value
is email
, then the coupon can be redeemed only once for every unique value of customer.email.
In other words, when there are multiple customer
records with the same value for email
, once the coupon has been redeemed for one of those customer records, no further redemptions of the coupon are allowed for any of those customer
records.
existing_customer
The coupon is applicable only for existing customer(s). A customer will be considered as existing_customer
when they have at least one non-void, non-zero-dollar invoice.
new_customer
The coupon is applicable only for new customer(s). A customer will be considered as new_customer
when they do not have any prior non-void, non-zero-dollar invoices.
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:
When the coupon ID contains a special character; for example: #, the API returns an error. Make sure that you encode the coupon ID in the path parameter before making an API call.
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #, the API returns an error. Make sure that you encode the name of the coupon set in the path parameter before making an API call.
A specified number of units of the item price are offered for free. The number of free units is specified in discount_quantity.
The offer_quantity
option is valid only when apply_on
is set to each_specified_item
and the pricing_model
of the item price is per_unit.
Specifies the number of free units provided for the item price
, without affecting the total quantity sold. This parameter is applicable only when the discount_type
is set to offer_quantity
.
Specifies the time duration for which this coupon is attached to the subscription.
Possible values are
one_time
The coupon stays attached to the subscription till it is applied on an invoice once.
It is removed after that from the subscription.
forever
The coupon is attached to the subscription and applied on the invoices until explicitly removed.
limited_period
The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
.
Cannot be applied to a subscription. A coupon may expire due to exceeding max_redemptions
or valid_till
date is past. Existing associations remain unaffected.
archived
Cannot be applied to a subscription. Existing associations remain unaffected.
Timestamp indicating when this coupon was last updated.
Note that this does not change when the redemptions
attribute is changed. This attribute will be present only if the resource has been updated after 2016-11-09.
A customer-facing note added to all invoices associated with this API resource. This note becomes one among all the notes
displayed on the invoice PDF.
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:
When the coupon ID contains a special character; for example: #, the API returns an error. Make sure that you encode the coupon ID in the path parameter before making an API call.
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #, the API returns an error. Make sure that you encode the name of the coupon set in the path parameter before making an API call.
A specified number of units of the item price are offered for free. The number of free units is specified in discount_quantity.
The offer_quantity
option is valid only when apply_on
is set to each_specified_item
and the pricing_model
of the item price is per_unit.
Specifies the number of free units provided for the item price
, without affecting the total quantity sold. This parameter is applicable only when the discount_type
is set to offer_quantity
.
Specifies the time duration for which this coupon is attached to the subscription.
Possible values are
one_time
The coupon stays attached to the subscription till it is applied on an invoice once.
It is removed after that from the subscription.
forever
The coupon is attached to the subscription and applied on the invoices until explicitly removed.
limited_period
The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
.
(Deprecated)
The duration of time in months for which the coupon is attached to the subscription. Applicable only when duration_type
is limited_period.
Note:
This parameter has been deprecated. Use period
and period_unit
instead.
A customer-facing note added to all invoices associated with this API resource. This note becomes one among all the notes
displayed on the invoice PDF.
The coupon is included in MRR calculations for your site. This attribute is only applicable for coupons of duration_type = one_time
and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude one-time coupons from MRR calculations, this value is always returned false
.
Parameters for item_constraints. Multiple item_constraints can be passed by specifying unique indices. pass parameters as item_constraints[<param name>][<idx:0..n>]
Parameters for item_constraint_criteria. Multiple item_constraint_criteria can be passed by specifying unique indices. pass parameters as item_constraint_criteria[<param name>][<idx:0..n>]
Parameters for coupon_constraints. Multiple coupon_constraints can be passed by specifying unique indices. pass parameters as coupon_constraints[<param name>][<idx:0..n>]
The coupon can be redeemed up to a set number of times for a specific resource type. The maximum redemptions are specified using value
, and the resource type is specified using entity_type.
For example, if entity_type
is customer
and value
is 10
then the coupon can only be redeemed up to 10 times for any particular customer
record.
unique_by
Indicates-when entity_type
is customer
that the coupon can be redeemed only once for every unique value of a specified customer
attribute. The customer
attribute is specified using value.
For example, if value
is email
, then the coupon can be redeemed only once for every unique value of customer.email.
In other words, when there are multiple customer
records with the same value for email
, once the coupon has been redeemed for one of those customer records, no further redemptions of the coupon are allowed for any of those customer
records.
existing_customer
The coupon is applicable only for existing customer(s). A customer will be considered as existing_customer
when they have at least one non-void, non-zero-dollar invoice.
new_customer
The coupon is applicable only for new customer(s). A customer will be considered as new_customer
when they do not have any prior non-void, non-zero-dollar invoices.
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #, the API returns an error. Make sure that you encode the name of the coupon set in the path parameter before making an API call.
A specified number of units of the item price are offered for free. The number of free units is specified in discount_quantity.
The offer_quantity
option is valid only when apply_on
is set to each_specified_item
and the pricing_model
of the item price is per_unit.
Specifies the number of free units provided for the item price
, without affecting the total quantity sold. This parameter is applicable only when the discount_type
is set to offer_quantity
.
Specifies the time duration for which this coupon is attached to the subscription.
Possible values are
one_time
The coupon stays attached to the subscription till it is applied on an invoice once.
It is removed after that from the subscription.
forever
The coupon is attached to the subscription and applied on the invoices until explicitly removed.
limited_period
The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
.
(Deprecated)
The duration of time in months for which the coupon is attached to the subscription. Applicable only when duration_type
is limited_period.
Note:
This parameter has been deprecated. Use period
and period_unit
instead.
A customer-facing note added to all invoices associated with this API resource. This note becomes one among all the notes
displayed on the invoice PDF.
The coupon is included in MRR calculations for your site. This attribute is only applicable for coupons of duration_type = one_time
and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude one-time coupons from MRR calculations, this value is always returned false
.
Parameters for item_constraints. Multiple item_constraints can be passed by specifying unique indices. pass parameters as item_constraints[<param name>][<idx:0..n>]
Parameters for item_constraint_criteria. Multiple item_constraint_criteria can be passed by specifying unique indices. pass parameters as item_constraint_criteria[<param name>][<idx:0..n>]
Parameters for coupon_constraints. Multiple coupon_constraints can be passed by specifying unique indices. pass parameters as coupon_constraints[<param name>][<idx:0..n>]
The coupon can be redeemed up to a set number of times for a specific resource type. The maximum redemptions are specified using value
, and the resource type is specified using entity_type.
For example, if entity_type
is customer
and value
is 10
then the coupon can only be redeemed up to 10 times for any particular customer
record.
unique_by
Indicates-when entity_type
is customer
that the coupon can be redeemed only once for every unique value of a specified customer
attribute. The customer
attribute is specified using value.
For example, if value
is email
, then the coupon can be redeemed only once for every unique value of customer.email.
In other words, when there are multiple customer
records with the same value for email
, once the coupon has been redeemed for one of those customer records, no further redemptions of the coupon are allowed for any of those customer
records.
existing_customer
The coupon is applicable only for existing customer(s). A customer will be considered as existing_customer
when they have at least one non-void, non-zero-dollar invoice.
new_customer
The coupon is applicable only for new customer(s). A customer will be considered as new_customer
when they do not have any prior non-void, non-zero-dollar invoices.
List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
optional, string, max chars=1000 Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set 'offset' to the value of 'next_offset' obtained in the previous iteration of the API call.
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:
When the coupon ID contains a special character; for example: #, the API returns an error. Make sure that you encode the coupon ID in the path parameter before making an API call.
.
Supported operators :
is, is_not, starts_with, in, not_in
Example →id[is] = "OFF2008"
Possible values are : Supported operators : is, is_not, starts_with, in, not_in
Example →id[is] = "OFF2008"
+
id
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:
When the coupon ID contains a special character; for example: #, the API returns an error. Make sure that you encode the coupon ID in the path parameter before making an API call.
.
Supported operators :
is, is_not, starts_with, in, not_in
Example →id[is] = "OFF2008"
pass parameters as id[<param name>][<operator>]
id[is][operator]
id[is][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
id[is_not][operator]
id[is_not][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
id[starts_with][operator]
id[starts_with][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
id[in][operator]
id[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
id[not_in][operator]
id[not_in][operator]
optional, string filter Possible values are : Supported operators :
Example →
name[<operator>]
name[<operator>]
optional, string filter
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #, the API returns an error. Make sure that you encode the name of the coupon set in the path parameter before making an API call.
.
Supported operators :
is, is_not, starts_with, in, not_in
Example →name[is_not] = "Offer 10"
Possible values are : Supported operators : is, is_not, starts_with, in, not_in
Example →name[is] = "Offer 10"
+
name
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #, the API returns an error. Make sure that you encode the name of the coupon set in the path parameter before making an API call.
.
Supported operators :
is, is_not, starts_with, in, not_in
Example →name[is_not] = "Offer 10"
pass parameters as name[<param name>][<operator>]
name[is][operator]
name[is][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
name[is_not][operator]
name[is_not][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
name[starts_with][operator]
name[starts_with][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
name[in][operator]
name[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
name[not_in][operator]
name[not_in][operator]
optional, string filter Possible values are : Supported operators :
Example →
discount_type[<operator>]
discount_type[<operator>]
optional, enumerated string filter
The type of deduction.
Possible values are : fixed_amount, percentage, offer_quantity Supported operators : is, is_not, in, not_in
Example →discount_type[is] = "fixed_amount"
+
discount_type
The type of deduction.
pass parameters as discount_type[<param name>][<operator>]
discount_type[is][operator]
discount_type[is][operator]
optional, enumerated string filter Possible values are : fixed_amount, percentage, offer_quantity Supported operators :
Example →
discount_type[is_not][operator]
discount_type[is_not][operator]
optional, enumerated string filter Possible values are : fixed_amount, percentage, offer_quantity Supported operators :
Example →
discount_type[in][operator]
discount_type[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
discount_type[not_in][operator]
discount_type[not_in][operator]
optional, string filter Possible values are : Supported operators :
Example →
duration_type[<operator>]
duration_type[<operator>]
optional, enumerated string filter
Specifies the time duration for which this coupon is attached to the subscription.
Possible values are : one_time, forever, limited_period Supported operators : is, is_not, in, not_in
Example →duration_type[is] = "forever"
+
duration_type
Specifies the time duration for which this coupon is attached to the subscription.
pass parameters as duration_type[<param name>][<operator>]
duration_type[is][operator]
duration_type[is][operator]
optional, enumerated string filter Possible values are : one_time, forever, limited_period Supported operators :
Example →
duration_type[is_not][operator]
duration_type[is_not][operator]
optional, enumerated string filter Possible values are : one_time, forever, limited_period Supported operators :
Example →
duration_type[in][operator]
duration_type[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
duration_type[not_in][operator]
duration_type[not_in][operator]
optional, string filter Possible values are : Supported operators :
Example →
status[<operator>]
status[<operator>]
optional, enumerated string filter
Status of the coupon.
Possible values are : active, expired, archived, deleted, future Supported operators : is, is_not, in, not_in
Example →status[is] = "active"
+
status
Status of the coupon.
pass parameters as status[<param name>][<operator>]
status[is][operator]
status[is][operator]
optional, enumerated string filter Possible values are : active, expired, archived, deleted, future Supported operators :
Example →
status[is_not][operator]
status[is_not][operator]
optional, enumerated string filter Possible values are : active, expired, archived, deleted, future Supported operators :
Example →
status[in][operator]
status[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
status[not_in][operator]
status[not_in][operator]
optional, string filter Possible values are : Supported operators :
Example →
apply_on[<operator>]
apply_on[<operator>]
optional, enumerated string filter
The amount on the invoice to which the coupon is applied.
Possible values are : invoice_amount, each_specified_item Supported operators : is, is_not, in, not_in
Example →apply_on[is] = "invoice_amount"
+
apply_on
The amount on the invoice to which the coupon is applied.
pass parameters as apply_on[<param name>][<operator>]
apply_on[is][operator]
apply_on[is][operator]
optional, enumerated string filter Possible values are : invoice_amount, each_specified_item Supported operators :
Example →
apply_on[is_not][operator]
apply_on[is_not][operator]
optional, enumerated string filter Possible values are : invoice_amount, each_specified_item Supported operators :
Example →
apply_on[in][operator]
apply_on[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
apply_on[not_in][operator]
apply_on[not_in][operator]
optional, string filter Possible values are : Supported operators :
Example →
created_at[<operator>]
created_at[<operator>]
optional, timestamp(UTC) in seconds filter
Timestamp indicating when this coupon is created.
Supported operators :
after, before, on, between
Example →created_at[before] = "145222875"
Possible values are : Supported operators : after, before, on, between
Example →created_at[after] = "145222875"
+
created_at
Timestamp indicating when this coupon is created.
Supported operators :
after, before, on, between
Example →created_at[before] = "145222875"
pass parameters as created_at[<param name>][<operator>]
created_at[after][operator]
created_at[after][operator]
optional, timestamp(UTC) in seconds filter Possible values are : Supported operators :
Example →
created_at[before][operator]
created_at[before][operator]
optional, timestamp(UTC) in seconds filter Possible values are : Supported operators :
Example →
created_at[on][operator]
created_at[on][operator]
optional, timestamp(UTC) in seconds filter Possible values are : Supported operators :
Example →
created_at[between][operator]
created_at[between][operator]
optional, string filter Possible values are : Supported operators :
Example →
updated_at[<operator>]
updated_at[<operator>]
optional, timestamp(UTC) in seconds filter
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-11-09.
Supported operators :
after, before, on, between
Example →updated_at[on] = "1243545465"
Possible values are : Supported operators : after, before, on, between
Example →updated_at[after] = "1243545465"
+
updated_at
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-11-09.
Supported operators :
after, before, on, between
Example →updated_at[on] = "1243545465"
pass parameters as updated_at[<param name>][<operator>]
updated_at[after][operator]
updated_at[after][operator]
optional, timestamp(UTC) in seconds filter Possible values are : Supported operators :
Example →
updated_at[before][operator]
updated_at[before][operator]
optional, timestamp(UTC) in seconds filter Possible values are : Supported operators :
Example →
updated_at[on][operator]
updated_at[on][operator]
optional, timestamp(UTC) in seconds filter Possible values are : Supported operators :
Example →
updated_at[between][operator]
updated_at[between][operator]
optional, string filter Possible values are : Supported operators :
Example →
currency_code[<operator>]
currency_code[<operator>]
optional, string filter
The currency code (ISO 4217 format
) of the coupon. Applicable for fixed_amount
coupons alone.
Supported operators :
is, is_not, starts_with, in, not_in
Example →currency_code[is] = "USD"
Possible values are : Supported operators : is, is_not, starts_with, in, not_in
Example →currency_code[is] = "USD"
+
currency_code
The currency code (ISO 4217 format
) of the coupon. Applicable for fixed_amount
coupons alone.
Supported operators :
is, is_not, starts_with, in, not_in
Example →currency_code[is] = "USD"
pass parameters as currency_code[<param name>][<operator>]
currency_code[is][operator]
currency_code[is][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
currency_code[is_not][operator]
currency_code[is_not][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
currency_code[starts_with][operator]
currency_code[starts_with][operator]
optional, string, min chars=1 filter Possible values are : Supported operators :
Example →
currency_code[in][operator]
currency_code[in][operator]
optional, string filter Possible values are : Supported operators :
Example →
currency_code[not_in][operator]
currency_code[not_in][operator]
optional, string filter Possible values are : Supported operators :
always returned optional, string, max chars=1000 This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.
If no Subscriptions/Invoices are linked to this Coupon, the Coupon will be deleted from your Chargebee site. This action cannot be undone.
To ensure that existing Subscriptions/Invoices are not affected, Coupons associated with them will not be deleted, but moved to "Archived" state. Once a Coupon has been archived, it cannot be edited or used again unless unarchived. Unused Coupons codes are deleted.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
Try in API Explorer
Only for Java
copy full code
Click to Copy
curl https://{site}.chargebee.com/api/v2/coupons/beta/delete \
-X POST \
-u {site_api_key}:
Copies a coupon over from one site to another. Copying of archived coupons is not supported.
The item prices that are linked to the coupon in the source site are also linked to the coupon in the destination site. However, this will only work if those item prices exist and with the same ids, in the destination site. Hence, it is recommended that the item prices be copied over before copying the coupons.
The value for redemptions is not copied. It is set to 0 for the newly created coupon. Hence, if such a coupon had expired in the source site due to redemptions having reached max_redemptions, it's status would be active in the destination site.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Your Chargebee site name having the coupon to be copied.
Note:
Unless you are copying from a twin site (acme & acme-test are twin sites), contact support
to have this allow-listed.
If copy action is performed as part of Chargebee site merge action, pass the value as true.
Note:
If this parameter is passed true coupon state, redemptions, coupon set and coupon codes associated with this coupon will be copied.