0
votes

I have created a template in my DocuSign account. As the UI requires, I have uploaded a document.

I have been trying to create a transaction using this template, however, I need to add documents to this transaction, on top of the ones provided in the template.

Looking at the DocuSign Template documentation, it doesn't seem possible as it is mentioned : To apply a template to an envelope you must set the templateId and templateRoles properties in your envelope definition. Since the template contains document(s) already you do not need to configure the documents node.

Am I missing something ?

1

1 Answers

1
votes

You can use composite templates and specify a new document in addition to the documents present in the server template.

{
    "compositeTemplates": [
        {
            "compositeTemplateId": "1",
            "serverTemplates": [
                {
                    "sequence": "1",
                    "templateId": "<Specify the server template Id here>"
                }
            ],
            "inlineTemplates": [
                {
                    "sequence": "1",
                    "recipients": {
                        "signers": [
                            {
                                "name": "Recipient One",
                                "email": "[email protected]",
                                "roleName": "Signer", //This is the role name in the server template
                                "recipientId": "1"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "compositeTemplateId": "2",
            "inlineTemplates": [
                {
                    "sequence": "2"
                }
            ],
            "document": {
                "documentId": "3", //Make sure this documentId is different from the document's present in the server template.
                "name": "DocumentThree",
                "fileExtension": "txt",
                "documentBase64": "RG9jIFRXTyBUV08gVFdP"
            }
        }

    ],
    "emailSubject": "Adding a new doc with composite templates",
    "status": "created"
}