How to allow signers to sign in a particular order?

In BoldSign, enabling the signing order option allows you to specify the sequence in which signers will receive the email and subsequently sign the document. This ensures that documents are handled in an organized and accountable manner.This guide will go through the process of how to enable signing order using BoldSign API. You can enable signers to sign in a specific order by setting EnableSigningOrder to true and configuring the SignerOrder property accordingly.

Here are example codes that can be used to achieve this:

Code snippet

curl -X 'POST' \
  'https://api.boldsign.com/v1/document/send' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {Your API Key}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Title="Sample Document"' \
  -F 'EnableSigningOrder=True' \
       -F 'Signers={
        "name": "David",
        "emailAddress": "david@cubeflakes.com",
        "signerType": "Signer",
        "signerOrder": 1,
        "formFields": [
           {
                "id": "Signature1",
                "name": "Signature2",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 50,
                  "y": 50,
                  "width": 125,
                  "height": 25
                   },
      "isRequired": true
    }
  ],
  "locale": "EN"
}' \
  -F 'Signers={
  "name": "hanky",
  "emailAddress": "hanky@cubeflakes.com",
  "signerType": "Signer",
  "signerOrder": 2,
  "formFields": [
           {
                "id": "Signature2",
                "name": "Signature2",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 100,
                  "y": 100,
                  "width": 125,
                  "height": 25
                   },
      "isRequired": true
    }

 
  ],
  "locale": "EN"
}' \
  -F 'Files=@{your file}' \


import requests
import json
url = "https://api.boldsign.com/v1/document/send"

signer_data1 = {
    "name": "David",
    "emailAddress": "david@cubeflakes.com",
    "signerType": "Signer",
    "signerRole": "Signer",
    "signerOrder": 1,

    "formFields": [
    {
     "id": "Signature1",
      "type": "FieldType.Signature", 
      "pageNumber": 1,
      "bounds": {
        "x": 50,
        "y": 50,
        "width": 200,
        "height": 100
      },
      "isRequired": True,
    }
    ],
    "locale": "EN"
}

signer_data2 = {
    "name": "Hanky",
    "emailAddress": "hanky@cubeflakes.com",
    "signerType": "Signer",
    "signerRole": "Signer",
    "signerOrder": 2,
    "formFields": [
    {
     "id": "Signature2",
      "type": "FieldType.Signature", 
      "pageNumber": 1,
      "bounds": {
        "x": 100,
        "y": 100,
        "width": 200,
        "height": 100
      },
      "isRequired": True,
    }
    ],
    "locale": "EN"
}

headers = {
     'accept': 'application/json',
     'X-API-KEY': '{Your API Key}'
 }
payload = {
    'Signers': [json.dumps(signer_data1), json.dumps(signer_data2)],
    'EnableSigningOrder':True,
    'Title':"Signing order document"
}

files = [
    ('Files', ('{file name}', open('Your file path', 'rb'), 'application/pdf'))
]
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.text)

const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('Message', 'Please sign this');
data.append('Signers', '{\r\n  "name": "Hanky",\r\n        "signerOrder": 1,\r\n   "emailAddress": "david@cubeflakes.com",\r\n     "signerType": "Signer",\r\n   "formFields": [\r\n   {\r\n  "id": "signature",\r\n  "name": "signature",\r\n   "fieldType": "Signature",\r\n   "pageNumber": 1,\r\n  "bounds": {\r\n "x": 50,\r\n  "y": 50,\r\n "width": 100,\r\n  "height": 25\r\n },\r\n "isRequired": true\r\n }\r\n ],\r\n  "locale": "EN"\r\n}');
data.append('Signers', '{\r\n  "name": "Cilian",\r\n   "signerOrder": 2,\r\n  "emailAddress": "hanky@cubeflakes.com",\r\n   "signerType": "Signer",\r\n  "formFields": \r\n    [\r\n  {\r\n  "id": "sign_1",\r\n  "name": "sign_1",\r\n   "fieldType": "Signature",\r\n   "pageNumber": 1,\r\n  "bounds": {\r\n  "x": 50,\r\n   "y": 50,\r\n  "width": 100,\r\n   "height": 25\r\n },\r\n  "isRequired": true\r\n }\r\n        ],\r\n  "locale": "EN"\r\n }');
data.append('Files', fs.createReadStream('{Your file path}'));
data.append('Title', 'Sample document');
data.append('EnableSigningOrder', 'true');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.boldsign.com/v1/document/send',
  headers: { 
    'accept': 'application/json', 
    'X-API-KEY': '{Your API Key}', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

In conclusion, by setting EnableSigningOrder to true and configuring the SignerOrder property accordingly, you can effectively enable signers to sign documents in a predetermined sequence.

After executing the above code, the document will be created, and an email will be sent to the first signer. Once the first signer completes the signing process, an email will be sent to the next signer based on the signer order.