Generate Quote Document API
Creates and saves a CPQ quote document.
| Required Editions |
|---|
| Available in: Salesforce CPQ Winter ’19 and later |
- Name
QuoteDocumentAPI.SaveProposal
“Proposal” refers to Salesforce CPQ’s Quote Document object.
- Formats
JSON, Apex
- HTTP Method
POST
- Authentication
Authorization: Bearer token
| Name | Type | Required | Definition |
|---|---|---|---|
| Name | String | No | The document name |
| paperSize | String | No | Values are Default, Letter, Legal, A4. Defaults to “Default.” |
| outputFormat | String | No | Values are PDF, Word. Defaults to “PDF.” |
| quoteId | ID | Yes | The quote’s ID |
| templateId | ID | Yes | The quote template’s ID |
| language | String | No | Defaults to “en_US.” |
| Name | Type | Description |
|---|---|---|
| jobID | ID | Apex queueable job ID |
Example request body data.json file for generating and saving a quote document.
Example response body after creating the APEX job for creating the quote document.
If the Bearer token contains special characters, enclose the Authorization header in single quotes instead of double quotes.
Before saving the GenerateQuoteProposal example class, make sure that the CPQ model classes are added as individual APEX classes in your org.
Run the following code in anonymous Apex to get the Apex job ID for generating and saving the quote proposal.
- Attachments marked Required are ignored when you’re using the API. In contrast, when you’re using the Preview and Generate document buttons, the attachments are automatically generated as part of the document.
- An attachment in the Template section is always included regardless of whether it’s marked Required. This behavior is also observed when you’re using Preview and Generate document buttons.
- Guest users can’t create quote documents in the Documents folder. See Salesforce Help and SOAP API Developer Guide for details.
See Also