Create a document pack with multiple documents

📘

The below will allow you to create multiple documents within a single document pack.

When using the document_packs API you're able to use form field documents, syntax field documents as well as existing templates and merge them into a single document pack. Once done, the process will automictically request signatures if specified to do so, we will be auto requesting signatures in the below example.

Our test case scenario: Create a document_pack that consists of two documents, one for the employee to sign and one for the employer to fill in details and sign. Lets assume we already know the first and second name of the employee as well as the employers company name, we can pre-populate these fields before received by the signees.

Getting started

This process will use the Call POST /document_packs?auto_request_signatures_when_ready=true
(Please note this request expects an access_token set in the HEADER).

The above POST call includes the parameter auto_request_signatures_when_ready set to true, this parameter is optional based on your requirements. This will automatically request signatures when receiving a 200 response when making the call.

This creates a new document pack with the documents specified in the request body (explained below), along with other customizable fields. This document_pack will consists of two documents, one syntax pdf (for the employee to sign) and one form field pdf (for the employer to enter in required details as well as sign).

Syntax document:

Syntax document will consists of 3 fields assigned to the first signee setup as signer-1.

custom_idtypeassigneeto pre-populate with value
first_nametextsigner-1Joe
second_nametextsigner-1Soap
employee_signaturesignaturesigner-1

Form field document:

Form field document will consists of 3 fields assigned to the second signee setup as signer-2.

custom_idtypeassigneeto pre-populate with value
company_nametextsigner-2QuicklySign
registration_numbertextsigner-2
employer_signaturesignaturesigner-2
curl --location --request POST 'https://sandboxapi.quicklysign.com/v1/document_packs?auto_request_signatures_when_ready=true' \
--header 'Content-Type: application/json' \
--header 'Access_token: <access_token> ' \ //this value is generated using the access_tokens API POST request
--data-raw '{
    "cc_recipients": [{"name":"Joe Soaps Brother", "email": "[email protected]"}], //this user will receive a completed copy of the document, can be left as NULL
    "document_pack_name": "My Document Pack Example", //specify a name for your document_pack
    "document_type": "document",
    "documents": [
        {
            "document_creation_settings": {
                    "base_64_document": "<base_64 value of your document>", //Converted our document into a base_64 value which can be used in this field
                    "extract_fields_by_tag": true //this is used specifically if you're using syntax tags in your document
              
            },
            "document_name": "my syntax employee form", //name of the first child document under your document pack
            "data_fields":[{"custom_id":"first_name", "data":"Joe", "signatory_uuid":"signer_1"}, //find the pre-defined field in the syntax document using custom_id, apply data to this field using the value tag. Assign this field to a signer using signatory_uuid that we specify below
                           {"custom_id":"last_name", "data":"Soap", "signatory_uuid":"signer_1"},
                           {"custom_id":"employee_signature", "signatory_uuid":"signer_1"}]
          
        }, 
        {
            "document_creation_settings": {
                    "document_url": "https://www.quicklysign.com/s/example_form_field.pdf", //points to the form field document, this can be a base64 code as well. instead of document_url we could use base_64_document followed by the base 64 value
                    "extract_fields_from_form_fields_with_metadata": true, //this is used specifically if you're using form field tags in your document
                    "apply_extracted_fields": true //this is used specifically if you're using form field tags in your document
              
            },
            "document_name": "my syntax employee form", //name of the second child document under your document pack
            "data_fields":[{"custom_id":"company_name", "data":"QuicklySign", "signatory_uuid":"signer_2"}, //find the pre-defined field in the syntax document using custom_id, apply data to this field using the value tag. Assign this field to a signer using signatory_uuid that we specify below under "signatories"
                             {"custom_id":"registration_number", "signatory_uuid":"signer_2"},
                             {"custom_id":"employer_signature", "signatory_uuid":"signer_2"}]
          
        }
    ],
    "mail_settings": { //not mandatory, this can be left out if you do not want to setup custom mail settings
        "exclude_created_by_from_final_mail": false, //flag to indicate whether the user who created this document receives a final copy email once the document has been signed and finalized
        "include_attachments_in_final_mail": false, //flag to include or exclude the completed document as an attachment when document has been signed and finalized
        "message": "Custom email body message", //custom body to reflect in the email body
        "subject": "My First Document Pack" //subject to reflect for the email received by the signer
    },
    "signatories": //specify your signatories details, in this case we are setting up two, one for each of the above documents
    [
        {
            "uuid":"signer_1", //this is our unique identifier, this is also used in our above data_fields to specify who the field should be assigned to
            "name":"Mr First Signer",
            "role":"signer_1",
            "mobile_number":"0000000000", //mobile number can be ignored if primary_communication_channel is email (user will receive their OTP via email if use_two_factor_authentication is set to true under signing_settings and no mobile numnber is supplied)
            "email":"[email protected]",
            "primary_communication_channel": "email" //signer to be prompt to sign his/her document via email
        },
          {
            "uuid":"signer_2",
            "name":"Mr Second Signer",
            "role":"signer_2",
            "mobile_number":"0000000000",
            "email":"[email protected]",
            "primary_communication_channel": "whatsapp" //signer to be prompt to sign his/her document via whatsapp
        }
    ],
    "signing_settings": {
        "attachments_visible_to_all_signers": true,//all users can see attachments provided in the document
        "branding_key": null,//please see branding tutorial process
        "can_use_drawn_signature": true,//allow the singer to draw their signature
        "can_use_one_click_initial": true, //if an existing user, their pre-defined initial will auto populate within the initial field
        "can_use_one_click_signature": true,//if an existing user, their pre-defined signature will auto populate within the signature field
        "can_use_typed_signature": true,//flag to allow signer to type out their signature
        "can_use_uploaded_signature": true,//flag to allow signer to upload an image of their signature
        "post_signing_url": "",//this can be populated with a URL that the user will be sent to once signing has been completed
        "sequential_signing": true, //once the first signer has completed his/her fields, the second signer will then be prompt to complete his/her fields. If false, both signers will be sent a request to sign the document at the same time
        "use_signing_wizard": true, //use_signing_wizard will direct the user to each field required for them to complete
        "use_two_factor_authentication": true //user will be prompt to enter in their OTP via email(if not mobile number provided) or SMS/Whatsapp
    }
}
{
    "data": {
        "document_pack": {
            "cc_recipients": [ //returned model of our specified cc_recipients
                {
                    "date_updated": null,
                    "email": "[email protected]",
                    "mobile_number": null,
                    "name": "Joe Soaps Brother",
                    "user_key": null
                }
            ],
            "created_by_email": "[email protected]", //this email is associated with account you're using to make the API requests
            "created_by_external_user_code": null,
            "custom_data": null,
            "date_created": 1658332101143.7028808594,
            "date_updated": 1658332101144.2790527344,
            "document_pack_name": "My Document Pack Example",
            "document_type": "document",
            "documents": [
                {
                    "custom_data": null,
                    "data_fields": [ //high overview of the details behind each data_field that was detected when uploading the document as well as the fields we setup in the request
                        {
                            "auto_assign_date": null,
                            "auto_fill": null,
                            "background_colour": null,
                            "blob": null,
                            "checkbox_group_id": null,
                            "continue_if_signer_question": null,
                            "custom_id": "first_name",
                            "data": "Joe",
                            "data_field_presentation": null,
                            "date_updated": null,
                            "description": null,
                            "field_enabled_condition": null,
                            "field_group_id": null,
                            "filename": null,
                            "height": null,
                            "mutually_exclusive": false,
                            "options_as_csv": null,
                            "required": null,
                            "signatory_role": null,
                            "signatory_uuid": "signer_1",
                            "tag_id": null,
                            "type": null,
                            "uuid": "ebb42142-15b6-4933-bd19-0bddc2fca7ed",
                            "width": null,
                            "x": null,
                            "y": null
                        },
                        {
                            "auto_assign_date": null,
                            "auto_fill": null,
                            "background_colour": null,
                            "blob": null,
                            "checkbox_group_id": null,
                            "continue_if_signer_question": null,
                            "custom_id": "last_name",
                            "data": "Soap",
                            "data_field_presentation": null,
                            "date_updated": null,
                            "description": null,
                            "field_enabled_condition": null,
                            "field_group_id": null,
                            "filename": null,
                            "height": null,
                            "mutually_exclusive": false,
                            "options_as_csv": null,
                            "required": null,
                            "signatory_role": null,
                            "signatory_uuid": "signer_1",
                            "tag_id": null,
                            "type": null,
                            "uuid": "04628b25-6e26-4baa-a8bc-2afc59eb9cb7",
                            "width": null,
                            "x": null,
                            "y": null
                        },
                        {
                            "auto_assign_date": null,
                            "auto_fill": null,
                            "background_colour": null,
                            "blob": null,
                            "checkbox_group_id": null,
                            "continue_if_signer_question": null,
                            "custom_id": "employee_signature",
                            "data": null,
                            "data_field_presentation": null,
                            "date_updated": null,
                            "description": null,
                            "field_enabled_condition": null,
                            "field_group_id": null,
                            "filename": null,
                            "height": null,
                            "mutually_exclusive": false,
                            "options_as_csv": null,
                            "required": null,
                            "signatory_role": null,
                            "signatory_uuid": "signer_1",
                            "tag_id": null,
                            "type": null,
                            "uuid": "a96629ca-fbd0-4886-abb7-16d73e86f497",
                            "width": null,
                            "x": null,
                            "y": null
                        }
                    ],
                    "document_name": "my syntax employee form", //pre-defined document_name we setup in the initial api request body
                    "key": "ahFzfnRoZW1hc3NpdmUtbGl2ZXI2CxIIRG9jdW1lbnQiKHlnYmNLVUFJOVpYV2loMTgyMWM0YmI2YWRfMXE2VzRyMHpsdXlIa3EMogEHc2FuZGJveA", //unique identifier for the child document, can be used as a parameter within other API requests
                    "serve_pdf_url": "https://sandboxapi.quicklysign.com/v1/document_packs/ahFzfnRoZW1hc3NpdmUtbGl2ZXI2CxIIRG9jdW1lbnQiKHlnYmNLVUFJOVpYV2loMTgyMWM0YmI2YWRfMXE2VzRyMHpsdXlIa3EMogEHc2FuZGJveA/serve_pdf?access_token=pTD3UKSDCxOu0h03l00r9NSlzorAUqIOwUaFRcicK9V", //this URL can be used to download a completed version of this child_document
                    "temp_upload_url_10_min": "https://sandboxapi.quicklysign.com/_ah/upload/AMmfu6Yq9ESVmLgxwBW41DUpJy9m-1mPlD98GI039rO3dEm9WL0umPkB4Rx6CaAhuGnC5l0U1tPoVEff_5IQ1yGMWiM2vXVzsAGeP_eKJWfCA6rD5-RD4KyjvZM3hU0ym03lSzggkW_Vkw-Kmad4Kr9C34BJf8SBTyn1sshAh_iLpVWXNIi_wbuOBgXSLa3LBt16gp9BJcSVlXpjfl8TZYe0IJQnvtw4VrN-yveqUIoq7fMc3PheFlYoftQ_hPx7PIib1d7rIEimC7ETgVlwzu_EI_r37p5sb0Rv5iOdsjKx55xxTQbL3uPpizfQR_TM3N6eZ9-WWorQl-xhBc_KS1ooG7zhgOvIqvWgC4shZSUssTgweIxBN17UozKcNGPvy4T5HCP9i0sHwUSDi13P-8acJJIeqeyFKNkm3v_9LDkSkC9pCmVMY8BVZXNHMED9Al5P-OmhMJ2BMH5-IpN2xCSnsRAero1YQb1nP4MS8YdS5AJiiU_qp_ygvH2LlWdjo3fXlzsbU7O6DdS-PrO1ljyccCDjAyAbsezOsfoXyUVgjsgv8o-mGjM/ALBNUaYAAAAAYtgmHogF0q-Rxh9HLOGBsUuyDUsjFFxO/"
                },
                {
                    "custom_data": null,
                    "data_fields": [
                        {
                            "auto_assign_date": null,
                            "auto_fill": null,
                            "background_colour": null,
                            "blob": null,
                            "checkbox_group_id": null,
                            "continue_if_signer_question": null,
                            "custom_id": "company_name",
                            "data": "Joe",
                            "data_field_presentation": null,
                            "date_updated": null,
                            "description": null,
                            "field_enabled_condition": null,
                            "field_group_id": null,
                            "filename": null,
                            "height": null,
                            "mutually_exclusive": false,
                            "options_as_csv": null,
                            "required": null,
                            "signatory_role": null,
                            "signatory_uuid": "signer_2",
                            "tag_id": null,
                            "type": null,
                            "uuid": "829d8876-0351-49a0-964d-7f767608f733",
                            "width": null,
                            "x": null,
                            "y": null
                        },
                        {
                            "auto_assign_date": null,
                            "auto_fill": null,
                            "background_colour": null,
                            "blob": null,
                            "checkbox_group_id": null,
                            "continue_if_signer_question": null,
                            "custom_id": "registration_number",
                            "data": "Soap",
                            "data_field_presentation": null,
                            "date_updated": null,
                            "description": null,
                            "field_enabled_condition": null,
                            "field_group_id": null,
                            "filename": null,
                            "height": null,
                            "mutually_exclusive": false,
                            "options_as_csv": null,
                            "required": null,
                            "signatory_role": null,
                            "signatory_uuid": "signer_2",
                            "tag_id": null,
                            "type": null,
                            "uuid": "bb7feda2-d4bc-4d3c-b869-00ab5628de71",
                            "width": null,
                            "x": null,
                            "y": null
                        },
                        {
                            "auto_assign_date": null,
                            "auto_fill": null,
                            "background_colour": null,
                            "blob": null,
                            "checkbox_group_id": null,
                            "continue_if_signer_question": null,
                            "custom_id": "employer_signature",
                            "data": "QuicklySign",
                            "data_field_presentation": null,
                            "date_updated": null,
                            "description": null,
                            "field_enabled_condition": null,
                            "field_group_id": null,
                            "filename": null,
                            "height": null,
                            "mutually_exclusive": false,
                            "options_as_csv": null,
                            "required": null,
                            "signatory_role": null,
                            "signatory_uuid": "signer_2",
                            "tag_id": null,
                            "type": null,
                            "uuid": "c3feabe6-dc97-4a0c-af0d-2bf5b2c18a9c",
                            "width": null,
                            "x": null,
                            "y": null
                        }
                    ],
                    "document_name": "my syntax employee form",
                    "key": "ahFzfnRoZW1hc3NpdmUtbGl2ZXI2CxIIRG9jdW1lbnQiKHlnYmNLVUFJOVpYV2loMTgyMWM0YmI2YWRfVTBNSjdOanpZSGpNcEoMogEHc2FuZGJveA",
                    "serve_pdf_url": "https://sandboxapi.quicklysign.com/v1/document_packs/ahFzfnRoZW1hc3NpdmUtbGl2ZXI2CxIIRG9jdW1lbnQiKHlnYmNLVUFJOVpYV2loMTgyMWM0YmI2YWRfVTBNSjdOanpZSGpNcEoMogEHc2FuZGJveA/serve_pdf?access_token=pTD3UKSDCxOu0h03l00r9NSlzorAUqIOwUaFRcicK9V",
                    "temp_upload_url_10_min": "https://sandboxapi.quicklysign.com/_ah/upload/AMmfu6YQul9ITInzU81aKu1BpLwmvB_hrtCJHT-h-Q-MvqyHbeW3aCPN2HEUZLURF88gQ9Jxu0OVTQ_XGQ8M81GWIp_CWn7-ObeXJ7gz_t5onHo8Mhpp-sI2aBUSjPtB9TCzZvxzw0RAx_b96EbtFkfi_QSVnkIj57oduXlHnuRBnaJ1jLeh6awlQxcbg2FD_JEL5EM03SGONZtnJLQZb0MqBTpy00rqiMJaowybP5uZx-JtlRskIjdfQvHjRcPavRzoi8_CeTzsnx-ZaNtpwDxd1-c51kiN1gT_Ds6YEYoS8wVX9sySWHKXtG8PoNuaoomK5ek_feDCdsU0oNQVvNy6DDllaGPDyEs1GvFXuSLIqD0aE6TBrWg9jFLuS0DXXifwbTCxzi4d_F_Qbc6vhp-jZ3Zt5czRmRd4CDFQNSlKmlb3ISPV0nZhItAoP0eER2gVHbOdVWeHQ0COUEJy-RHM6EpEBvhamyndUgdUyqpuvvZo8ruvptRG_0c-85fTxz1eRZCsc3Ahl2jjSW8tWhjY3RcqQQd_IZsydyzQcjVohmz3cRZFC0o/ALBNUaYAAAAAYtgmHpy1-I-GJj9AXt6kjPBcxCu6nTF_/"
                }
            ],
            "event_hooks": [], //no event hooks were created with the request
            "external_id": "",
            "field_enabled_conditions": [],
            "key": "ahFzfnRoZW1hc3NpdmUtbGl2ZXInCxIIRG9jdW1lbnQiGXlnYmNLVUFJOVpYV2loMTgyMWM0YmI2YWQMogEHc2FuZGJveA",
            "mail_settings": { //defined mail settings model we created in the request
                "exclude_created_by_from_final_mail": false,
                "include_attachments_in_final_mail": false,
                "message": "Custom email body message",
                "subject": "My First Document Pack"
            },
            "organisation_key": null,
            "signatories": [ //defined signatories model we created in the request
                {
                    "can_receive_signing_notifications": true,
                    "can_receive_viewing_notifications": true,
                    "date_updated": 1658332101143.7932128906,
                    "email": "[email protected]",
                    "email_is_optional": false,
                    "email_send_count": 0,
                    "mobile_number": "0845533264",
                    "name": "Mr First Signer",
                    "primary_communication_channel": "email",
                    "role": "signer_1",
                    "sms_send_count": 0,
                    "status": "setup",
                    "user_key": null,
                    "uuid": "signer_1"
                },
                {
                    "can_receive_signing_notifications": true,
                    "can_receive_viewing_notifications": true,
                    "date_updated": 1658332101143.8999023438,
                    "email": "[email protected]",
                    "email_is_optional": false,
                    "email_send_count": 0,
                    "mobile_number": "0845533264",
                    "name": "Mr Second Signer",
                    "primary_communication_channel": "whatsapp",
                    "role": "signer_2",
                    "sms_send_count": 0,
                    "status": "setup",
                    "user_key": null,
                    "uuid": "signer_2"
                }
            ],
            "signatory_allocation_questions": [],
            "signing_settings": { //defined signing_settings model we created in the request
                "attachments_visible_to_all_signers": true,
                "branding_key": null,
                "can_use_drawn_signature": true,
                "can_use_one_click_initial": true,
                "can_use_one_click_signature": true,
                "can_use_typed_signature": true,
                "can_use_uploaded_signature": true,
                "communication_channel_configurable": false,
                "document_can_be_used_as_form": false,
                "email_is_optional_for_signing": false,
                "first_signer_has_multi_edit_role": false,
                "in_app_signing_page_url": null,
                "obfuscate_contact_info": false,
                "post_signing_url": "",
                "sequential_signing": true,
                "use_signing_wizard": true,
                "use_two_factor_authentication": false
            },
            "status": "setup", //although the status is reflecting as setup yet we auto_requested_signatures, this will be updated shortly once processed by the system
            "team_key": "ahFzfnRoZW1hc3NpdmUtbGl2ZXImCxIEVXNlchiAgKDSi-r-CwwLEgdBY2NvdW50IghQZXJzb25hbAyiAQdzYW5kYm94", //this points to your current workspace you chose to create this document_pack in, becuase we did not specify in the request it will default to your personal workspace
            "user_defined_attributes": [],
            "visible_to_organisation": false
        }
    },
    "status": {
        "status_code": 200
    }
}

The above process will achieve the below:

Document setup ("documents"):

  • Create a document_pack with the name My Document Pack Example containing two child documents.
  • Pre-populate the value of two fields in first employee document, no value has to be specified if you require the
    user to fill in each field.
  • Assign all fields in the employee document to signer-1. Extract the syntax from the document by using
    "extract_fields_by_tag":true.
  • Pre-populate the value of one field in second employer document, no value has to be specified if you require the
    user to fill in each field.
  • Assign all fields in the employer document to signer-2. Extract the form fields from the document by using
    "extract_fields_from_form_fields_with_metadata": true and "apply_extracted_fields": true

Email setup ("mail_settings"):

  • Define our email subject and message body.
  • Exclude the completed document to appear as an attachment when the document is received by each signer and
    cc_recipient/s when the document has been completed.
  • Excluding the user who created this document from receiving the final copy one it's been completed.

Signer setup ("signatories"):

  • Set up two signers, with their respective emails, mobile numbers, primary communication channel, name and role.

Signing process setup ("signing_settings"):

  • Customize the signing settings to allow all signers to view attachments.
  • Have default QuicklySign branding.
  • Allow all methods of signing to be available.
  • Have the user be directed to our default post signing URL once completing signing.
  • Have our signing wizard direct the user to each field that he/she is required to fill in.
  • Have the signature request be sent out in a sequential manner (signer-2 will only receive their request once signer-
    1 has completed signing).
  • Disable two factor authentication so that no OTP is required in order to sign the document.