Happy Business Starts Here

New Student

[SOAP] PreviewOption in subscription or set Status to Draft

Error: Unexpected subelement EnablePreviewMode
I try add new subscription to exists Account in Draft mode or Preview Mode, but I can't.
Is there any possibility to add Preview Option when I add new subscription to exists Account ?
Or create subscription in Draft Status ?

 

For example like that:

<ns1:subscribe>

<ns1:subscribes>
<ns1:Account>
<ns2:Id>${#TestCase#AccountID}</ns2:Id>
</ns1:Account>
<ns1Smiley FrustratedubscribeOptions>
<ns1:GenerateInvoice>false</ns1:GenerateInvoice>
<ns1Smiley TonguerocessPayments>false</ns1Smiley TonguerocessPayments>
</ns1Smiley FrustratedubscribeOptions>

<ns1Smiley FrustratedubscriptionData>
<ns1Smiley Frustratedubscription>

<!-- Preview Options - Set EnablePreviewMode to true to generate a preview invoice -->
<ns1Smiley TonguereviewOptions>
<ns1:EnablePreviewMode>True</ns1:EnablePreviewMode>
<ns1:NumberOfPeriods>1</ns1:NumberOfPeriods>
</ns1Smiley TonguereviewOptions>
<!-- End PreviewOptions -->

<ns2:AutoRenew>true</ns2:AutoRenew>
<ns2:ContractAcceptanceDate>2016-04-01</ns2:ContractAcceptanceDate>
<ns2:ContractEffectiveDate>2016-04-01</ns2:ContractEffectiveDate>
<ns2:InitialTerm>12</ns2:InitialTerm>
<ns2:Name>S0000222</ns2:Name>
<ns2:RenewalTerm>12</ns2:RenewalTerm>
<ns2Smiley FrustratederviceActivationDate>2016-04-01</ns2Smiley FrustratederviceActivationDate>
<ns2:TermStartDate>2016-04-01</ns2:TermStartDate>
</ns1Smiley Frustratedubscription>
<ns1:RatePlanData>
<ns1:RatePlan xsi:type="ns1:RatePlan">
<ns2Smiley TongueroductRatePlanId>${#TestCase#ProductRatePlanID}</ns2Smiley TongueroductRatePlanId>
</ns1:RatePlan>
</ns1:RatePlanData>
</ns1Smiley FrustratedubscriptionData>
</ns1:subscribes>
</ns1:subscribe>

 

But not like in that link:

https://knowledgecenter.zuora.com/DC_Developers/SOAP_API/E_SOAP_API_Calls/subscribe_call/C_Previewin...

 

3 REPLIES 3
Support SME

Re: [SOAP] PreviewOption in subscription or set Status to Draft

Hello @tomaszb

 

I have used the following call to create a subscription in Draft status. The key is to either remove or comment the ContractEffectiveDateContractAcceptanceDateserviceActivationDate fields - I choose to simply comment them for better visibility. As long as these dates are not provided, the subscription simply cannot be considered Active.

 

 

<ns1:subscribe>
<ns1:subscribes>
<ns1:Account>
<ns2:Id>REDACTED</ns2:Id>
</ns1:Account>
<ns1:SubscribeOptions>
<ns1:GenerateInvoice>false</ns1:GenerateInvoice>
<ns1:ProcessPayments>false</ns1:ProcessPayments>
</ns1:SubscribeOptions>
<ns1:SubscriptionData>
<ns1:Subscription>


<ns2:AutoRenew>true</ns2:AutoRenew>
<!--ns2:ContractAcceptanceDate>2016-04-01</ns2:ContractAcceptanceDate-->
<!--ns2:ContractEffectiveDate>2016-04-01</ns2:ContractEffectiveDate-->
<ns2:InitialTerm>12</ns2:InitialTerm>
<ns2:Name>S0000222</ns2:Name>
<ns2:RenewalTerm>12</ns2:RenewalTerm>
<!--ns2:serviceActivationDate>2016-04-01</ns2:serviceActivationDate-->
<ns2:TermStartDate>2016-04-01</ns2:TermStartDate>
</ns1:Subscription>
<ns1:RatePlanData>
<ns1:RatePlan xsi:type="ns1:RatePlan">
<ns2:ProductRatePlanId>REDACTED</ns2:ProductRatePlanId>
</ns1:RatePlan>
</ns1:RatePlanData>
</ns1:SubscriptionData>
</ns1:subscribes>
</ns1:subscribe>

 



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

New Student

Re: [SOAP] PreviewOption in subscription or set Status to Draft

Many thanks.
Its working.

New Student

Re: [SOAP] PreviewOption in subscription or set Status to Draft

OK I have Draft Subscription but, Can I do Update and add second Package Rate Plan ?

For example:

<ns1:update>
<ns1:zObjects xsi:type="ns2:Subscription">
<ns2:Id>${#TestCase#SubscriptionID}</ns2:Id>
<!--<ns2:ServiceActivationDate>2013-06-15T15:18:58.000-08:00</ns2:ServiceActivationDate>-->
		    <ns2:TermStartDate>2016-01-01</ns2:TermStartDate>
		    <ns1:RatePlanData>
		      <ns1:RatePlan xsi:type="ns1:RatePlan">
		        <ns2:ProductRatePlanId>${#TestCase#ProductRatePlan2ID}</ns2:ProductRatePlanId>
		      </ns1:RatePlan>
              </ns1:RatePlanData>
</ns1:zObjects>
</ns1:update>