Coupons

Find Coupon

GET
/coupons/find.json

Searches for a coupon by code.

If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, you need to specify (either in the URL or as a query string param) the product_family_id.

Authorization

BasicAuth
AuthorizationBasic <token>

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

In: header

Query Parameters

product_family_id?integer

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

code?string

The code of the coupon

currency_prices?boolean

(Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true to include an array of currency price data in the response.

Response Body

application/json

curl -X GET "https://example.com/coupons/find.json"
{  "coupon": {    "id": 0,    "name": "string",    "code": "string",    "description": "string",    "amount": 0,    "amount_in_cents": 0,    "product_family_id": 0,    "product_family_name": "string",    "start_date": "2019-08-24T14:15:22Z",    "end_date": "2019-08-24T14:15:22Z",    "percentage": "string",    "recurring": true,    "recurring_scheme": "do_not_recur",    "duration_period_count": 0,    "duration_interval": 0,    "duration_interval_unit": "string",    "duration_interval_span": "string",    "allow_negative_balance": true,    "archived_at": "2019-08-24T14:15:22Z",    "conversion_limit": "string",    "stackable": true,    "compounding_strategy": "compound",    "use_site_exchange_rate": true,    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "discount_type": "amount",    "exclude_mid_period_allocations": true,    "apply_on_cancel_at_end_of_period": true,    "apply_on_subscription_expiration": true,    "coupon_restrictions": [      {        "id": 0,        "item_type": "Component",        "item_id": 0,        "name": "string",        "handle": "string"      }    ],    "currency_prices": [      {        "id": 0,        "currency": "string",        "price": 0,        "coupon_id": 0      }    ]  }}