Skip to main content
Question

Composite Template - Merging Document with Server template overlay and Flattened pdf not working

  • October 29, 2025
  • 1 reply
  • 25 views

So I have to make an envelop using a combination of documents:

First is a lets say 10 page flattened pdf from our document management system that need to be in the envelop (in this document no signature or client input is required), then,

it is followed by another document that is from the same system and this I am overlaying with a server template.

Issue: When the envelop is created, the server template fields are overlaying on the first document and not the second where it is supposed to.

I am using the following Json:
 

{
    "allowMarkup": "false",
    "brandId": "86aee07f-0f86-4c26-xxxxx",
    "compositeTemplates": [
        {
            "compositeTemplateId": "1",
            "document": {
                "documentId": "1",
                "fileExtension": "pdf",
                "name": "forms.bound_pages",
                "transformPdfFields": "false"
            },
            "inlineTemplates": [
                {
                    "recipients": {
                        "signers": [
                            {
                                "email": "test@test.com",
                                "idCheckConfigurationName": "SMS Auth $",
                                "name": "Test (owner)",
                                "recipientId": "9ea3d677-8d34-4538xxxxx",
                                "recipientIdGuid": "66b773fc-7cc5-4f3cxxxxxx",
                                "requireIdLookup": "true",
                                "roleName": "Owner",
                                "routingOrder": "2",
                                "smsAuthentication": {
                                    "senderProvidedNumbers": [
                                        "+9185471xxxxx"
                                    ]
                                },
                                "tabs": {}
                            }
                        ]
                    },
                    "sequence": "1"
                }
            ]
        },
        {
            "compositeTemplateId": "2",
            "document": {
                "documentId": "2",
                "fileExtension": "pdf",
                "name": "forms.acknowledgment_of_policy_receipt",
                "transformPdfFields": "false"
            },
            "inlineTemplates": [
                {
                    "recipients": {
                        "signers": [
                            {
                                "email": "test@test.com",
                                "idCheckConfigurationName": "SMS Auth $",
                                "name": "Test2 (insured)",
                                "recipientId": "f0816925-df9bxxxxx",
                                "recipientIdGuid": "1f16e116-18xxxxx",
                                "requireIdLookup": "true",
                                "roleName": "Insured",
                                "routingOrder": "1",
                                "smsAuthentication": {
                                    "senderProvidedNumbers": [
                                        "+918547xxxxx"
                                    ]
                                }
                            },
                            {
                                "email": "test@test.com",
                                "idCheckConfigurationName": "SMS Auth $",
                                "name": "Test (owner)",
                                "recipientId": "86f14eec-3c1d-4cf0-xxxxx",
                                "recipientIdGuid": "66b773fc-7cc5-4f3c-xxxxx",
                                "requireIdLookup": "true",
                                "roleName": "Owner",
                                "routingOrder": "2",
                                "smsAuthentication": {
                                    "senderProvidedNumbers": [
                                        "+918547xxxxx"
                                    ]
                                }
                            }
                        ]
                    },
                    "sequence": "2"
                }
            ],
            "serverTemplates": [
                {
                    "sequence": "1",
                    "templateId": "448b460b-ce31-43e4xxxxx"
                }
            ]
        }
    ],
    "emailBlurb": "Please review and sign your contract documents. For assistance, contact test company support at support@test.com",
    "emailSettings": {
        "bccEmailAddresses": [],
        "replyEmailAddressOverride": "noreply@admin.com",
        "replyEmailNameOverride": "test company"
    },
    "emailSubject": "Your test company Contract Documents",
    "notification": {
        "expirations": {
            "expireAfter": "70",
            "expireEnabled": "true",
            "expireWarn": "45"
        },
        "useAccountDefaults": "false"
    },
    "status": "sent"
}

 

1 reply

JohnSantos
Guru
Forum|alt.badge.img+19
  • Guru
  • November 8, 2025

@suryagoel 

In your JSON, the inline template for the second composite appears before the serverTemplates array, meaning DocuSign applies it before the overlay from the server template is linked. So the tabs appear on the first doc (documentId 1) instead of documentId 2.

To fix this, reverse the order and explicitly bind the documentId to the server template overlay. You want DocuSign to apply the serverTemplate first, then the inline recipients, then attach the second PDF document to that specific composite.