Happy Business Starts Here

Highlighted
Zuora Alumni

How to query Category field under Product object?

For SOAP "BillingPreviewRun", it provides a downloadable csv file containing a preview. How do I download the file?



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

1 REPLY 1
Zuora Alumni

Re: How to query Category field under Product object?

Given that you have the following:

 

1, "BillingPreviewRun" is enabed in your tenant. It is a Limited Avalability tenant level feature.

2, You are using WSDL version 61.0 and above

 

- Step 1

 

create() call to create an 'BillingPreviewRun' object:

 

Request:

 

<ns1:create>
    <ns1:zObjects xsi:type="ns2:BillingPreviewRun">
        <ns2:TargetDate>2017-12-31</ns2:TargetDate>
    </ns1:zObjects>
</ns1:create>

 

 

Response:

 

            <ns1:createResponse xmlns:ns1="http://api.zuora.com/">
                  <ns1:result>
                        <ns1:Id>2c92c0f85a6b134e015a8062d10906bf</ns1:Id>
                        <ns1:Success>true</ns1:Success>
                  </ns1:result>
            </ns1:createResponse>

 

- Step 2

 

Then use the returned 'BillingPreviewRun' ID to query for the 'ResultFileUrl':

 

 

Request:

 

<ns1:query>
    <ns1:queryString>Select Id, CreatedDate, ResultFileUrl From BillingPreviewRun where Id='2c92c0f85a6b134e015a8062d10906bf' </ns1:queryString>
</ns1:query>

 

 Response:

 

            <ns1:queryResponse xmlns:ns1="http://api.zuora.com/">
                  <ns1:result>
                        <ns1:done>true</ns1:done>
                        <ns1:queryLocator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1"></ns1:queryLocator>
                        <ns1:records xmlns:ns2="http://object.api.zuora.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:BillingPreviewRun">
                              <ns2:Id>2c92c0f85a6b134e015a8062d10906bf</ns2:Id>
                              <ns2:CreatedDate>2017-02-27T08:24:04.000-08:00</ns2:CreatedDate>
                              <ns2:ResultFileUrl>https://apisandbox.zuora.com/apps/api/file/2c92c0855a6b070f015a806481213625</ns2:ResultFileUrl>
                        </ns1:records>
                        <ns1:size>1</ns1:size>
                  </ns1:result>
            </ns1:queryResponse>

 

From the above response, simply paste the URL from the field "ResultFileUrl" and the file download will begin.

 

 Supported Documentation: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/BillingPrevi...



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