Using the signing API

How to use the api to create a custom signing experience

Signing Process

sequenceDiagram

autonumber

actor m as Merchant
participant p as Partner
participant l as Liberis

p ->> l: Get contract pack status
l --) p: Pack status
p --) p: Get signatory from status
    loop outstandingContracts
    p ->> l: Get contract for signing
    l --) p: Contract content + required notices
    p ->> m: Display contract and notices
    m --) m: Scroll through contract
    m ->> p: Sign
    p ->> l: Apply signature
    l --) p: Signature successful
end
  • Each advance returns a contractPackId if there are outstanding signatures
  • /contract_packs/{contractPackId} returns the status of all the contracts including
    which signatures are missing
  • The contract and notices can be retrieved in parallel to pre-load all contracts if desired
    • Where the same document requires multiple signatures from the same person, you must
      retrieve the second signature data after the first signature is completed if you want the first signature rendered when the merchants makes the second signature
  • Signature requests for signatories that are not part of the application will fail

Displaying contracts

Each contract for a given signatory can be retrieved by using the url property in the pack status (signatories[x].outstandingContracts[y].url). Alternatively the other properties in the outstanding contract object can be used to construct the get contract signature url. The contract data is always returned in the following structure:

{
  "title": "...",
  "content": "...",
  "acceptanceText": "...",
  "notices": {
    "header": "...",
    "footers": [
      {
        "type": "basic",
        "content": "Some text"
      },
      {
        "type": "alert",
        "title": "Emphasised text",
        "content": "Some important text"
      },
      {
        "type": "basic",
        "title": "Emphasised text",
        "content": "More text"
      }
    ]
  }
}

When presenting the contract:

  • title must be at the top
  • notices.header must be between the title and the contract
  • notices.footers must be displayed in order between the contract and the sign button
    • Notice footer titles should be treated as sub-titles when present
      • Bold formatting is sufficient
    • Notice footers must have some kind of alert formatting when the type is alert
  • The acceptanceText should be displayed with a checkbox between the contract and the sign button
  • The user must be required to scroll through the entire contract and notices before being allowed to sign
  • The user must be required to tick the acceptance text checkbox before being allowed to sign

HTML content

By default the contract content will be returned as raw HTML. For example:

{
  "title": "California Disclosure",
  "content": "<div>Some Contract Content</div>",
  "notices": {
    "header": "Please read through the document below and ensure that the information is correct. You will need to sign electronically by clicking the \"Sign\" button below.",
    "footers": [
      {
        "type": "BASIC",
        "title": "Please note:",
        "content": "By clicking the button below, I confirm that I John Doe am authorised to sign on behalf of ACME Inc."
      }
    ]
  }
}

Encoded PDF content

The get contract url can have a type query parameter set to ENCODED_PDF to change the content to a base64 encoding of the contract. For example:

{
  "title": "Revenue Based Finance Agreement",
  "content": "JVBERi0xLjQKMSAwIG9i...",
  "notices": {
    "header": "Please read through the terms of your Revenue Based Finance Agreement. You will need to sign the Revenue Based Finance Agreement electronically by clicking the \"Sign\" button below.",
    "footers": [
      {
        "type": "BASIC",
        "title": "Please note:",
        "content": "Liberis will perform more checks before signing your agreement. If the checks are successful we'll share a signed copy of the agreement with you, that's when the contract will become valid."
      },
      {
        "type": "BASIC",
        "content": "By clicking the button below, I confirm that I Mrs Jane Doe am authorized to sign the Revenue Based Finance Agreement on behalf of ACME Inc to legally bind it."
      }
    ]
  }
}