Skip to content
LoanCo Sample App
HTML JavaScript CSS
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
models LoanCo Initial Commit Sep 19, 2019
pdfs LoanCo Initial Commit Sep 19, 2019
public LoanCo Initial Commit Sep 19, 2019
routes Fixing issue in loan-sailboat.js with the code that sets the BrandId Sep 20, 2019
sslcerts LoanCo Initial Commit Sep 19, 2019
views Updating about-us.md Sep 19, 2019
.bowerrc LoanCo Initial Commit Sep 19, 2019
.gitignore LoanCo Initial Commit Sep 19, 2019
DSAuthCodeGrant.js LoanCo Initial Commit Sep 19, 2019
LICENSE LoanCo Initial Commit Sep 19, 2019
Procfile LoanCo Initial Commit Sep 19, 2019
README.md LoanCo Initial Commit Sep 19, 2019
bower.json LoanCo Initial Commit Sep 19, 2019
config.js
helpers.js LoanCo Initial Commit Sep 19, 2019
package.json LoanCo Initial Commit Sep 19, 2019
server.js LoanCo Initial Commit Sep 19, 2019
setup.js LoanCo Initial Commit Sep 19, 2019

README.md

DocuSign LoanCo Sample App

LoanCo is a sample loan app that shows some common ways an application might interact with the DocuSign eSignature API. Various switches (authentication, embedded signing, templates) can be changed to show additional platform and API features and how easy they are to add to your own solution. LoanCo offers three (3) different loan workflows that demonstrate various features and workflows available through the platform.

Requirements

Installation

git clone <repo> 
cd <repo directory>
npm install
npm start

Running

npm start

Configuration

DocuSign has multiple ways of authenticating your app. This example is using Code Grant, which requires us to store a ClientSecret in addition to the Integration Key. read more about different authentication methods at https://developers.docusign.com/esign-rest-api/guides/authentication

We use environment variables to setup our configuration. You can store these variables in a .env file at the root (dotenv package is used)

DOCUSIGN_ENVIRONMENT=demo  // use "www" for production  
DOCUSIGN_IK=               // Integration Key 
EMPLOYEE_EMAIL=            // used for final recipient of Personal Loan
EMPLOYEE_NAME=             // used for final recipient of Personal Loan
LOCAL_RETURN_URL=http://localhost/   // change to the correct return url, with a trailing slash
BRAND_ID=                  // not required, use to show a different Brand for the Sailboat example 
GOOGLE_MAPS_API_KEY=       // required for Sailboat example to work
GOOGLE_TAG_MANAGER=        // GTM-XYZ
DEFAULT_EMAIL=             // for autofilling email input fields
FORCE_HTTPS=               // force https by setting to true
Templates

Templates are not currently automatically created. To create the Auto Loan template, follow these steps:

  1. Visit your Templates tab: https://appdemo.docusign.com/templates
  2. Click "New" and "Upload Template"
  3. Upload the file "pdfs/template-auto-loan.json" and click on the newly-created Template
  4. Copy the Template ID by clicking the "(I)" or information icon next to the Template title
  5. Paste the Template ID into the "pdfs/template-auto-loan.json" file, replacing the existing templateId value
  6. Restart the sample using npm start

Todo: When initially run, the app will attempt to create a Template for the Auto Loan Application. This template is defined at pdfs/template-auto-loan.json.

Deploy to Heroku

A few requirements:

  • Make sure you have the heroku toolbelt/CLI installed locally
  • Fill out the fields in the .env file after cloning
  • Install heroku-config to send your local env variables in .env to heroku (heroku plugins:install heroku-config)

Code:

git clone <repo>
cd <repo directory>

# <fill out fields in .env file>

# create heroku app
heroku create    

# test locally
heroku local

# push up .env file to heroku config (heroku plugins:install heroku-config)
heroku config:push

# push repo up to heroku 
git push heroku master

# view online
heroku open

Errors you may encounter

{ 
    errorCode: 'ACCOUNT_LACKS_PERMISSIONS',
    message: 'This Account lacks sufficient permissions. Document Visibility has been specified.  This account does not have document visibility turned on.' 
}

Change this setting: http://imgur.com/j4VD6nd on https://admindemo.docusign.com/sending-settings

{
    errorCode: 'PLAN_ITEM_NOT_ENABLED',
    message: 'A requested plan item is not enabled for this account. Plan item: AllowRequireWetSign' 
}

Contact Support (support@docusign.com) and request "Allow Require Wet Sign" to be enable on your account, and then change this setting: http://imgur.com/a/mJ5WC on https://admindemo.docusign.com/signing-settings under "Recipients"

API Tools and Links

Developer Center
https://developers.docusign.com

API Code Examples
https://developers.docusign.com/esign-rest-api/code-examples

API Documentation
https://developers.docusign.com/esign-rest-api/reference

API Explorer
https://apiexplorer.docusign.com/

License

The DocuSign LoanCo Sample App is licensed under the MIT License.

You can’t perform that action at this time.