- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
what is the REST api to create subscription with draft status ?
My scenario is, create subscription with draft mode at the first call and then call later to set the activation (Contract Eff Date). This can be achieved in zuora UI, but I couldn't locate REST api for the same?
Please assist me on this how to handle my case ?
Thanks,
Krishnan
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
Edit...
When using the REST call to create a new subscription, the contract effective date is required and the other triggering dates are auto filled in, if not explicitly supplied.
Currently your only option with the API would be to use the SOAP subscribe call, which will let you create the subscription in DRAFT mode
PM is aware of this issue and will be brining the REST API's up to parity with the SOAP functionality
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
@kramali4_fordsb - check out the New Features webinar (October 27th at 10a PT / 1p ET) which will give an overview of enhancements to REST APIs. We had a sneak peek at it yesterday and it's pretty cool! The webinar will be interactive so you can ask Product Managers questions about the new features.
If you're not able to attend, register anyways as they'll be sending registrants a recording of the webinar afterwards.
See also "Save the Date! New Features Webinar"
Lana Lee | Senior Community Manager and Strategist
"A little consideration, a little thought for others, makes all the difference." —A. A. Milne
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
the below minimal parameters that creates active subscription by API call. what I should do get the subscription in draft status ??
post create subscription
{
"termType": "EVERGREEN",
"accountKey": "A00000001",
"contractEffectiveDate": "2016-10-27",
"subscribeToRatePlans":
[
{ "productRatePlanId": "2c92c0f8578d65ef015796622db9774c"}
],
"notes": "Test POST create subscription",
}
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
Please see my edited original response.
You will need to use the SOAP API to accomplish this, although this is a known issue which will be addressed in the future
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
Hi @Ravi and @kramali4_fordsb,
The webinar Is available for viewing now! Watch the video here
If you have any additional questions, feel free to chime in on the community. Thanks!
Lana
Lana Lee | Senior Community Manager and Strategist
"A little consideration, a little thought for others, makes all the difference." —A. A. Milne
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
Hi Thanks for your update!
I tried with Subscription CRUD for create option. I kept getting the following error
"Errors": [ {
"Code": "INVALID_TYPE",
"Message": "invalid type for create."
"Success": false
Could you please help me to indetify the error and create CRUD subscription ?
Also I tried with soap ui as per Adam, that is working as expected.
Thanks,
Krishnan
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
Hi Krishnan,
Can you post the entire api call you made? including http headers and the entire soap envelope if its SOAP?
Don't forget to remove any private info
thanks!
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: REST api to create subscription with draft status
Please find the entire request below..
POST https://rest.apisandbox.zuora.com/v1/object/Subscription HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
apiAccessKeyId: xxxxxxxxxxxxxxxxxxxxxxxx
apiSecretAccessKey: xxxxxxxxxxxxx
{
"RenewalTermPeriodType": "Month",
"InitialTermPeriodType": "Month",
"AccountId": "2c92c0fb56bc8e830156c21836cb7c75",
"CurrentTermPeriodType": "Month",
"AutoRenew": false,
"TermStartDate": "2016-11-14",
"ContractEffectiveDate": "2016-11-14",
"RenewalSetting": "RENEW_WITH_SPECIFIC_TERM",
"Notes": "Test - crreate subscription with draft mode",
"IsInvoiceSeparate": false,
"Status": "Draft",
"TermType": "EVERGREEN"
}
I tried with some other CRUD api calls that is working fine as explained in API reference. Just CRUD create subscription is not working for me now. Please provide your assistance on the same.
Thanks,
Krishnan