Find Coupon
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 The username is a Maxio Chargify API key. The password is x.
In: header
Query Parameters
The Advanced Billing id of the product family to which the coupon belongs
The code of the coupon
(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 } ] }}Create Coupon POST
Creates a coupon under the specified product family. You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI.
Read Coupon GET
Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID parameter assigned to it. If instead you would like to find a Coupon using a Coupon code, use the [Find Coupon](https://maxio-test-wp.pages.dev/api/openapi/coupons/findCoupon) endpoint. If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the flag is set to false, it returns all of the defined prices for each currency.