Skip to main content
Solved

Composite Templates - merge multiple server templates into single PDF

  • February 27, 2025
  • 3 replies
  • 34 views

Forum|alt.badge.img+1

I’m looking into the possibility of merging together two (or more) server templates into a single PDF; currently I’m creating envelopes through Python and using Composite Templates. The envelope structure I have so far makes it so that each Composite Template results in a single PDF; each Composite Template has its own Server Template and/or Inline Template, depending on the specific template I need to use -- now, what I need (but isn’t working) is something like this (taken from another post):
 

{
  "emailSubject": "DocuSign Widget Order, Signature and NDA",
  "emailBlurb": "Please let us know if you have any questions.",
  "status": "sent",
  "compositeTemplates": [
    {
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "{{NDA Template}}"
        },
        {
          "sequence": "2",
          "templateId": "{{Signature Template}}"
        } <-- this used to be a separate Composite Template object
      ],
      "inlineTemplates": [
        {
          "sequence": "1",
          "customFields": {
            "textCustomFields": [
              {
                "name": "customerID",
                "value": "0980981",
                "show": "true"
              }
            ]
          },
          "recipients": {
            "signers": [
              {
                "email": "{{Signer Email}}",
                "name": "{{Signer Name}}",
                "roleName": "Customer",
                "recipientId": "1",
                "tabs": {
                  "textTabs": [
                    {
                      "tabLabel": "company",
                      "value": "ABC Corporation"
                    }
                  ]
                }
              },
              {
                "email": "{{Sender Email}}",
                "name": "{{Sender Name}}",
                "recipientId": "2",
                "roleName": "Legal"
              }
            ]
          }
        },
        {
          "sequence": "2",
          "customFields": {
            "textCustomFields": [
              {
                "name": "customerID",
                "value": "0980981",
                "show": "true"
              }
            ]
          },
          "recipients": {
            "signers": [
              {
                "email": "{{Signer Email}}",
                "name": "{{Signer Name}}",
                "roleName": "Customer",
                "recipientId": "1",
                "tabs": {
                  "textTabs": [
                    {
                      "tabLabel": "company",
                      "value": "ABC Corporation"
                    }
                  ]
                }
              },
              {
                "email": "{{Sender Email}}",
                "name": "{{Sender Name}}",
                "recipientId": "2",
                "roleName": "Legal"
              }
            ]
          }
        }
      ]
    },
    {
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "{{Order Template}}"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "1",
          "recipients": {
            "signers": [
              {
                "email": "{{Signer Email}}",
                "name": "{{Signer Name}}",
                "recipientId": "1",
                "roleName": "Customer"
              }
            ]
          }
        }
      ]
    }
  ]
}

I mention it isn’t working because, while first it would show all three templates (NDA, Signature, and Order) in the example above, resulting in three separate PDFs, now it doesn’t show the Signature template at all, only the other two ones.

Am I doing something wrong (most likely) or is it not possible to merge PDFs like this? 

Best answer by mrave

@CPaparoniGlas 

The composite template functionality does not merge PDFs. Instead, it is used to combine multiple templates into a single envelope. As a result, the documents from the different templates will remain individual documents.

However, after the envelope is fully signed, you can use the "Combined download" feature to download a single, merged PDF file from DocuSign eSignature. This can be done via the API by using this API call and setting the value of “documentId” to “combined”.

View Original
Is this content helpful?

3 replies

Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 925 replies
  • Answer
  • February 28, 2025

@CPaparoniGlas 

The composite template functionality does not merge PDFs. Instead, it is used to combine multiple templates into a single envelope. As a result, the documents from the different templates will remain individual documents.

However, after the envelope is fully signed, you can use the "Combined download" feature to download a single, merged PDF file from DocuSign eSignature. This can be done via the API by using this API call and setting the value of “documentId” to “combined”.


Forum|alt.badge.img+1

@Michael.Rave Understood; is there a feature within DocuSign that would selectively merge individual documents, as opposed to all of them?


Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 925 replies
  • February 28, 2025

@CPaparoniGlas 

When doing a “Combined download” from the Docusign eSignature Web App you can choose the documents you want to merge before downloading. Via the API it will always merge all documents.