Canceling a Subscription

From API Documentation

Jump to: navigation, search

To cancel a subscription, use the Cancellation Amendment. Note that a draft subscription cannot be canceled.

Starting in Version 28.0 and greater, you can now preview an amendment before canceling it

Starting in Version 25.0 and greater, you can cancel an Amendment in a single call

To PREVIEW canceling a subscription (version 28.0+):

  • Create an Amendment
  • Specify the following fields
    • Set the ContractEffectiveDate and EffectiveDate (and Service Activation and Customer Acceptance if applicable)
    • Set the Name.
    • Specify the subscription's ID.
    • Set the Type to Cancellation

Sample SOAP

<api:amend>
   <api:requests>
      <api:Amendments>
         <obj:ContractEffectiveDate>2010-01-01T20:44:54.718+05:30</obj:ContractEffectiveDate>
         <obj:CustomerAcceptanceDate>2010-01-01T20:44:54.718+05:30</obj:CustomerAcceptanceDate>
         <obj:Description>Cancel a subscription amendment</obj:Description>
         <obj:EffectiveDate>2010-01-01T20:44:54.718+05:30</obj:EffectiveDate>
         <obj:Name>Cancel a subscription amendment</obj:Name>
         <obj:ServiceActivationDate>2010-01-01T20:44:54.718+05:30</obj:ServiceActivationDate>
         <obj:Status>Completed</obj:Status>
         <obj:SubscriptionId>402892c42ce80787012ce80ea1aa0014</obj:SubscriptionId>
         <obj:Type>Cancellation</obj:Type>
      </api:Amendments>
      <api:PreviewOptions>
         <api:EnablePreviewMode>true</api:EnablePreviewMode>
      </api:PreviewOptions>
   </api:requests>
</api:amend>


To cancel a subscription (version 25.0+):

  • Create an Amendment
  • Specify the following fields
    • Set the ContractEffectiveDate and EffectiveDate (and Service Activation and Customer Acceptance if applicable)
    • Set the Name.
    • Specify the subscription's ID.
    • Set the Type to Cancellation
    • Set any of the terms that you want to change (Renewal term, initial term, term commitment)

Sample SOAP

<ns1:create xmlns:ns1="http://api.zuora.com/">
 <ns1:zObjects xmlns:ns2="http://object.api.zuora.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:Amendment">
   <ns2:Id xsi:nil="1" />
   <ns2:ContractEffectiveDate>2010-07-21T12:24:53.764+08:00</ns2:ContractEffectiveDate>
   <ns2:Name>test_amend1279686293769</ns2:Name>
   <ns2:SubscriptionId>402892ca29f33da70129f33f35fb00ac</ns2:SubscriptionId>
   <ns2:Type>Cancellation</ns2:Type>
   <ns2:EffectiveDate>2010-07-21T12:24:53.764+08:00</ns2:EffectiveDate>
 </ns1:zObjects>
</ns1:create>


To cancel a subscription (version 24.0-):

1. Create a new Amendment.

  • Set the following fields:
    • Set the Type to Cancellation.
    • Set the EffectiveDate to the desired date and time of cancellation. This date and time must be in the future.
    • Set the Name for the Amendment.
    • Specify the Subscription's Id.
    • Set the Status to Draft.
  • Create the new Amendment, see the create() API call.

The SOAP call envelope payload should look like this:

<ns1:create>
 <ns1:zObjects xsi:type="ns2:Amendment">
   <ns2:EffectiveDate>2009-11-08T08:00:00</ns2:EffectiveDate>
   <ns2:Name>Cancel Subscription</ns2:Name>
   <ns2:Status>Draft</ns2:Status>
   <ns2:SubscriptionId>4028e69922ece21e0122f1de76654502</ns2:SubscriptionId>
   <ns2:Type>Cancellation</ns2:Type>
 </ns1:zObjects>
</ns1:create>

2. Update the new Amendment.

  • Set the following fields:
    • Specify the Amendment's Id.
    • Set the ContractEffectiveDate to a date and time in the future.
    • If Require Customer Acceptance of Orders? is set on the Z-Billing Admin "Default Subscription Settings" page to Yes, then ContractAcceptanceDate will also need to be specified.
    • If Require Service Activation? is set on the Z-Billing Admin "Default Subscription Settings" page to Yes, then ServiceActivationDate will also need to be specified.
    • Set the Status to Completed.
  • Update the new amendment, see the update() API call.

The SOAP call payload should look like this:

<ns1:update>
 <ns1:zObjects xsi:type="ns2:Amendment">
   <ns2:Id>4028e69922ece21e0122f734f76777d5</ns2:Id>
   <ns2:ContractEffectiveDate>2009-11-08T08:00:00</ns2:ContractEffectiveDate>
   <ns2:ServiceActivationDate>2009-11-08T08:00:00</ns2:ServiceActivationDate>
   <ns2:CustomerAcceptanceDate>2009-11-08T08:00:00</ns2:CustomerAcceptanceDate>
   <ns2:Status>Completed</ns2:Status>
 </ns1:zObjects>
</ns1:update>