Happy Business Starts Here

Valued Scholar

Re: REST api to create subscription with draft status

Do you have any update on this ? 

 

Thanks,

Krishnan

Community Manager

Re: REST api to create subscription with draft status

Hi @kramali4_fordsb,

 

I'll follow up with @adam to look into it...thanks for your patience!

 

Lana


Lana Lee | Senior Community Manager and Strategist
"A little consideration, a little thought for others, makes all the difference." —A. A. Milne
Valued Scholar

Re: REST api to create subscription with draft status

Thanks

Support SME

Re: REST api to create subscription with draft status

Hi Krishnan,

 

We've released the new REST API and I think it is possible to create Draft subscription through REST with it.

Here is the API reference of the request in where field stauts could be specified to below values:

Screen Shot 2016-11-17 at 15.55.45.png

 

Regards,

Yolanda






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

Highlighted
Support SME

Re: REST api to create subscription with draft status

Sorry Krishnan, just noticed you've already using the new REST endpoint and got the error.

Sorry about the confusion!






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

Valued Scholar

Re: REST api to create subscription with draft status

Thanks. Please let me know when it is available.

Advanced Tutor

Re: REST api to create subscription with draft status

Is there any news? I'm also interested in a way to create Draft subscription using REST API.

Zuora Alumni

Re: REST api to create subscription with draft status

One thing you can try is create call on a subscription object. In a way, you can think of this as sending a JSON payload to create a subscription object just like SOAP API. Please give it a try.

 

https://www.zuora.com/developer/api-reference/#operation/Action_POSTcreate

 

Thank you!

 

 

 

 



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

Student

Re: REST api to create subscription with draft status

Do you have any update on this ? 

 

The SOAP API is no longer under active development. I don't want to use The legacy SOAP calls.

 

 

I tried using /action/update API 

 

https://www.zuora.com/developer/api-reference/#operation/Action_POSTupdate 

 

 

{
  objects: [
    {
      "Id": "SUBSCRIPTION_ID",
      "Status": "Draft"

    }
  ],
  type: "Subscription"
}

 

but I got such a error.

 

{"Errors"=>[{"Code"=>"INVALID_VALUE", "Message"=>"Subscription update is not supported for field \"status\""}

 

 

Zuora Staff

Re: REST api to create subscription with draft status

I think the error is being triggered by your trying to set both the Status and the Contract Effective Date. A subscription in Draft has no trigger dates set, so if you drop the Contract Effective Date, the create call should work and your subscription will be in Draft. As Adam noted however if you use the REST you may HAVE to specify the Contract Effective Date, meaning you can't actually set a subscriptin in Draft, which I'd say is a bug as it's inconsistent with past behavior.

 

This may not have been clear from Adam's answer, but the Status field on the Subscription object is normally set by Zuora automatically, not explicitly set as you are trying to do. The Status based state model for the Subscription object is, Draft, Pending Activation, Pending Acceptance, Expired, Active, Suspended and Cancelled. No trigger date on creation will put the subscription into Draft (you can see this in the UI, in your sandbox create a subscription, add rate plans, save without specifying Contract Effective or any other trigger date, you'll have a Subscription in Draft). If you configure your tenant to require Service Activation Date be populated (this is optional and may not be set on your tenant), then you can set the Contract Effective Date, NOT set the Service Activiation Date and you'll end up with a Subscription in 'Pending Activation' status. If you just require Contract Effective (the OOTB default) then once you do set the Contract Effective Date on that Draft subscription the status will change to 'Active'. When you create an amendment for the subscription, that first version that was active goes to 'Expired', the second version of the subscription (which is a new Subscription object)  acquires the Active status. You can probably guess what Suspended and Cancellation means!