Coupon codes are used along with existing coupons in Chargebee. You can create a coupon set using a bunch of coupon codes and this coupon set will be associated with an existing coupon. A coupon code can only be applied to a single subscription and cannot be re-used.
Using coupon codes you can distribute several unique codes for a single main coupon, when you are running promotions.
Sample coupon code [ JSON ]
{
"code": "CBCCN345",
"coupon_id": "alpha1",
"coupon_set_name": "Welcome Offer",
"object": "coupon_code"
}
API Index URL GET
https://{site}.chargebee.com/api/v1/coupon_codes
string, max chars=50 Unique coupon code that can be redeemed only once.
string, max chars=100 Id of the main coupon resource.
string, max chars=50 Coupon set name to which this coupon code would be grouped under. If the coupon set with the passed name is not present, a new coupon set will be created.
This is a list of the event types we currently support. We will continue
to add more events moving forward. All events follow a uniform pattern -
<resource>_<event_name>. The resources that will be
present in the event content are provided beneath each event type's
description.
Note: If consolidated invoicing is enabled, the
attributes invoice.subscription_id and
credit_note.subscription_id should not be used
(as it will not be present if the invoice / credit note has lines from
multiple subscriptions). Instead to know the related subscriptions,
their line_items' subscription_id attribute should be referred.
string, max chars=50 Unique coupon code that can be redeemed only once.
string, max chars=100 Id of the main coupon resource.
string, max chars=50 Coupon set name to which this coupon code would be grouped under. If the coupon set with the passed name is not present, a new coupon set will be created. Create a new coupon code and associate it to an existing main coupon resource.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"coupon_code": {
"code": "CBCCN345",
"coupon_id": "alpha1",
"coupon_set_name": "Welcome Offer",
"object": "coupon_code"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v1/coupon_codes
required, string, max chars=100 Id of the main coupon resource.
required, string, max chars=50 Coupon set name to which this coupon code would be grouped under. If the coupon set with the passed name is not present, a new coupon set will be created.
required, string, max chars=50 Unique coupon code that can be redeemed only once.
always returned required
Resource object representing coupon_code
Sample admin console URL
https://{site}.chargebee.com/admin-console/coupon_codes/123x
Retrieves a specific coupon code details.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"coupon_code": {
"code": "CBC978B",
"coupon_id": "alpha",
"coupon_set_name": "Offer",
"object": "coupon_code"
}
}
URL Format
GET
https://{site}.chargebee.com/api/v1/coupon_codes/{coupon-code-code}
always returned required
Resource object representing coupon_code
Sample admin console URL
https://{site}.chargebee.com/admin-console/coupon_codes/123x