Removing a Product
From API Documentation
Use the Amendment object to remove a product.
Please see our XML sample code for sample SOAP requests for updating a product.
Starting in Version 25.0 and greater, you can now create an Amendment in a single call. As of version 28.0 of the API, you can use the amend() call to preview what changes the amendment would make.
NOTE: You must set the CallOptions in your SOAP header and set useSingleTransaction to true to enable the ability to create the amendment in a single call. See CallOptions for more details.
To PREVIEW remove a product from a subscription (version 28.0+):
- Use the amend() call, passing it an Amendment.
- Specify the following fields
- Set the ContractEffectiveDate and EffectiveDate.
- Set the Name.
- Specify the subscription's ID.
- Set the Type to RemoveProduct
- Specify the Id of the RatePlan to remove within RatePlanData object
- AmendOptions is not currently supported.
- PreviewOptions must set preview mode to true.
<api:amend> <api:requests> <api:Amendments> <!-- Specify basic amendment metadata and dates --> <obj:AutoRenew>true</obj:AutoRenew> <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>Removing a product</obj:Description> <obj:EffectiveDate>2010-01-01T20:44:54.718+05:30</obj:EffectiveDate> <obj:Name>Removing a product</obj:Name> <!-- Specify the Id of the RatePlan that you wish to remove from the subscription. Specify this in the AmendmentSubscriptionRatePlanId field --> <obj:RatePlanData> <api:RatePlan> <obj:AmendmentSubscriptionRatePlanId>402892c42ce80787012ce80ea2310019</obj:AmendmentSubscriptionRatePlanId> </api:RatePlan> </obj:RatePlanData> <obj:ServiceActivationDate>2010-01-01T20:44:54.718+05:30</obj:ServiceActivationDate> <obj:Status>Completed</obj:Status> <obj:SubscriptionId>402892c42ce80787012ce80ea1aa0014</obj:SubscriptionId> <!-- Set Type to RemoveProduct --> <obj:Type>RemoveProduct</obj:Type> </api:Amendments> <api:AmendOptions> <api:GenerateInvoice>false</api:GenerateInvoice> <api:ProcessPayments>false</api:ProcessPayments> </api:AmendOptions> <api:PreviewOptions> <api:EnablePreviewMode>true</api:EnablePreviewMode> </api:PreviewOptions> </api:requests> </api:amend>
To remove a product from a subscription (version 25.0+):
- Create an Amendment
- Specify the following fields
- Set the ContractEffectiveDate and EffectiveDate.
- Set the Name.
- Specify the subscription's ID.
- Set the Type to RemoveProduct
- Specify the Id of the RatePlan to remove within RatePlanData object
<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:ContractEffectiveDate>2010-07-21T12:24:53.764+08:00</ns2:ContractEffectiveDate> <ns2:CustomerAcceptanceDate>2010-07-21T12:24:53.764+08:00</ns2:CustomerAcceptanceDate> <ns2:EffectiveDate>2010-07-21T12:24:53.769+08:00</ns2:EffectiveDate> <ns2:Name>test_amend1279686293769</ns2:Name> <ns2:RatePlanData> <ns1:RatePlan xsi:type="ns2:RatePlan"> <ns2:AmendmentSubscriptionRatePlanId>402892ca29f33da70129f33f348f00a8</ns2:AmendmentSubscriptionRatePlanId> </ns1:RatePlan> </ns2:RatePlanData> <ns2:ServiceActivationDate>2010-07-21T12:24:53.764+08:00</ns2:ServiceActivationDate> <ns2:SubscriptionId>402892ca29f33da70129f33f35fb00ac</ns2:SubscriptionId> <ns2:Type>RemoveProduct</ns2:Type> </ns1:zObjects> </ns1:create>
To remove a product from a subscription (version 24.0-):
1. Create a new Amendment.
- Set the following fields:
- Set the EffectiveDate. NOTE: This field should correspond in value to the ContractEffectiveDate, as in the UI it is overwritten to match.
- Set the Name.
- Set the Status to Draft. Setting it to Draft is important because the amendment then won't go through until the RatePlan is created in step 2.
- Specify the subscription's ID.
- Set the Type to RemoveProduct.
- Create the new amendment, see the create() API call.
The SOAP call payload should look like this:
<ns1:create> <ns1:zObjects xsi:type="ns2:Amendment"> <ns2:EffectiveDate>2009-08-01T12:00:00</ns2:EffectiveDate> <ns2:Name>Remove a Product</ns2:Name> <ns2:Status>Draft</ns2:Status> <ns2:SubscriptionId>4028e69922c95b270122cd80a82f30c0</ns2:SubscriptionId> <ns2:Type>RemoveProduct</ns2:Type> </ns1:zObjects> </ns1:create>
2. Now create a new RatePlan.
- Set the following fields:
- Set the AmendmentId to the new Amendment id that was created in step 1.
- Set the AmendmentSubscriptionRatePlanId to the RatePlan id of the rate plan to be removed.
- Set the Type to RemoveProduct.
- Create the new RatePlan. NOTE: Since the Type has already been set to RemoveProduct, then the system knows that this rate plan is to be deleted from the subscription.
The SOAP call payload should look like this:
<ns1:create> <ns1:zObjects xsi:type="ns2:RatePlan"> <ns2:AmendmentId>4028e69922ece21e0122f110b43332f5</ns2:AmendmentId> <ns2:AmendmentSubscriptionRatePlanId>4028e69922c95b270122cd80a8d830db</ns2:AmendmentSubscriptionRatePlanId> <ns2:AmendmentType>RemoveProduct</ns2:AmendmentType> </ns1:zObjects> </ns1:create>
3. Update the new amendment.
- Set the following fields:
- Set Status to Completed.
- 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.
- 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>4028e69922ece21e0122f110b43332f5</ns2:Id> <ns2:ContractEffectiveDate>2009-08-01T12:00:00</ns2:ContractEffectiveDate> <ns2:Status>Completed</ns2:Status> </ns1:zObjects> </ns1:update>
