Coupons

Create Coupon Subcodes

POST
/coupons/{coupon_id}/codes.json

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 %2E

So, 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
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

coupon_id*integer

The Advanced Billing id of the coupon

Request Body

application/json

codes?array<string>

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"  ]}