Applies one or more coupon codes to an existing subscription.
An existing subscription can accommodate multiple discounts/coupon codes. This is only applicable if each coupon is stackable. For more information on stackable coupons, we recommend reviewing our coupon documentation.
Passing in a coupon code as a query parameter will add the code to the subscription, completely replacing all existing coupon codes on the subscription.
For this reason, using this query parameter on this endpoint has been deprecated in favor of using the request body parameters as described below. When passing in request body parameters, the list of coupon codes will simply be added to any existing list of codes on the subscription.
The username is a Maxio Chargify API key and the password is x. Basic authentication works only with the US and EU environments, which connect to chargify.com directly. The Maxio API Gateway environment does not accept Basic authentication.
In: header
The Chargify id of the subscription.
A code for the coupon that would be applied to a subscription
application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
curl -X POST \ --url 'https://subdomain.chargify.com/subscriptions/1/add_coupon.json' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "codes": [ "COUPON_1", "COUPON_2" ]}'