Create Coupon Subcodes
Creates subcodes for an existing coupon.
Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon.
For example:
Master Coupon Code:
- SPRING2020
Coupon Subcodes:
- SPRING90210
- DP80302
- SPRINGBALTIMORE
When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters are capitalized before the subcode is created.
Note: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL.
% to %25@ to %40+ to %2B- to %2D_ to %5F. to %2ESo, if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>.
For more information on coupon codes and applying coupons to subscriptions, see Coupon Codes and Coupons and Subscriptions.
Authorization
BasicAuth The username is a Maxio Chargify API key. The password is x.
In: header
Path Parameters
The Advanced Billing id of the coupon
Request Body
application/json
Response Body
application/json
curl -X POST "https://example.com/coupons/0/codes.json" \ -H "Content-Type: application/json" \ -d '{ "codes": [ "BALTIMOREFALL", "ORLANDOFALL", "DETROITFALL" ] }'{ "created_codes": [ "BALTIMOREFALL", "ORLANDOFALL", "DETROITFALL" ]}List Coupon Subcodes GET
Lists the subcodes attached to a coupon.
Update Coupon Subcodes PUT
Updates the subcodes for a coupon, replacing all existing subcodes with the new list. Send an array of new coupon subcodes. **Note**: All current subcodes for that Coupon will be deleted first, and replaced with the list of subcodes sent to this endpoint. The response will contain: + The created subcodes, + Subcodes that were not created because they already exist, + Any subcodes not created because they are invalid.