Coupons

Validate Coupon

GET
/coupons/validate.json

Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer.

If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, you need to specify the product family, either in the URL or as a query string param. This can be done by supplying the id or the handle in the handle:my-family format.

Supplying the product_family_handle in the URL:

https://<subdomain>.chargify.com/product_families/handle:<product_family_handle>/coupons/validate.<format>?code=<coupon_code>

Supplying the product_family_id as a query parameter:

https://<subdomain>.chargify.com/coupons/validate.<format>?code=<coupon_code>&product_family_id=<id>

Authorization

BasicAuth
AuthorizationBasic <token>

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

In: header

Query Parameters

code*string

The code of the coupon

product_family_id?integer

The Advanced Billing id of the product family to which the coupon belongs

Response Body

application/json

application/json

curl -X GET "https://example.com/coupons/validate.json?code=string"
{  "coupon": {    "id": 66,    "name": "Foo Bar",    "code": "YEPPER9993",    "description": "my cool coupon",    "amount_in_cents": 10000,    "product_family_id": 4,    "created_at": "2017-11-07T14:51:52-05:00",    "updated_at": "2017-11-07T15:14:24-05:00",    "start_date": "2017-11-07T14:51:52-05:00",    "end_date": null,    "percentage": null,    "recurring": false,    "duration_period_count": null,    "duration_interval": null,    "duration_interval_unit": null,    "allow_negative_balance": false,    "archived_at": null,    "conversion_limit": null,    "stackable": true,    "compounding_strategy": "full-price"  }}