Sample coupon set [ JSON ]

{ "archived_count": 0, "coupon_id": "beta", "id": "cs_3RtyuIHol", "name": "Launch Promotion", "object": "coupon_set", "redeemed_count": 0, "total_count": 0 }
id
Uniquely identifies a coupon_set.
string, max chars=50
coupon_id
Coupon id linked to coupon set.
string, max chars=100
name
Name of the coupon set.
string, max chars=50
total_count
No of coupon codes present in coupon set.
optional, integer
redeemed_count
No of redeemed codes.
optional, integer
archived_count
No of archived codes.
optional, integer
meta_data
A set of key-value pairs stored as additional information for the subscription. Learn more.
optional, jsonobject
Create a coupon set.
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets \
     -u {site_api_key}:\
     -d coupon_id="beta" \
     -d name="Launch Promotion" \
     -d id="cs_3RtyuIHol"
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets \
     -u {site_api_key}:\
     -d coupon_id="beta" \
     -d name="Launch Promotion" \
     -d id="cs_3RtyuIHol"

Sample Response [ JSON ]

Show more...
{"coupon_set": { "archived_count": 0, "coupon_id": "beta", "id": "cs_3RtyuIHol", "name": "Launch Promotion", "object": "coupon_set", "redeemed_count": 0, "total_count": 0 }}

URL Format POST

https://{site}.chargebee.com/api/v2/coupon_sets
coupon_id
Coupon id linked to coupon set.
required, string, max chars=100
name
Name of the coupon set.
required, string, max chars=50
id
Uniquely identifies a coupon_set.
required, string, max chars=50
meta_data
A set of key-value pairs stored as additional information for the subscription. Learn more.
optional, jsonobject
Resource object representing coupon_set.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuLol/add_coupon_codes \
     -u {site_api_key}:\
     -d code[0]="CBCC789"
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuLol/add_coupon_codes \
     -u {site_api_key}:\
     -d code[0]="CBCC789"

Sample Response [ JSON ]

Show more...
{"coupon_set": { "archived_count": 0, "coupon_id": "sample_coupon", "id": "cs_3RtyuLol", "name": "Weekend Offer", "object": "coupon_set", "redeemed_count": 0, "total_count": 1 }}

URL Format POST

https://{site}.chargebee.com/api/v2/coupon_sets/{coupon_set_id}/add_coupon_codes
code[0..n]
You can pass up to 100 values per API call. You can also use the Chargebee UI to pass up to 1000 codes per operation. There is no limit on the total number of coupon codes that can be included in a coupon set.
optional, list of string
Resource object representing coupon_set.
always returned
List the available coupon sets.
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=2
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=2

Sample Response [ JSON ]

Show more...
{ "list": [ {"coupon_set": { "archived_count": 0, "coupon_id": "sample_coupon", "id": "cs_3RtyuLol", "name": "Weekend Offer", "object": "coupon_set", "redeemed_count": 0, "total_count": 1 }}, {..} ], "next_offset": "[\"154000000001\",\"1517501418000\"]" }

URL Format GET

https://{site}.chargebee.com/api/v2/coupon_sets
limit
The number of resources to be returned.
optional, integer, default=10, min=1, max=100
offset
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.
optional, string, max chars=1000
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
Uniquely identifies a coupon_set.
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "bulk-codes-1"
optional, string filter
name[<operator>]
Name of the coupon set.
Supported operators : is, is_not, starts_with, in, not_in

Example name[is_not] = "bulk-codes-1"
optional, string filter
coupon_id[<operator>]
Coupon id linked to coupon set.
Supported operators : is, is_not, starts_with, in, not_in

Example coupon_id[is] = "OFF2008"
optional, string filter
total_count[<operator>]
No of coupon codes present in coupon set.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example total_count[lt] = "10"
optional, integer filter
redeemed_count[<operator>]
No of redeemed codes.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example redeemed_count[is] = "5"
optional, integer filter
archived_count[<operator>]
No of archived codes.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example archived_count[gte] = "2"
optional, integer filter
Resource object representing coupon_set.
always returned
next_offset
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”.
optional, string, max chars=1000
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuLop \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuLop \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"coupon_set": { "archived_count": 0, "coupon_id": "beta2", "id": "cs_3RtyuLop", "name": "Clearance Offer", "object": "coupon_set", "redeemed_count": 0, "total_count": 0 }}

URL Format GET

https://{site}.chargebee.com/api/v2/coupon_sets/{coupon_set_id}
Resource object representing coupon_set.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3Rtyuqop/update \
     -X POST  \
     -u {site_api_key}:\
     -d name="Promotional Offer"
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3Rtyuqop/update \
     -X POST  \
     -u {site_api_key}:\
     -d name="Promotional Offer"

Sample Response [ JSON ]

Show more...
{"coupon_set": { "archived_count": 0, "coupon_id": "beta3", "id": "cs_3Rtyuqop", "name": "Promotional Offer", "object": "coupon_set", "redeemed_count": 0, "total_count": 0 }}

URL Format POST

https://{site}.chargebee.com/api/v2/coupon_sets/{coupon_set_id}/update
name
Name of the coupon set.
optional, string, max chars=50
meta_data
A set of key-value pairs stored as additional information for the subscription. Learn more.
optional, jsonobject
Resource object representing coupon_set.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3Rtyupop/delete \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3Rtyupop/delete \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"coupon_set": { "archived_count": 0, "coupon_id": "beta4", "id": "cs_3Rtyupop", "name": "Launch Offer", "object": "coupon_set", "redeemed_count": 0, "total_count": 0 }}

URL Format POST

https://{site}.chargebee.com/api/v2/coupon_sets/{coupon_set_id}/delete
Resource object representing coupon_set.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuSuN/delete_unused_coupon_codes \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuSuN/delete_unused_coupon_codes \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"coupon_set": { "archived_count": 0, "coupon_id": "beta5", "id": "cs_3RtyuSuN", "name": "Welcome Offer", "object": "coupon_set", "redeemed_count": 0, "total_count": 0 }}

URL Format POST

https://{site}.chargebee.com/api/v2/coupon_sets/{coupon_set_id}/delete_unused_coupon_codes
Resource object representing coupon_set.
always returned