Coupons

List Coupons for Product Family

GET
/product_families/{product_family_id}/coupons.json

Lists coupons for a specific product family in a site.

Authorization

BasicAuth
AuthorizationBasic <token>

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

In: header

Path Parameters

product_family_id*integer

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

Query Parameters

page?integer

Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned. Use in query page=1.

Range1 <= value
Default1
per_page?integer

This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. Use in query per_page=200.

Rangevalue <= 200
Default30
filter?

Filter to use for List Coupons operations

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. Use in query currency_prices=true.

Response Body

application/json

curl -X GET "https://example.com/product_families/0/coupons.json"
[  {    "coupon": {      "id": 999999,      "name": "50% coupon",      "code": "50PERCENT",      "description": "50 PERCENT OFF",      "amount_in_cents": null,      "product_family_id": 527890,      "created_at": "2016-10-21T17:02:08-04:00",      "updated_at": "2016-10-21T17:06:11-04:00",      "start_date": "2016-10-21T17:02:08-04:00",      "end_date": null,      "percentage": "50",      "recurring": true,      "duration_period_count": null,      "duration_interval": 1,      "duration_interval_unit": "day",      "allow_negative_balance": true,      "archived_at": null,      "conversion_limit": "100",      "stackable": false,      "compounding_strategy": "compound",      "use_site_exchange_rate": true    }  },  {    "coupon": {      "id": 123456,      "name": "100% coupon",      "code": "100PERCENT",      "description": "100 PERCENT OFF",      "amount_in_cents": null,      "product_family_id": 527890,      "created_at": "2016-10-21T17:02:08-04:00",      "updated_at": "2016-10-21T17:06:11-04:00",      "start_date": "2016-10-21T17:02:08-04:00",      "end_date": null,      "percentage": "50",      "recurring": true,      "duration_period_count": null,      "duration_interval": 1,      "duration_interval_unit": "day",      "allow_negative_balance": true,      "archived_at": null,      "conversion_limit": "100",      "stackable": false,      "compounding_strategy": "compound",      "use_site_exchange_rate": true    }  },  {    "coupon": {      "id": 888888,      "name": "25% coupon",      "code": "25PERCENT",      "description": "25 PERCENT OFF",      "amount_in_cents": null,      "product_family_id": 527890,      "created_at": "2016-10-21T17:02:08-04:00",      "updated_at": "2016-10-21T17:06:11-04:00",      "start_date": "2016-10-21T17:02:08-04:00",      "end_date": null,      "percentage": "25",      "recurring": true,      "duration_period_count": null,      "duration_interval": 1,      "duration_interval_unit": "day",      "allow_negative_balance": true,      "archived_at": null,      "conversion_limit": "100",      "stackable": false,      "compounding_strategy": "compound",      "coupon_restrictions": [        {          "id": 37,          "item_type": "Component",          "item_id": 519,          "name": "test",          "handle": null        }      ],      "use_site_exchange_rate": true    }  }]