How to add a company with a signatory

What is a company and a signatory?

Company - A Company which is a party of a contract will have signatories who sign on its behalf (e.g. A company Director).

Signatory - a user who is authorised to sign on the party's behalf. For example a Director signing on behalf of a company or a letting agent signing on behalf of a landlord.

📘

Companies and Signatories

More info can be found here

Steps to create a Recruitment Terms of Business Agreement

  • Create a team that will create the contract
  • Retrieve the contract fields of the contract template
  • Create a contract and provide values for the contract fields
  • Add party members or collaborators
  • Sign the contract

Creating a team

Contracts are created in teams. A User can create a new Team or select an existing. In this guide we will create a "New Team for guide" with the create team

curl --request POST \
     --url https://sandbox.legislate.tech/v1/users/{{UserID}}/teams \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer APIKEY' \
     --header 'Content-Type: application/json' \
     --data '
{
     "name": "New team for guide"

A successful 201 response should return the team ID, an error could mean the name of the team has not been given, or the user ID is incorrect.

{
  "id": {{TeamID}},
  "name": "New team for Guide",
  "created": "2022-06-16 15:16:27.980+0000",
  "_links": {
    "self": {
      "href": "https://sandbox.legislate.tech/v1/teams/{{TeamID}}"
    }
  }
}

Get contract fields

The contract that we use for this does not matter, so we can use any contract. We can look at the list of public contracts we can create using the Get contract type terms of a team (https://developers.legislate.tech/reference/getcontracttypesperteamusingget) which uses the team ID. A successful 204 response should look something like this:

"id": 6690589634461711,
    "name": "Section 8 Notice",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/teams/6753931778590809/contract-types/6690589634461711"
      },
      {
        "rel": "templates",
        "href": "https://sandbox.legislate.tech/v1/teams/6753931778590809/contract-types/6690589634461711/templates"
      }
    ],
    "about_url": "www.legislate.tech"
  },
  {
    "id": 6690589634461712,
    "name": "Section 21 Notice",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/teams/6753931778590809/contract-types/6690589634461712"
      },
      {
        "rel": "templates",
        "href": "https://sandbox.legislate.tech/v1/teams/6753931778590809/contract-types/6690589634461712/templates"
      }
    ],
    "about_url": "www.legislate.tech"
  },

Again, as it doesn't matter which contract we use, we can use the NDA contract type. We can use the ID shown to find the Contract template using the Get contract templates endpoint (https://developers.legislate.tech/reference/gettemplatesusingget):

[
  {
    "id": 116,
    "version": "Last updated 13/12/2021",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/teams/TeamID/contract-types/5938261218295808/templates/116"
      },
      {
        "rel": "type",
        "href": "https://sandbox.legislate.tech/v1/teams/TeamID/contract-types/5938261218295808"
      },
      {
        "rel": "terms",
        "href": "https://sandbox.legislate.tech/v1/templates/116/terms"
      }
    ]
  }
]

This id is the contract template ID. This can be used to get the contract fields, using the Get contract fields endpoint (https://developers.legislate.tech/reference/gettemplatetermsusingget). This endpoint uses the template ID as a parameter and a successful 200 response will look like:

[
  {
    "id": 3009,
    "label": "Name",
    "name": "contract_name",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/3009"
      }
    ]
  },
  {
    "id": 3010,
    "label": "Please specify the purpose of the Agreement",
    "name": "contract_purpose",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/3010"
      }
    ]
  },
  {
    "id": 3011,
    "label": "Coverage",
    "name": "contract_coverage",
    "options": [
      {
        "value": "mutual"
      },
      {
        "value": "one way"
      }
    ],
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/3011"
      }
    ]
  },
  {
    "id": 3012,
    "label": "Please specify the Confidentiality Term",
    "name": "contract_confidentialityTerm",
    "options": [
      {
        "value": "2"
      },
      {
        "value": "3"
      },
      {
        "value": "4"
      },
      {
        "value": "5"
      },
      {
        "value": "6"
      },
      {
        "value": "7"
      },
      {
        "value": "8"
      },
      {
        "value": "9"
      },
      {
        "value": "10"
      }
    ],
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/3012"
      }
    ]
  },
  {
    "id": 3013,
    "label": "Effective Date",
    "name": "contract_startDate",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/3013"
      }
    ]
  },
  {
    "id": 3014,
    "label": "Would the contract creator like to upload their logo to the agreement?",
    "name": "contract_logo",
    "options": [
      {
        "value": "logoYes",
        "nested_fields": [
          {
            "id": 3015,
            "label": "Please upload the logo",
            "name": "contract_logoDetails",
            "links": [
              {
                "rel": "self",
                "href": "https://sandbox.legislate.tech/v1/terms/3015"
              }
            ]
          }
        ]
      },
      {
        "value": "logoNo"
      }
    ],
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/3014"
      }

Finding the contract ID

We can find the contract ID by using the Create a contract with an auto-generated bundle endpoint (https://developers.legislate.tech/reference/postcontractusingpost_1-1) using the user ID, team ID and template ID as parameters, as well as filling in all the fields using the response from the Get contract fields endpoint.

curl --request POST \
     --url https://sandbox.legislate.tech/v1/teams/TeamID/contracts \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer API Key' \
     --header 'Content-Type: application/json' \
     --data '
{
     "fields": [
          {
               "id": 3009,
               "name": "Name",
               "value": "New contract for guide"
          }
     ],
     "template_id": 116,
     "created_by_user_id": "UserID"
}

Create Company

We can now use the ContractID, as well as information about the company to create a company with an auto-generated bundle using this endpoint (https://developers.legislate.tech/reference/postcompanyusingpost):

curl --request POST \
     --url https://sandbox.legislate.tech/v1/contracts/ContractID/company \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklZMUlVNU5pNXRkYnFpNGJwa3czYyJ9.eyJodHRwczovL2FwcC5sZWdpc2xhdGUudGVjaC91c2VyX2lkIjoiNjc0OTU0MTg1MjI1MjEwMCIsImlzcyI6Imh0dHBzOi8vbGVnaXNsYXRlLXNhbmRib3guZXUuYXV0aDAuY29tLyIsInN1YiI6Ik0wOERWYXBHTHpDV2lJU01RdWZKSVI4cGFSbXQ4dVVXQGNsaWVudHMiLCJhdWQiOiJodHRwczovL3NhbmRib3gubGVnaXNsYXRlLnRlY2giLCJpYXQiOjE2NTcyODYwODIsImV4cCI6MTY1OTcwNjA4MiwiYXpwIjoiTTA4RFZhcEdMekNXaUlTTVF1ZkpJUjhwYVJtdDh1VVciLCJzY29wZSI6InJlYWQ6Y29udHJhY3RzIGdldDpjb250cmFjdHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.FEuZ6xu2orIiEfi-c3z8egKiJUS8HLu8qL8dLhTZYASVmhY_J88YS4ragjMkV8q1YJ2pv34jst6qFJstoaiaqjgu_E4NyFTm2rD0WFExsYeNha4VSJ6foE276vM9yz_WR_3qs7lzpgek25vX6vZg5984Yx6FIH7sMaTH1c1NpCFZEhjD0twyMq_5EGw_fRkuqnzw1UEmLmEEIzPtF5DAbRTtWEFICzdprsqzJSMaWOROLPgZpOSiVDO077MmvDsW_hOLbzwwT8I89CrJGhBT1UKJmU7G-hIi2aoOJyF-8bIW12Gpad4OlRmpcl1F2K3YCC_vJZepMncmlKtyYI4ETg' \
     --header 'Content-Type: application/json' \
     --data '
{
     "company_name": "CompanyName",
     "company_number": "CompanyNumber",
     "role": "signatory",
     "side": "first"
}
'

⚠️

Signatory

As we want a signatory, we want to make sure that the role is set to signatory