Server-to-Server Flow with Static Templates

Overview

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 https://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 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).
  • Recipients are participants in an envelope's actual workflow. Recipients must be defined explicitly (Sally or Richard).

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:

  1. Select and upload a PDF file to use as the first document to be signed.
  2. 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.
  3. 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.
  4. 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:

import { createEnvelope, authenticateApp } from '@verdocs/js-sdk';

const client_id = 'REPLACE_ME';
const client_secret = 'REPLACE_ME';
const template_id = 'REPLACE_ME';

async function runMe() {
  await authenticateApp(VerdocsEndpoint.getDefault(), { client_id, client_secret });
    
  const request: ICreateEnvelopeRequest = {
    template_id,
    name: '51 Academy Ln, Apt. 2 Lease Agreement, 5/1/24 - 4/30/25',
    roles: [
      { type: 'signer', name: 'Lessee1', email: 'lessee@nomail.com', sequence: 1 },
      { type: 'signer', name: 'LeasingAgent', email: 'agent@nomail.com', sequence: 2 },
    ],
  };

  const envelope = await createEnvelope(VerdocsEndpoint.getDefault(), request);
  console.log(envelope); // <-- Will contain all metadata for the newly-created envelope
}

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:

// Add this import:
import { getInPersonLink } from '@verdocs/js-sdk';

// Include no_contact in the request:
const request: ICreateEnvelopeRequest = {
  ... other fields as illustrated above
  no_contact: true
};

const envelope = await createEnvelope(VerdocsEndpoint.getDefault(), request);
  
// Get signing links for all recipients
for await let (recipient of envelope.recipients) {
  const link = await getInPersonLink(VerdocsEndpoint.getDefault(), envelope.id, recipient.role_name);
  console.log(link); // <-- Will contain a URL that you may email to the recipient to sign the document
}