PostIssuance Plugin


Some complex policies have many small documents, which are rendered separately. For cases where it’s desired to present these to the insured as a single package, it is useful to consolidate them within a single PDF file.

To support this and future use cases, Socotra now has a PostIssuance plugin which will fire after each major policy transaction’s issue event. The consolidation order can be invoked within this event.


When the plugin is triggered, the following will occur:

  • The data payload is sent to the plugin and afterwards the returned object is inspected.

  • The response to the initiating API request is made, and then an asynchronous consolidation procedure is initiated.

  • If there are any DocumentConsolidation objects, then for each one, in the order that the document locators are listed, they will be concatenated into a single consolidated document.

  • Metadata will be set for the new document, including fileName and displayName.

  • The consolidated document will then be persisted, and it will then appear with other policy documents with the policy.


If the deleteSourceDocuments property is true, each source document will be removed after consolidation


Document consolation is an asynchronous process. Consolidation may not be complete at the time of the initial API response.


This plugin is configured similarly to other plugins. See the Plugins topic for details. Here is a portion of a product’s policy.json file enabling the plugin:

  "plugins": {
    "getPostIssuanceResult": {
      "path": "main/postIssuance.js",
      "enabled": true


The plugin is invoked with a data payload that contains information about the documents for the policy. Here is a simple example that shows all of the documents being consolidated on each invocation:

function getPostIssuanceResult(data)
  let locators = => d.locator);
  return {
    documentConsolidations: [{
      displayName: "My Consolidated Document",
      documentLocators: locators,
      fileName: "consolidated.pdf",
      deleteSourceDocuments: true
exports.getPostIssuanceResult = getPostIssuanceResult;
policyLocator string
operation string newBusiness | endorsement | renewal | reinstatement | cancellation
locator string
displayName string
fileName string

createdTimestamp timestamp
urlExpirationTimestamp timestamp
policyModificationLocator string
url string
documentConsolidations [DocumentConsolidation]
displayName string
documentLocators [string]
fileName string

deleteSourceDocuments boolean

Document Types

Only PDFs are supported. HTML-based documents can neither be a source of a consolidated document, nor the resultant document.