Contract Fields

Additional resources on contract fields

What is a contract field?

Contract fields are used to collect information which needs to be inputed in a Contract. A basic contract field such as the Agreement Date presents the following structure:

{
    "id": {{fieldId}},
    "label": "Please specify the Agreement Date",
    "name": "contract_agreementDate",
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/{{fieldId}}"
      }
    ]
  }

📘

Contract Field Labels

The label of a field can be used to collect answers from Users when setting the terms of a contract.

When a contract field is set for a Contract in an existing bundle, the contract field will store the value which has been set in the contract. For example, an agreement date will have the following structure:

{
        "id": {{fieldID}},
        "name": "contract_agreementDate",
        "value": "Tuesday, 15 June 2022"
      }

What are the different types of contract fields?

Contract fields have different structures in order to adapt to the flexibility of contracts. A contract field can be:

  • a field with a simple value e.g. Agreement Date
  • a field with options e.g. What is the confidentiality term? 1 year, 2 years, 3 years
  • a field with options and nested values e.g. Would you like to upload a logo? Yes - Please upload the logo /No

Contract field with options

A contract field with options has the following structure:

{
    "id": {{fieldId}},
    "label": "Please select an option",
    "name": "contract_example",
    "options": [
      {
        "value": "option 1"
      },
      {
        "value": "option 2"
      }
    ],
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/{{fieldId}}"
      }
    ]
  }

Contract field with options and nested values

A contract field with nested values can be used when a contract field has options and that the selection of an option requires additional information. The following example shows how the nested options work.

{
    "id": {{fieldId1}},
    "label": "Would the contract creator like to upload their logo to the agreement?",
    "name": "contract_logo",
    "options": [
      {
        "value": "logoYes",
        "nestedFields": [
          {
            "id": {{fieldId2}},
            "label": "Please upload the logo",
            "name": "contract_logoDetails",
            "links": [
              {
                "rel": "self",
                "href": "https://sandbox.legislate.tech/v1/terms/{{fieldId2}}"
              }
            ]
          }
        ]
      },
      {
        "value": "logoNo"
      }
    ],
    "links": [
      {
        "rel": "self",
        "href": "https://sandbox.legislate.tech/v1/terms/{{fieldId1}}"
      }
    ]
  }