You are here: Integrating With CPQ Cloud > REST APIs > REST API for Document Designer

REST API for Document Designer

OVERVIEW

The documentGenerator REST API allows an external system to send a REST call to request a published Document Designer document from CPQ Cloud based on simple parameters.

When executed correctly, the external system will receive the URL of the document in the Location header of the REST response from CPQ Cloud.

ADMINISTRATION

ClosedDocument Generator REST API

The call must contain HTTP Basic Authentication with valid CPQ Cloud FullAccess credentials in the header, as well as the Commerce Process, Document Designer template, Transaction ID, language, and output type that the document will be generated by specified in the body.

  documentGenerator API
Description

POST—Returns the URL of a document generated by a Document Designer template.

GET—Returns schema for the resource (REST call does not require a payload).

URI Endpoint https://{site url}/rest/v1/documentGenerator
Endpoint Parameter {siteurl} The base URL of the CPQ Cloud site.
Headers Accept (Basic Authentication with valid CPQ Cloud FullAccess credentials)
Content-Type: application/json
Payload Structure
(Parameters Bolded and Red)

{

"processVarname":"[Process Var Name]",

"templateName":"[Template Name]",

"transactionId":[Transaction ID],

"languageCode":[Language Code],

"outputFormat":"[Output Format]"

}

Payload Parameters Process Varname

The variable name of the Commerce Process.

All Commerce Processes’ variable names are listed in the REST API metadata schema. See the Document Generator REST API Metadata section for more information.

Template Name

The name of the Document Designer Template.

All Document Designer template names (and the Commerce Processes they are in) are listed in the REST API metadata schema. See the Document Generator REST API Metadata section for more information.

Transaction ID

The Transaction ID of the Transaction from which the document will be generated.

Language Code

The language code of the language in which the document will be generated.

All language codes are listed in the REST API metadata schema. See the Document Generator REST API Metadata section for more information.

Output Format

The output type in which the document will be generated.

All output formats are listed in the REST API metadata schema. See the Document Generator REST API Metadata section for more information.

HTTP Methods POST, GET (Does not require a payload)
Success Response

204 – Success

POST—The URL of the generated document will be in the response’s Location header.

GET—The schema of the resource will be in the response body.

Failure Responses

400 – Bad request

An error message will say whether the Commerce Process variable name, Transaction ID, template, language, output, or a combination of those parameters were not found, or if there was an error deploying or printing the template.

401 – Unauthorized

Valid CPQ Cloud FullAccess credentials were not provided in the header.

Sample URI Endpoint https://site.oracle.com/rest/v1/documentGenerator

Sample Payload
(Parameters Bolded and Red)

{

"processVarname":"northAmericaQuotes",

"templateName":"Proposal Template",

"transactionId":12345678,

"languageCode":-1,

"outputFormat":"PDF"

}

Notes
  • Even if a CPQ Cloud site only has one supported language, that language’s code must still be included in the body of the POST REST call.
  • Only deployed Document Designer templates can produce a document via a REST call.

ClosedDocument Generator REST API Metadata

In addition to getting the schema through a GET call, when writing documentGenerator REST API calls, admins can access the resource’s metadata schema through the Interface Catalogs. Navigate to the Interface Catalogs by clicking Admin to go to the Admin Home Page and then clicking Interface Catalogs in the Integration Platform section. Clicking the documentGenerator resource will open the metadata schema in a new window.

The metadata schema includes all possible Commerce Process variable names (processVarname), Document Designer template names (templateName), language codes (languageCode), and output formats (outputFormat) in each corresponding description object that can be used in a REST call to the documentGenerator API, and should be used to inform REST calls that are being written. The following screenshot shows a sample documentGenerator resource metadata schema.


NOTES

For more information on the Interface Catalogs, see Interface Catalog.

RELATED TOPICS

Related Topics Link IconSee Also