Subscription Status

Update Automatic Subscription Resumption

PUT
/subscriptions/{subscription_id}/hold.json

Updates the date on which a paused subscription will automatically resume.

To update a subscription's resume date, use this method to change or update the automatically_resume_at date.

Remove the resume date

Alternatively, you can change the automatically_resume_at to null if you would like the subscription to not have a resume date.

Authorization

BasicAuth
AuthorizationBasic <token>

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

In: header

Path Parameters

subscription_id*integer

The Chargify id of the subscription.

Request Body

application/json

Allows you to pause a Subscription.

hold?

Response Body

application/json

application/json

curl -X PUT "https://example.com/subscriptions/0/hold.json" \  -H "Content-Type: application/json" \  -d '{    "hold": {      "automatically_resume_at": "2019-01-20T00:00:00"    }  }'
{  "subscription": {    "id": 20359140,    "state": "on_hold",    "trial_started_at": null,    "trial_ended_at": null,    "activated_at": "2018-01-05T17:15:50-06:00",    "created_at": "2018-01-05T17:15:49-06:00",    "updated_at": "2018-01-09T10:26:14-06:00",    "expires_at": null,    "balance_in_cents": 0,    "current_period_ends_at": "2023-01-05T17:15:00-06:00",    "next_assessment_at": "2023-01-05T17:15:00-06:00",    "canceled_at": null,    "cancellation_message": null,    "next_product_id": null,    "cancel_at_end_of_period": false,    "payment_collection_method": "automatic",    "snap_day": null,    "cancellation_method": null,    "current_period_started_at": "2018-01-05T17:15:49-06:00",    "previous_state": "active",    "signup_payment_id": 219829722,    "signup_revenue": "100.00",    "delayed_cancel_at": null,    "coupon_code": null,    "total_revenue_in_cents": 10009991,    "product_price_in_cents": 10000,    "product_version_number": 1,    "payment_type": "credit_card",    "referral_code": "8y7jqr",    "coupon_use_count": null,    "coupon_uses_allowed": null,    "reason_code": null,    "automatically_resume_at": "2019-01-20T00:00:00-06:00",    "customer": {      "id": 19948683,      "first_name": "Vanessa",      "last_name": "Test",      "organization": "",      "email": "vanessa@example.com",      "created_at": "2018-01-05T17:15:49-06:00",      "updated_at": "2018-01-05T17:15:51-06:00",      "reference": null,      "address": "123 Anywhere Ln",      "address_2": "",      "city": "Boston",      "state": "MA",      "zip": "02120",      "country": "US",      "phone": "555-555-1212",      "portal_invite_last_sent_at": "2018-01-05T17:15:51-06:00",      "portal_invite_last_accepted_at": null,      "verified": null,      "portal_customer_created_at": "2018-01-05T17:15:51-06:00",      "cc_emails": null,      "tax_exempt": false    },    "product": {      "id": 4535643,      "name": "Annual Product",      "handle": "annual-product",      "description": "",      "accounting_code": "",      "request_credit_card": true,      "expiration_interval": null,      "expiration_interval_unit": "never",      "created_at": "2017-08-25T10:25:31-05:00",      "updated_at": "2017-08-25T10:25:31-05:00",      "price_in_cents": 10000,      "interval": 12,      "interval_unit": "month",      "initial_charge_in_cents": null,      "trial_price_in_cents": null,      "trial_interval": null,      "trial_interval_unit": "month",      "archived_at": null,      "require_credit_card": true,      "return_params": "",      "taxable": false,      "update_return_url": "",      "tax_code": "",      "initial_charge_after_trial": false,      "version_number": 1,      "update_return_params": "",      "product_family": {        "id": 1025627,        "name": "Acme Products",        "description": "",        "handle": "acme-products",        "accounting_code": null      }    },    "credit_card": {      "id": 13826563,      "first_name": "Bomb 3",      "last_name": "Test",      "masked_card_number": "XXXX-XXXX-XXXX-1",      "card_type": "bogus",      "expiration_month": 1,      "expiration_year": 2028,      "customer_id": 19948683,      "current_vault": "bogus",      "vault_token": "1",      "billing_address": "123 Anywhere Lane",      "billing_city": "Boston",      "billing_state": "Ma",      "billing_zip": "02120",      "billing_country": "US",      "customer_vault_token": null,      "billing_address_2": "",      "payment_type": "credit_card"    }  }}

Hold / Pause Subscription POST

Places the subscription on hold, preventing it from renewing. ## Limitations You may not place a subscription on hold if the `next_billing_at` date is within 24 hours.

Reactivate Subscription PUT

Reactivates a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). **Note: The term "resume" is used also during another process in Advanced Billing. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** + The response returns the subscription object in the `active` or `trialing` state. + The `canceled_at` and `cancellation_message` fields do not have values. + The method works for "Canceled" or "Trial Ended" subscriptions. + It will not work for items not marked as "Canceled", "Unpaid", or "Trial Ended". ## Resume the current billing period for a subscription A subscription is considered "resumable" if you are attempting to reactivate within the billing period the subscription was canceled in. A resumed subscription's billing date remains the same as before it was canceled. In other words, it does not start a new billing period. Payment may or may not be collected for a resumed subscription, depending on whether or not the subscription had a balance when it was canceled (for example, if it was canceled because of dunning). Consider a subscription which was created on June 1st, and would renew on July 1st. The subscription is then canceled on June 15. If a reactivation with `resume: true` were attempted _before_ what would have been the next billing date of July 1st, then Advanced Billing would resume the subscription. If a reactivation with `resume: true` were attempted _after_ what would have been the next billing date of July 1st, then Advanced Billing would not resume the subscription, and instead it would be reactivated with a new billing period. If a reactivation with `resume: false`, or where 'resume' is omitted were attempted, then Advanced Billing would reactivate the subscription with a new billing period regardless of whether or not resuming the previous billing period was possible. | Canceled | Reactivation | Resumable? | |---|---|---| | Jun 15 | June 28 | Yes | | Jun 15 | July 2 | No | ## Reactivation Scenarios ### Reactivating Canceled Subscription While Preserving Balance + Given you have a product that costs $20 + Given you have a canceled subscription to the $20 product + 1 charge should exist for $20 + 1 payment should exist for $20 + When the subscription has canceled due to dunning, it retained a negative balance of $20 #### Results The resulting charges upon reactivation will be: + 1 charge for $20 for the new product + 1 charge for $20 for the balance due + Total charges = $40 + The subscription will transition to active + The subscription balance will be zero ### Reactivating a Canceled Subscription With Coupon + Given you have a canceled subscription + It has no current period defined + You have a coupon code "EARLYBIRD" + The coupon is set to recur for 6 periods PUT request sent to: `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?coupon_code=EARLYBIRD` #### Results + The subscription will transition to active + The subscription should have applied a coupon with code "EARLYBIRD" ### Reactivating Canceled Subscription With a Trial, Without the include_trial Flag + Given you have a canceled subscription + The product associated with the subscription has a trial + PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` #### Results + The subscription will transition to active ### Reactivating Canceled Subscription With Trial, With the include_trial Flag + Given you have a canceled subscription + The product associated with the subscription has a trial + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?include_trial=1` #### Results + The subscription will transition to trialing ### Reactivating Trial Ended Subscription + Given you have a trial_ended subscription + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` #### Results + The subscription will transition to active ### Resuming a Canceled Subscription + Given you have a `canceled` subscription and it is resumable + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` #### Results + The subscription will transition to active + The next billing date should not have changed ### Attempting to resume a subscription which is not resumable + Given you have a `canceled` subscription, and it is not resumable + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` #### Results + The subscription will transition to active, with a new billing period. ### Attempting to resume but not reactivate a subscription which is not resumable + Given you have a `canceled` subscription, and it is not resumable + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume[require_resume]=true` + The response status should be "422 UNPROCESSABLE ENTITY" + The subscription should be canceled with the following response ``` { "errors": ["Request was 'resume only', but this subscription cannot be resumed."] } ``` #### Results + The subscription should remain `canceled` + The next billing date should not have changed ### Resuming Subscription Which Was Trialing + Given you have a `trial_ended` subscription, and it is resumable + And the subscription was canceled in the middle of a trial + And there is still time left on the trial + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` #### Results + The subscription will transition to trialing + The next billing date should not have changed ### Resuming Subscription Which Was trial_ended + Given you have a `trial_ended` subscription, and it is resumable + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` #### Results + The subscription will transition to active + The next billing date should not have changed + Any product-related charges should have been collected ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.