Offers

List Offers

GET
/offers.json

Lists offers for a site.

Authorization

BasicAuth
AuthorizationBasic <token>

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

In: header

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 20. 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
Default20
include_archived?boolean

Include archived products. Use in query: include_archived=true.

Response Body

application/json

application/json

curl -X GET "https://example.com/offers.json"
{  "offers": [    {      "id": 239,      "site_id": 48110,      "product_family_id": 1025627,      "product_family_name": "Gold",      "product_id": 110,      "product_name": "Pro",      "product_price_in_cents": 1000,      "product_revisable_number": 0,      "product_price_point_id": 138,      "product_price_point_name": "Default",      "name": "Third Offer",      "handle": "third",      "description": "",      "created_at": "2018-08-03T09:56:11-05:00",      "updated_at": "2018-08-03T09:56:11-05:00",      "archived_at": null,      "offer_items": [        {          "component_id": 426665,          "component_name": "Database Size (GB)",          "component_unit_price": "1.0",          "price_point_id": 149438,          "price_point_name": "Auto-created",          "starting_quantity": "0.0",          "editable": false        }      ],      "offer_discounts": [        {          "coupon_id": 234,          "coupon_code": "GR8_CUSTOMER",          "coupon_name": "Multi-service Discount"        }      ],      "offer_signup_pages": [        {          "id": 356482,          "nickname": "ggoods",          "enabled": true,          "return_url": "",          "return_params": "",          "url": "https://general-goods.chargifypay.com/subscribe/hjpvhnw63tzy"        }      ]    }  ]}

Activate Subscription PUT

Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. - If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not change. The subscription’s billing period also remains the same. - If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that is always canceled. The default activation failure behavior can be configured per activation attempt, or you can set a default value under Config > Settings > Subscription Activation Settings. ## Activation Scenarios ### Activate Awaiting Signup subscription - Given you have a product without trial - Given you have a site without dunning strategy ```mermaid flowchart LR AS[Awaiting Signup] --> A{Activate} A -->|Success| Active A -->|Failure| ROF{revert_on_failure} ROF -->|true| AS ROF -->|false| Canceled ``` - Given you have a product with trial - Given you have a site with dunning strategy ```mermaid flowchart LR AS[Awaiting Signup] --> A{Activate} A -->|Success| Trialing A -->|Failure| ROF{revert_on_failure} ROF -->|true| AS ROF -->|false| PD[Past Due] ``` ### Activate Trialing subscription For more information about the behavior of trialing subscriptions, see [Trialing Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; the invoice from activation is voided, and any prepayments and credits applied to the invoice are returned to the subscription.

Create Offer POST

Creates an offer within your site. Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products. Once an offer is defined it can be used as an alternative to the product when creating subscriptions. For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the product documentation. ## Using a Product Price Point You can optionally pass in a `product_price_point_id` that corresponds with the `product_id` and the offer will use that price point. If a `product_price_point_id` is not passed in, the product's default price point will be used.