Happy Business Starts Here

Honor Student

Zuora Subscribe REST Call

We have a business case, where we would have to create multiple Subscriptions under a single Account in Zuora. 

Is it possible to leverage the Zuora Subscribe API via REST to do this ? By this, we can create an account/contact/subscription, in one REST call.

 

The other option which I see is by using the CRUD appraoch (Which we are trying to avoid)

1. Create Account.

2. Create Contacts under account.

3. Set Payment Type and Change Status of Account.

4. Create Subscriptions under the Account. 

 

Please let me know if there is a work around for this case?

5 REPLIES 5
Zuora Support

Re: Zuora Subscribe REST Call

Hi @smalanki,

 

Currently, you can create multiple subscriptions under an existing account using subscribe() call. Here is a sample template.

 

POST https://rest.zuora.com/v1/action/subscribe

{
   "subscribes":[
      {
         "Account":{
            "Id":"2c92a0fb3929bf1a01392adf9e980929"
         },
         "PreviewOptions":{
            "EnablePreviewMode":false,
            "NumberOfPeriods":3
         },
         "SubscribeOptions":{
            "GenerateInvoice":false,
            "ProcessPayments":false,
            "SubscribeInvoiceProcessingOptions":{

            }
         },
         "SubscriptionData":{
            "RatePlanData":[
               {
                  "RatePlan":{
                     "ProductRatePlanId":"4028e487343ac85101343f605cff1512"
                  }
               },
               {
                  "RatePlan":{
                     "ProductRatePlanId":"2c92a0f94a37f8bc014a3f7244be7b7e"
                  }
               }
            ],
            "Subscription":{
               "AutoRenew":false,
               "ContractAcceptanceDate":"2017-10-20",
               "ContractEffectiveDate":"2017-10-20",
               "InitialTerm":12,
               "Notes":"this is notes",
               "RenewalTerm":12,
               "ServiceActivationDate":"2017-10-20",
               "TermStartDate":"2017-10-20",
               "TermType":"TERMED"
            }
         }
      },
      {
         "Account":{
            "Id":"2c92a0fb3929bf1a01392adf9e980929"
         },
         "PreviewOptions":{
            "EnablePreviewMode":false,
            "NumberOfPeriods":3
         },
         "SubscribeOptions":{
            "GenerateInvoice":false,
            "ProcessPayments":false,
            "SubscribeInvoiceProcessingOptions":{

            }
         },
         "SubscriptionData":{
            "RatePlanData":[
               {
                  "RatePlan":{
                     "ProductRatePlanId":"4028e487343ac85101343f605cff1512"
                  }
               }
            ],
            "Subscription":{
               "AutoRenew":false,
               "ContractAcceptanceDate":"2017-10-20",
               "ContractEffectiveDate":"2017-10-20",
               "InitialTerm":12,
               "Notes":"this is notes",
               "RenewalTerm":12,
               "ServiceActivationDate":"2017-10-20",
               "TermStartDate":"2017-10-20",
               "TermType":"TERMED"
            }
         }
      }
   ]
}

For a new account you would need to create two subscribe() calls. The first call is to create the account and the first subscription. Once you have the AccountId, you can pass it into the second subscribe() calls to create multiple subscriptions under this account.



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

Honor Student

Re: Zuora Subscribe REST Call

@vu_phan Thank you for the quick response Smiley Happy

 

That is the exact approach we are currently implementing. 

Before designing the integration, I wanted to ensure if having multiple calls was the best appraoch. 

 

Because we need to check the creation of an Account, we would have to go with Multi-call appraoch.

 

Thanks,

Sujan

 

Tutor

Re: Zuora Subscribe REST Call

Thanks,

 

But why this Account.Id field is not documented (https://www.zuora.com/developer/api-reference/#operation/Action_POSTsubscribe) ?

Valued Scholar

Re: Zuora Subscribe REST Call

Hello @vu_phan

 

Can same call be used to update any custom field on Subscription Rate Plan Charge object? Create subscription call specifically mentioned that we can pass on custom fields in ChargeOverride section but not this one.

 

Thanks

Sumit

Highlighted
Zuora Documentation

Re: Zuora Subscribe REST Call

Hi @testtest, the subscribes > Account > Id field is documented as of version 2019-04-18 of the API Reference. Please see here:

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