POST /coupons
This API creates a new coupon for a specific promotion or offers.
Servers
- {protocol}://{site}.{environment}:{port}/api/v1
- {protocol}://{site}-test.{environment}:{port}/api/v1
Request headers
Name | Type | Required | Description |
---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Possible values:
|
chargebee-event-actions |
String | No |
skip all actions to be done on the events Possible values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header |
chargebee-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
discount_quantity |
Integer | No | |
invoice_name |
String | No |
Display name used in invoice. If it is not configured then name is used in invoice. |
meta_data |
Object | No |
A set of key-value pairs stored as additional information for the coupon. [Learn more](./#meta_data). |
valid_till |
Integer | No |
Date upto which the coupon can be applied to new subscriptions. |
plan_constraint |
String | No |
Plans the coupon can be applied to. * all - Coupon applicable to all plans. * specific - Coupon only applicable to specified plans. If used, it is mandatory to specify the plan(s). * none - Coupon not applicable to any plans. Possible values:
|
max_redemptions |
Integer | No |
Maximum number of times this coupon can be redeemed. If not specified, the coupon can be redeemed an indefinite number of times. . |
duration_month |
Integer | No |
(Deprecated) The duration of time in months for which the coupon is attached to the subscription. Applicable only when |
invoice_notes |
String | No |
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. |
id |
String | Yes |
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee. When the coupon ID contains a special character; for example: |
apply_on |
String | Yes |
The amount on the invoice to which the coupon is applied. * invoice_amount - The coupon is applied to the invoice Possible values:
|
plan_ids[] |
Array | No |
Identifier of the plan. |
name |
String | Yes |
The display name used in web interface for identifying the coupon. When the name of the coupon set contains a special character; for example: |
addon_constraint |
String | No |
Addons the coupon can be applied to. * specific - Coupon only applicable to specified addons. If used, it is mandatory to specify the addon(s). * all - Coupon applicable to all addons. * none - Coupon not applicable to any addons. Possible values:
|
duration_type |
String | No |
Specifies the time duration for which this coupon is attached to 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 Possible values:
Default value: "forever" |
discount_type |
String | No |
The type of deduction. * fixed_amount - The specified amount will be deducted. * percentage - The specified percentage will be deducted. * offer_quantity - Applies a discount based on the number of free units offered in a per unit plan subscription without reducing the total quantity sold. Possible values:
Default value: "percentage" |
addon_ids[] |
Array | No |
Identifier of the addon. |
discount_amount |
Integer | No |
The value of the deduction. The format of this value depends on the kind of currency. |
discount_percentage |
Number | No |
The percentage of the original amount that should be deducted from it. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.