This API creates a new coupon for a specific promotion or offers.
Prerequisites & Constraints
discount_percentageis required whendiscount_typeispercentage.discount_amountis required whendiscount_typeisfixed_amount.
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
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.
.
idmust be unique across all coupons on the site.
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.
.
namemust be unique across all coupons on the site.
Specifies the type of discount to be applied.
- Offer Quantity coupons must be enabled for your site to set
discount_typetooffer_quantity.
A fixed amount is deducted as a discount. The discount amount is specified in discount_amount.
Learn more
about fixed_amount
coupons.
A percentage of the original price is deducted as a discount. The discount percentage is specified in discount_percentage.
Learn more
about percentage
coupons.
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.
Learn more
about offer_quantity
coupons.
The value of the deduction. The format of this value depends on the kind of currency .
discount_amountcan be provided only whendiscount_typeisfixed_amount.
The currency code (ISO 4217 format ) of the coupon. Applicable for fixed_amount coupons alone.
currency_codecan be provided only whendiscount_typeisfixed_amount.currency_codemust be a valid currency code.
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
.
discount_quantitycan be provided only whendiscount_typeisoffer_quantity.
The amount on the invoice to which the coupon is applied.
apply_onmust beeach_specified_itemwhendiscount_typeisoffer_quantity.
The coupon is applied to the invoice sub_total
.
Applies the coupon to specified items (plans, addons, or charges), with the discount applied to each matching invoice.line_item.amount.
Requires applicability to be configured using item_constraints—for example all, criteria, or specific with item_price_ids.
When you attach this coupon to a subscription, at least one of that subscription's plans, addons, or charges must match those rules. If none do, the request fails.
Specifies the time duration for which this coupon is attached to the subscription.
The coupon stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.
The coupon is attached to the subscription and applied on the invoices until explicitly removed.
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.
duration_monthcan be provided only whenduration_typeislimited_period.
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.
A collection of key-value pairs that provides extra information about the coupon.
Note: There's a character limit of 65,535.
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
.
The duration of time for which the coupon is attached to the subscription, in period_units.
Applicable only when duration_type
is limited_period
.
periodcan be provided only whenduration_typeislimited_period.
The unit of time for period. Applicable only when duration_type
is limited_period
.
period_unitcan be provided only whenduration_typeislimited_period.
A period of 24 hours.
A period of 7 days.
A period of 1 calendar month.
A period of 1 calendar year.