Happy Business Starts Here

Quote Generate PDF API Call error - There has been an unknown internal error happened. ({0})\n

Highlighted
Zuora Support

Quote Generate PDF API Call error - There has been an unknown internal error happened. ({0})\n

Problem:

 

we're trying to send this request:

req.setHeader('apiAccessKeyId',xxx@yyy.com);
req.setHeader('apiSecretAccessKey',xxyyzz);
req.setHeader('Content-Type',application/json);
req.setEndpoint(https://rest.sandbox.eu.zuora.com/v1/quotes/document);
req.setMethod('POST');

req.setBody(body);
body : {
"documentType" : "PDF",
"quoteId" : "a3Y3E000000xxxx",
"serverUrl" : "https://{server}.my.salesforce.com/services/Soap/u/47.0/00D3E000000xxxx",
"sessionId" : "XXXXXXXX",
"templateId" : "8adcd9eb6e4427c7016e4aba044XXXXX",
"zquotesMajorVersion" : "7",
"zquotesMinorVersion" : "0"
}
we also tried to delete the not required fields and change some parameters but we receive always : {
"success" : false,
"processId" : "5D6A8B292DB3D913",
"reasons" : [ {
"code" : 57030000,
"message" : "There has been an unknown internal error happened. ({0})\n"
} ]
}.

For the same quote, the button generates PDF on salesforce works fine. Is the request wrong or something is missing?

 

Solution:

After analyzing, we found that the "Server URL" custom formula field which the customer using is wrong.

 


The allowed version is 10.0 as per the API knowledge center.


When changed the server URL to "https://{server}.my.salesforce.com/services/Soap/u/10.0/00D3E000000xxxx", from "https://{server}.my.salesforce.com/services/Soap/u/47.0/00D3E000000xxxx", I can able to run the call successfully.


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






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