How to send an envelope to an In Person Signer
This topic demonstrates how to host an In Person Signing session. In Person Signing allows a host to facilitate a Docusign session for a signer who is physically in the same location as them.
Prerequisites
-
Install the Docusign eSignature for Salesforce managed package.
-
Create a subdomain for your Salesforce organization by enabling “My Domain.”
-
Select the Docusign Setup tab and complete the login step.
-
Create a template in your Docusign account. The template should have one In Person Signer with the role “Customer.” Add a document. See the image below.

Required data
Running the code in this how-to requires this data:
Step 1. Define your class and method
Create the class and method that will contain the code in this example. You can skip this step if you are adding this code to an existing class.
Step 2. Create an envelope
First, get the ID of an Opportunity in your Salesforce org. Then create an empty dfsle.Envelope object using this Opportunity ID as the source ID.
Step 3. Create an In Person Signer recipient
Create a new dfsle.Recipient object for the In Person Signer. Set the recipient’s type to inPersonSigner.
Make sure that the role for the signer matches the role in your template. In this case the template has one recipient: an In Person Signer with the role Customer. Add the recipient to the envelope with the withRecipients method.
Step 4. Create a document from a template
Create a Document object using the dfsle.Document.fromTemplate method. Pass the ID of a template in your Docusign account. Then use the dfsle.Envelope.withDocuments method to add the document to your envelope.
Step 5. Send the envelope
Use the dfsle.EnvelopeService.sendEnvelope method to send the envelope.
Step 6. Execute your method
To execute your code, go to the Developer Console in Salesforce, open the Debug menu, then select Open Execute Anonymous Window. Type the accompanying code in the window and select Execute.
View the source code for this how-to on GitHub: Apex
Expected response
If your API call is successful, the envelope will be sent to the host’s email with a message asking them to host the In-Person Signing session. The email will direct them to the screen shown.
After choosing Start, they can hand the device to the In Person Signer to sign the document. Then the host can complete the signing session per the listed steps.
Next steps
- See all available Apex Toolkit How-to guides.
- Learn How to send an envelope with tabs.
- See How to perform unit testing to ensure that you have adequate code coverage.