Subscription Status

Cancel Subscription

DELETE
/subscriptions/{subscription_id}.json

Cancels the Subscription. The Delete method sets the Subscription state to canceled. To cancel the subscription immediately, omit any schedule parameters from the request. To use the schedule options, the Schedule Subscription Cancellation feature must be enabled on your site.

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

subscription*

Response Body

application/json

application/json

curl -X DELETE "https://example.com/subscriptions/0.json" \  -H "Content-Type: application/json" \  -d '{    "subscription": {}  }'
{  "subscription": {    "id": 15254809,    "state": "canceled",    "trial_started_at": null,    "trial_ended_at": null,    "activated_at": "2016-11-15T15:33:44-05:00",    "created_at": "2016-11-15T15:33:44-05:00",    "updated_at": "2016-11-15T17:13:06-05:00",    "expires_at": null,    "balance_in_cents": 0,    "current_period_ends_at": "2017-08-29T12:00:00-04:00",    "next_assessment_at": "2017-08-29T12:00:00-04:00",    "canceled_at": "2016-11-15T17:13:06-05:00",    "cancellation_message": "Canceling the subscription via the API",    "next_product_id": null,    "cancel_at_end_of_period": false,    "payment_collection_method": "automatic",    "snap_day": null,    "cancellation_method": "merchant_api",    "current_period_started_at": "2016-11-15T15:33:44-05:00",    "previous_state": "active",    "signup_payment_id": 0,    "signup_revenue": "0.00",    "delayed_cancel_at": null,    "coupon_code": null,    "total_revenue_in_cents": 0,    "product_price_in_cents": 1000,    "product_version_number": 7,    "payment_type": "credit_card",    "referral_code": "tg8qbq",    "coupon_use_count": null,    "coupon_uses_allowed": null,    "customer": {      "id": 14731081,      "first_name": "John",      "last_name": "Doe",      "organization": "Acme Widgets",      "email": "john.doe@example.com",      "created_at": "2016-11-15T15:33:44-05:00",      "updated_at": "2016-11-15T15:33:45-05:00",      "reference": "123",      "address": null,      "address_2": null,      "city": null,      "state": null,      "zip": null,      "country": null,      "phone": null,      "portal_invite_last_sent_at": "2016-11-15T15:33:45-05:00",      "portal_invite_last_accepted_at": null,      "verified": false,      "portal_customer_created_at": "2016-11-15T15:33:45-05:00",      "cc_emails": null    },    "product": {      "id": 3792003,      "name": "$10 Basic Plan",      "handle": "basic",      "description": "lorem ipsum",      "accounting_code": "basic",      "request_credit_card": false,      "expiration_interval": null,      "expiration_interval_unit": "never",      "created_at": "2016-03-24T13:38:39-04:00",      "updated_at": "2016-11-03T13:03:05-04:00",      "price_in_cents": 1000,      "interval": 1,      "interval_unit": "day",      "initial_charge_in_cents": null,      "trial_price_in_cents": null,      "trial_interval": null,      "trial_interval_unit": "month",      "archived_at": null,      "require_credit_card": false,      "return_params": "",      "taxable": false,      "update_return_url": "",      "initial_charge_after_trial": false,      "version_number": 7,      "update_return_params": "",      "product_family": {        "id": 527890,        "name": "Acme Projects",        "description": "",        "handle": "billing-plans",        "accounting_code": null      },      "public_signup_pages": [        {          "id": 281054,          "return_url": "http://www.example.com?successfulsignup",          "return_params": "",          "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic"        },        {          "id": 281240,          "return_url": "",          "return_params": "",          "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic"        },        {          "id": 282694,          "return_url": "",          "return_params": "",          "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic"        }      ]    },    "credit_card": {      "id": 10202898,      "first_name": "John",      "last_name": "Doe",      "masked_card_number": "XXXX-XXXX-XXXX-1111",      "card_type": "visa",      "expiration_month": 12,      "expiration_year": 2020,      "customer_id": 14731081,      "current_vault": "authorizenet",      "vault_token": "12345",      "billing_address": null,      "billing_city": null,      "billing_state": null,      "billing_zip": null,      "billing_country": null,      "customer_vault_token": "67890",      "billing_address_2": null,      "payment_type": "credit_card"    }  }}