Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Quotes Document

Quotes Document

The document call generates a quote document and returns the generated document URL. You can directly access the generated quote file through the returned URL.

The document call should be only used from Zuora Quotes. 

Request

  • Production: POST https://api.zuora.com/rest/v1/quotes/document
  • API Sandbox: POST https://apisandbox-api.zuora.com/rest/v1/quotes/document

Request Body Parameters

documentType Required Type of the document to generate: PDF or DOC
quoteId Required Id of the quote
serverUrl Required SOAP URL used to login to Salesforce to get data. You can get the value with the following code in a Visualforce page:

{!$Api.Partner_Server_URL_100}

sessionId Required Salesforce session id used to log in to Salesforce to get data. You can get the value with the following code in a Visualforce page:

{!$Api.Session_ID}

templateId Required Id of the quote template in Zuora
useSFDCLocale Optional If using Salesforce org locale, set this to a value that is not null.
locale Optional Salesforce locale value to use
apiuser Optional If not using Salesforce locale, this API Zuora user will be used to retrieve the locale from Zuora.
zquotesMajorVersion Optional

The major version number of Zuora Quotes you are generating the quote document in.

You can use a quote template with hierarchy sizes bigger than 3 if this is set to 7 or higher.

zquotesMinorVersion Optional The minor version number of Zuora Quotes you are generating the quote document in.

 

Response

success Contains true if successful, otherwise false
file URL of the generated quote document if the file was successfully generated
reasons

Error message if the file was not generated. It includes code and message. For example:

"reasons": [
        {
            "code": 57030000,
            "message": "Invalid login, password or token; or user locked out."
        }
    ]

processId When the API call is not successful, this processId is used to indicate the process ran in Zuora.

File Size Limitation 

The maximum export file size is 2047MB. If you have large data requests that go over this limit, you will get the following 403 HTTP response code from Zuora:
  <security:max-object-size>2047MB</security:max-object-size>

Submit a request at Zuora Global Support if you require additional assistance.

We can work with you to determine if large file optimization is an option for you.

Examples

CURL request:

curl -i -k -H "apiAccessKeyId:$USER_NAME" -H "apiSecretAccessKey:$PASSWORD" -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://api.zuora.com/rest/v1/quotes/document -d '
{
   "documentType":"pdf",
   "quoteId":"a0Bi000000A71rp",
   "serverUrl":"https://c.na10.visual.force.com/services/Soap/u/10.0/00DF00000008VnX",
   "templateId":"4028925648fdb7830148fdc1246c0003",
   "sessionId":"we764buuM03bkE0fmmc5zGMYp",
   "useSFDCLocale":"1",
   "locale":"en_US",
   "apiuser":"superadmin@zuora.com",
   "zquotesMajorVersion": "7",
   "zquotesMinorVersion": "0",
}'  

JSON response:

{
   "success": true,
   "file": 
      "https://api.zuora.com/rest/v1/file/2c92c09447f1ca410147f7bfed8c5a87"
}
Last modified

Tags

Classifications

(not set)