Cancel Subscription

This action cancels an active subscription (only subscriptions in Active or Provisioning status can be cancelled.) This call returns the cancelled subscription so you can inspect the status field to ensure it was cancelled as expected.

PropertyTypeDescriptionRequired
subscriptionIdIntegerThis is the Subscription Id for the Subscription you want to cancel. Passing the incorrect Id can potentially cancel a different Subscription.Yes
cancellationOptionEnum:{None,
Unearned,
Full}
This field defines how the system behaves when cancelling the subscription.

"None" will have no reversal take place. The system will fully earn the charges from the current period as though services provided have completed and been provided fully.

"Unearned" will reverse the unearned deferred revenue of the current period's charges. This is typically a partial reversal based on daily or monthly earning rules set on the plan product at the time the subscription was created.

"Full" will fully reverse all charges for the current period, regardless of how much has been earned.
Yes
Examples
curl -X POST "https://secure.fusebill.com/v1/subscriptionCancellation" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{subscriptionId:{subscriptionId},cancellationOption:'None'}"
//Json Payload
string jsonData = "{subscriptionId:{subscriptionId},cancellationOption:'None'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/subscriptionCancellation/");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
  streamWriter.Write(jsonData);
  streamWriter.Flush();
  streamWriter.Close();
}
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  result = streamReader.ReadToEnd();
}
#Import library JSON
import json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' :'application/json'}
#Pass in a dictionary to the Payload parameter
payload = {'subscriptionId':{id},'cancellationOption':'None'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/subscriptionCancellation/{id}', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "subscriptionId": 12345,
  "cancellationOption": "None"
}
Response
[  
   {  
      "customerId":172677,
      "planFrequency":{  
         "planRevisionId":122453,
         "numberOfIntervals":1,
         "interval":"Monthly",
         "numberOfSubscriptions":1,
         "status":"Active",
         "setupFees":[  
            {  
               "amount":10.0,
               "currency":"USD",
               "id":0,
               "uri":null
            }
         ],
         "charges":[  
            {  
               "amount":2.0,
               "currency":"USD",
               "id":0,
               "uri":null
            }a
         ],
         "isProrated":false,
         "prorationGranularity":null,
         "planFrequencyUniqueId":114,
         "remainingInterval":null,
         "id":114,
         "uri":null
      },
      "planCode":"BSC2",
      "planName":"Basic",
      "planDescription":"Basic Monthly Services for Kennedy Consulting",
      "planReference":null,
      "status":"Cancelled",
      "reference":null,
      "subscriptionOverride":null,
      "hasPostedInvoice":true,
      "createdTimestamp":"2017-01-11T18:35:37",
      "activatedTimestamp":null,
      "provisionedTimestamp":"2017-01-11T19:07:57",
      "nextPeriodStartDate":null,
      "scheduledActivationTimestamp":"2017-02-01T05:00:00",
      "subscriptionProducts":[  

      ],
      "remainingInterval":null,
      "remainingIntervalPushOut":null,
      "openSubscriptionPeriodEndDate":null,
      "chargeDiscount":null,
      "setupFeeDiscount":null,
      "chargeDiscounts":[  

      ],
      "setupFeeDiscounts":[  

      ],
      "customFields":null,
      "planAutoApplyChanges":false,
      "autoApplyCatalogChanges":false,
      "monthlyRecurringRevenue":0.0000,
      "netMonthlyRecurringRevenue":0.0000,
      "amount":12.0000,
      "contractStartTimestamp":null,
      "contractEndTimestamp":null,
      "expiredTimestamp":null,
      "cancellationTimestamp": null,
      "modifiedTimestamp": "2020-04-27T19:10:14.023",
      "coupons":[   

      ],
      "invoiceDay": 1,
      "invoiceMonth": null,
      "canMigrate": false,
      "migrationDate": null,
      "scheduledMigrationDate": null,
      "migrations": null,  
      "subscriptionHasRecurringEndOfPeriodCharge":false,
      "id":122453,
      "uri":"https://secure.fusebill.com/v1/subscriptions/122453"
   }
]
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "subscriptionCancel.CancellationOption",
            "Value": "Allowable Cancel Options are: None, Unearned, Full"
        }
    ]
}
Language
Authorization