Subscription Status

Cancel Dunning

POST
/subscriptions/{subscription_id}/cancel_dunning.json

Cancels the active dunning process for a subscription and sets it to active.

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.

Response Body

application/json

application/json

curl -X POST "https://example.com/subscriptions/0/cancel_dunning.json"
{  "subscription": {    "id": 0,    "state": "pending",    "balance_in_cents": 0,    "total_revenue_in_cents": 0,    "product_price_in_cents": 0,    "product_version_number": 0,    "current_period_ends_at": "2019-08-24T14:15:22Z",    "next_assessment_at": "2019-08-24T14:15:22Z",    "trial_started_at": "2019-08-24T14:15:22Z",    "trial_ended_at": "2019-08-24T14:15:22Z",    "activated_at": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "cancellation_message": "string",    "cancellation_method": "merchant_ui",    "cancel_at_end_of_period": true,    "canceled_at": "2019-08-24T14:15:22Z",    "current_period_started_at": "2019-08-24T14:15:22Z",    "previous_state": "pending",    "signup_payment_id": 0,    "signup_revenue": "string",    "delayed_cancel_at": "2019-08-24T14:15:22Z",    "coupon_code": "string",    "snap_day": "string",    "payment_collection_method": "automatic",    "customer": {      "first_name": "string",      "last_name": "string",      "email": "string",      "cc_emails": "string",      "organization": "string",      "reference": "string",      "id": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "address": "string",      "address_2": "string",      "city": "string",      "state": "string",      "state_name": "string",      "zip": "string",      "country": "string",      "country_name": "string",      "phone": "string",      "verified": true,      "portal_customer_created_at": "2019-08-24T14:15:22Z",      "portal_invite_last_sent_at": "2019-08-24T14:15:22Z",      "portal_invite_last_accepted_at": "2019-08-24T14:15:22Z",      "tax_exempt": true,      "surcharging": true,      "vat_number": "string",      "vat_country": "string",      "entity_identifier_kind": "vat_eu",      "entity_identifier_value": "string",      "parent_id": 0,      "locale": "string",      "default_subscription_group_uid": "string",      "salesforce_id": "string",      "tax_exempt_reason": "string",      "default_auto_renewal_profile_id": 0,      "maxioid": "string",      "branding_theme_id": 0    },    "product": {      "id": 0,      "name": "string",      "handle": "string",      "description": "string",      "accounting_code": "string",      "request_credit_card": true,      "expiration_interval": 0,      "expiration_interval_unit": "day",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "price_in_cents": 0,      "interval": 0,      "interval_unit": "day",      "initial_charge_in_cents": 0,      "trial_price_in_cents": 0,      "trial_interval": 0,      "trial_interval_unit": "day",      "archived_at": "2019-08-24T14:15:22Z",      "require_credit_card": true,      "return_params": "string",      "taxable": true,      "update_return_url": "string",      "initial_charge_after_trial": true,      "version_number": 0,      "update_return_params": "string",      "product_family": {        "id": 0,        "name": "string",        "handle": "string",        "accounting_code": null,        "description": "string",        "surcharging": true,        "created_at": "2019-08-24T14:15:22Z",        "updated_at": "2019-08-24T14:15:22Z",        "archived_at": "2019-08-24T14:15:22Z"      },      "public_signup_pages": [        {          "id": 0,          "return_url": "string",          "return_params": "string",          "url": "string"        }      ],      "product_price_point_name": "string",      "request_billing_address": true,      "require_billing_address": true,      "require_shipping_address": true,      "tax_code": "string",      "default_product_price_point_id": 0,      "use_site_exchange_rate": true,      "item_category": "string",      "product_price_point_id": 0,      "product_price_point_handle": "string",      "unspsc_code": "string",      "features": [        {          "id": 0,          "feature_template_id": 0,          "feature_key": "string",          "feature_name": "string",          "feature_kind": "access_right",          "value": "string",          "periodicity_interval": 0,          "periodicity_unit": "hour",          "price_point_type": "ProductPricePoint",          "price_point_id": 0,          "archived_at": "2019-08-24T14:15:22Z",          "created_at": "2019-08-24T14:15:22Z",          "updated_at": "2019-08-24T14:15:22Z"        }      ]    },    "credit_card": {      "id": 10088716,      "first_name": "Test",      "last_name": "Subscription",      "masked_card_number": "XXXX-XXXX-XXXX-1",      "card_type": "bogus",      "expiration_month": 1,      "expiration_year": 2022,      "customer_id": 14543792,      "current_vault": "bogus",      "vault_token": "1",      "billing_address": "123 Montana Way",      "billing_city": "Billings",      "billing_state": "MT",      "billing_zip": "59101",      "billing_country": "US",      "customer_vault_token": null,      "billing_address_2": "",      "payment_type": "credit_card",      "site_gateway_setting_id": 1,      "gateway_handle": null    },    "group": {      "uid": "string",      "scheme": 0,      "primary_subscription_id": 0,      "primary": true    },    "bank_account": {      "id": 0,      "first_name": "string",      "last_name": "string",      "customer_id": 0,      "current_vault": "authorizenet",      "vault_token": "string",      "billing_address": "string",      "billing_city": "string",      "billing_state": "string",      "billing_zip": "string",      "billing_country": "string",      "customer_vault_token": "string",      "billing_address_2": "string",      "bank_name": "string",      "masked_bank_routing_number": "string",      "masked_bank_account_number": "string",      "bank_account_type": "checking",      "bank_account_holder_type": "personal",      "payment_type": "bank_account",      "verified": false,      "site_gateway_setting_id": 0,      "gateway_handle": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    },    "payment_type": "string",    "referral_code": "string",    "next_product_id": 0,    "next_product_handle": "string",    "coupon_use_count": 0,    "coupon_uses_allowed": 0,    "reason_code": "string",    "automatically_resume_at": "2019-08-24T14:15:22Z",    "coupon_codes": [      "string"    ],    "offer_id": 0,    "payer_id": 0,    "current_billing_amount_in_cents": 0,    "product_price_point_id": 0,    "product_price_point_type": "catalog",    "next_product_price_point_id": 0,    "net_terms": 0,    "stored_credential_transaction_id": 0,    "reference": "string",    "on_hold_at": "2019-08-24T14:15:22Z",    "prepaid_dunning": true,    "coupons": [      {        "code": "string",        "use_count": 0,        "uses_allowed": 0,        "expires_at": "string",        "recurring": true,        "amount_in_cents": 0,        "percentage": "string"      }    ],    "dunning_communication_delay_enabled": true,    "dunning_communication_delay_time_zone": "string",    "receives_invoice_emails": true,    "locale": "string",    "currency": "string",    "scheduled_cancellation_at": "2019-08-24T14:15:22Z",    "credit_balance_in_cents": 0,    "prepayment_balance_in_cents": 0,    "prepaid_configuration": {      "id": 0,      "initial_funding_amount_in_cents": 0,      "replenish_to_amount_in_cents": 0,      "auto_replenish": true,      "replenish_threshold_amount_in_cents": 0    },    "self_service_page_token": "string"  }}

Cancel Delayed Cancellation DELETE

Removes the delayed cancellation from a subscription, ensuring it is not canceled at the end of the current period. The request will reset the `cancel_at_end_of_period` flag to `false`. This endpoint is idempotent. If the subscription was not set to cancel in the future, removing the delayed cancellation has no effect and the call will be successful.

Preview Renewal POST

Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields This endpoint is particularly useful because it returns the computed billing amount for the base product and the components which are in use by a subscriber. By default, the preview includes billing details for all components _at their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components * Current metric quantity value for events recorded thus far for events-based components In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. End-of-period values for components are not predicted, so metered or events-based usage may be less than it will eventually be at the end of the period. Optionally, **you can provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. ## Preview Behavior Sending a `POST` request to this endpoint returns preview data without modifying the subscription. This method previews data, but does not log any changes against a subscription.