Server Workflow with Static Templates
This workflow is the simplest use-case, and is the recommended place to start when building an e-Signing experience using Verdocs.
Create a Free Account
Access to Verdocs is broken down into two components that work together to control who can create, edit, and use templates in signing requests:
- Organizations represent groups of user profiles, and manage the permissions and features those users have within the system.
- Profiles represent an individual user within an organization. Note that a person may be a member of more than one organization.
When creating an account, both a profile and organization will be created at the same time. The first profile will automatically be granted Owner-level access within that organization.
Get started by creating an account at app.verdocs.com.
Basic Terminology
In addition to organizations and profiles, it is helpful to understand a few additional terms that will be used in the workflow:
- Templates are reusable collections of documents, fields, and roles that can be used within a signing flow. For example, a purchase agreement might have the bill of sale document, signature and date fields, and roles defined as Buyer and Seller.
- Envelopes are individual instances of templates. For the above purchase agreement, one envelope might be John buying a motorcycle from Sally, and another might be Richard buying an excavator from Jason.
- Roles are individual instances of templates. For the above purchase agreement, one envelope might be John buying a motorcycle from Sally, and another might be Richard buying an excavator from Jason.
- Recipients are pre-defined participants in a template, such as Buyer or Seller. A role MAY be pre-defined (e.g. an Officer Manager or company officer might be known ahead of time) but this is not required).
Create a Template
After creating an account, you will be taken to a dashboard without any content created yet. Simply click New Template to get started:
This will present a wizard that walks you through the template creation process. At a minimum, you should:
- Select and upload a PDF file to use as the first document to be signed.
- On the next tab, add at least one role by clicking the (+) button. You can drag roles up to down to set the order in which they will act while signing. Roles that are on the same line (at the same sequence) will act in parallel, and will receive invites at the same time. Roles on separate lines will act in series, and will not receive invites until all previous participants have completed their steps.
- Add at least one field on the Fields tab. NOTE: For a template to be "sendable", it must contain a. at least one role, and b. Every role must have at least one field assigned.
- If you would like to test the template, navigate to the Preview tab. You can send the template to yourself manually from there to verify it is working as expected.
Send an Envelope Programmatically
To send copies of that template programmatically, you will first need to create an API key. To do this, navigate to Settings -> API Keys, and click [Create Key]. Copy the Client ID and Secret from this dialog into your code.
Create a simple project as follows:
md verdocs-quickstart
cd verdocs-quickstart
npm init (accept all the defaults)
npm i -S @verdocs/js-sdk
You will also need the template ID, which you can get from the URL bar of your browser while previewing it.
The following code will then create and send an envelope using your account:
1import { createEnvelope, authenticateApp } from '@verdocs/js-sdk';
2
3const client_id = 'REPLACE_ME';
4const client_secret = 'REPLACE_ME';
5const template_id = 'REPLACE_ME';
6
7async function runMe() {
8 await authenticateApp(VerdocsEndpoint.getDefault(), { client_id, client_secret });
9
10 const request: ICreateEnvelopeRequest = {
11 template_id,
12 name: '51 Academy Ln, Apt. 2 Lease Agreement, 5/1/24 - 4/30/25',
13 roles: [
14 { type: 'signer', name: 'Lessee1', email: '[email protected]', sequence: 1 },
15 { type: 'signer', name: 'LeasingAgent', email: '[email protected]', sequence: 2 },
16 ],
17 };
18
19 const envelope = await createEnvelope(VerdocsEndpoint.getDefault(), request);
20 console.log(envelope); // <-- Will contain all metadata for the newly-created envelope
21}
That's all there is to it! The response from createEnvelope will include all of the metadata required to work with the envelope again in the future. The most important field is its id, so you may want to record this in your own database. The envelope ID may be used in future calls to retrieve that envelope's status, cancel it, or retrieve its final, signed document attachments.
Self-Managed Email and Other Contact Methods
Using the above workflow, Verdocs will automatically invite users to sign documents via email or SMS invitations, depending on the values you supply when creating the envelope. If you want to handle communications yourself, to customize the email template and/or the entire signing experience, simply include no_contact in the call:
1// Add this import:
2import { getInPersonLink } from '@verdocs/js-sdk';
3
4// Include no_contact in the request:
5const request: ICreateEnvelopeRequest = {
6 ... other fields as illustrated above
7 no_contact: true
8};
9
10const envelope = await createEnvelope(VerdocsEndpoint.getDefault(), request);
11
12// Get signing links for all recipients
13for await let (recipient of envelope.recipients) {
14 const link = await getInPersonLink(VerdocsEndpoint.getDefault(), envelope.id, recipient.role_name);
15 console.log(link); // <-- Will contain a URL that you may email to the recipient to sign the document
16}
17