Sample coupon set [ JSON ]

{ "id": "_cs_Xcrtyqw", "coupon_id": "beta", "name": "Promo Coupon Codes", "object": "coupon_set", "total_count": 1, "redeemed_count": 0, "archived_count": 0 }
id
Uniquely identifies a coupon_set.
string, max chars=50
coupon_id
Coupon id linked to coupon set.
string, max chars=50
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
Additional data about this resource can be stored here in the JSON Format. 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 ]

{"coupon_set": { "id": "cs_3RtyuIHol", "coupon_id": "beta", "name": "Launch Promotion", "object": "coupon_set", "total_count": 0, "redeemed_count": 0, "archived_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=50
name
Name of the coupon set.
required, string, max chars=50
id
Uniquely identifies a coupon_set.
required, string, max chars=50
meta_data
Additional data about this resource can be stored here in the JSON Format. Learn more.
optional, jsonobject
Resource object representing coupon_set.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/_cs_Xcrtyqw/add_coupon_codes \
     -u {site_api_key}: \
     -d code[1]="CBCC789"
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/_cs_Xcrtyqw/add_coupon_codes \
     -u {site_api_key}: \
     -d code[1]="CBCC789"

Sample Response [ JSON ]

{"coupon_set": { "id": "_cs_Xcrtyqw", "coupon_id": "beta", "name": "Promo Coupon Codes", "object": "coupon_set", "total_count": 3, "redeemed_count": 0, "archived_count": 1 }}

URL Format POST

https://{site}.chargebee.com/api/v2/coupon_sets/{coupon_set_id}/add_coupon_codes
code[0..n]
List of coupon codes.
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="5"
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5"

Sample Response [ JSON ]

{ "list": [ {"coupon_set": { "id": "_cs_Xcrtyqw", "coupon_id": "beta", "name": "Promo Coupon Codes", "object": "coupon_set", "total_count": 3, "redeemed_count": 0, "archived_count": 1 }}, {..} ], "next_offset": "[\"111000000009\",\"1510107844000\"]" }

URL Format GET

https://{site}.chargebee.com/api/v2/coupon_sets
limit
Limits the number of resources to be returned.
optional, integer, default=10, min=1, max=100
offset
Allows you to fetch the next set of resources. The value used for this parameter must be the value returned for next_offset parameter in the previous API call.
optional, string, max chars=1000
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
To filter based on CouponSet Id.
Supported operators : is, is_not, starts_with, in, not_in

Example id[is_not] = "bulk-codes-1"
optional, string filter
name[<operator>]
To filter based on CouponSet Name.
Supported operators : is, is_not, starts_with, in, not_in

Example name[is] = "bulk-codes-1"
optional, string filter
coupon_id[<operator>]
To filter based on CouponSet Coupon Id.
Supported operators : is, is_not, starts_with, in, not_in

Example coupon_id[is] = "OFF2008"
optional, string filter
total_count[<operator>]
To filter based on Total Count.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example total_count[is] = "10"
optional, integer filter
redeemed_count[<operator>]
To filter based on Redeemed Count.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example redeemed_count[lt] = "5"
optional, integer filter
archived_count[<operator>]
To filter based on Archived Count.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example archived_count[gt] = "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_Xcrtyqw \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/_cs_Xcrtyqw \
     -u {site_api_key}:

Sample Response [ JSON ]

{"coupon_set": { "id": "_cs_Xcrtyqw", "coupon_id": "beta", "name": "Promo Coupon Codes", "object": "coupon_set", "total_count": 3, "redeemed_count": 0, "archived_count": 1 }}

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_Xcrtyqw/update \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/_cs_Xcrtyqw/update \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

{"coupon_set": { "id": "_cs_Xcrtyqw", "coupon_id": "beta", "name": "Promo Coupon Codes", "object": "coupon_set", "total_count": 3, "redeemed_count": 0, "archived_count": 1 }}

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
Additional data about this resource can be stored here in the JSON Format. Learn more.
optional, jsonobject
Resource object representing coupon_set.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuIHol/delete \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/cs_3RtyuIHol/delete \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

{"coupon_set": { "id": "cs_3RtyuIHol", "coupon_id": "beta", "name": "Launch Promotion", "object": "coupon_set", "total_count": 0, "redeemed_count": 0, "archived_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_Xcrtyqw/delete_unused_coupon_codes \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/coupon_sets/_cs_Xcrtyqw/delete_unused_coupon_codes \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

{"coupon_set": { "id": "_cs_Xcrtyqw", "coupon_id": "beta", "name": "Promo Coupon Codes", "object": "coupon_set", "total_count": 1, "redeemed_count": 0, "archived_count": 1 }}

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