Happy Business Starts Here

Highlighted
Zuora Support

billingPreview via REST API

How do I make a billingPreview call via REST API?



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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Zuora Support

Re: billingPreview via REST API

Here is a sample REST API call.

 

POST https://rest.apisandbox.zuora.com/v1/action/billingPreview

{ "requests":[{ "AssumeRenewal":"Autorenew", "AccountId":"2c92c0f95a24621b015a2500395706f4", "TargetDate":"2017-03-01" }] }

 

Curl example

 

curl -D - --request POST \
--url https://rest.apisandbox.zuora.com/v1/action/billingPreview \
--header 'apiaccesskeyid: xxxx@xxxxx.xxx' \
--header 'apisecretaccesskey: xxxxxxxx' \
--header 'content-type: application/json' \
--header 'X-Zuora-WSDL-Version: 82' \
--data '{"requests":[{"AssumeRenewal":"Autorenew","TargetDate":"2017-03-01","AccountId":"2c92c0f95a24621b015a2500395706f4"}]}'

 

 



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

View solution in original post

11 REPLIES 11
Highlighted
Zuora Support

Re: billingPreview via REST API

Here is a sample REST API call.

 

POST https://rest.apisandbox.zuora.com/v1/action/billingPreview

{ "requests":[{ "AssumeRenewal":"Autorenew", "AccountId":"2c92c0f95a24621b015a2500395706f4", "TargetDate":"2017-03-01" }] }

 

Curl example

 

curl -D - --request POST \
--url https://rest.apisandbox.zuora.com/v1/action/billingPreview \
--header 'apiaccesskeyid: xxxx@xxxxx.xxx' \
--header 'apisecretaccesskey: xxxxxxxx' \
--header 'content-type: application/json' \
--header 'X-Zuora-WSDL-Version: 82' \
--data '{"requests":[{"AssumeRenewal":"Autorenew","TargetDate":"2017-03-01","AccountId":"2c92c0f95a24621b015a2500395706f4"}]}'

 

 



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

View solution in original post

Highlighted
Guru

Re: billingPreview via REST API

@vu_phan, attempting to use your example as written results in a '400 Bad Request' response from the server:

 

An error occurred while processing your request.

Reference #166.cf32c517.1491422170.3d9a3b7

 

The only way I could get it to proceed is by removing the 'X-Zuora-WSDL-Version' header. But does that means we are forced to the older WSDL then for REST?

Highlighted
Zuora Support

Re: billingPreview via REST API

Hi @feisley,

 

Which environment were you testing the call on?  Do you know if Billing Preview feature has been enabled on your tenant?



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

Highlighted
Guru

Re: billingPreview via REST API

@vu_phan My comment applied both to Production and API Sandbox. We have billing preview enabled in both tenants. The call works just fine but only if i remove the WSDL related http header. Including that header causes any call with it to fault (also tried it on query calls that needed the newer WSDL to function and they too failed)

Highlighted
Zuora Support

Re: billingPreview via REST API

Hi @feisley,

 

Thanks for your feedback.  The call works fine for me and other customers.  I'll do more research and will get back if I figure out something.



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

Highlighted
Guru

Re: billingPreview via REST API

@vu_phan yea in speaking with support, they are seeing similar results. We both submit the exact same thing and get different results. My current theory is some variance in the Akamai CDN that sits in front of the API having differences based on where you are located, I'll follow up once we get to the bottom of it.

Highlighted
Zuora Support

Re: billingPreview via REST API

Hi @feisley,

 

Thanks for letting me now.



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

Highlighted
Zuora Staff

Re: billingPreview via REST API

For evergreen subscriptions use below: 

 

{
"requests":[{
"AssumeRenewal":"Autorenew",
"AccountId":"2c92c0fb5bae5dde015bd2f251da3a8e",
"TargetDate":"2017-07-01",
"IncludingEvergreenSubscription":"true"
}]
}

Highlighted
Zuora Support

Re: billingPreview via REST API

Thank you @joe_koscielski.



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