GuidesAPI ReferenceChangelog
Guides

Sign a contract

Learn how to sign a contract when hiring a contractor.

After creating the contract in the system, both the employer and the contractor are required to sign the contract agreement. There are 2 ways to sign a contract:

Before you begin

To sign a contract, make sure to have:

Sign using the default contract template

When signing a contract, the default contract template is used automatically when a custom contract template is not specified.

This section explains how to sign a contract using the default contract template.

Step 1. (Optional) Preview contract agreement

The contract agreement can be retrieved as HTML using the API and displayed in any tool that supports HTML.

To preview the contract agreement, make a GET request to the Preview a contract agreement endpoint.

curl --request GET \
     --url 'https://api.letsdeel.com/rest/v2/contracts/CONTRACT_ID/preview' \
     --header 'authorization: Bearer TOKEN' \
     --header 'accept: text/html' \

In the path:

NameRequiredTypeFormatDescriptionExample
CONTRACT_IDtruestringUUIDThe ID of the agreement being previewed.d3m0d3m0

A successful response (200) will return the contract agreement in HTML format.

<!DOCTYPE html>
<html>
CONTRACT_CONTENT
</html>

In the body, CONTRACT_CONTENT is the contract agreement in HTML format.

Step 2. Sign the contract

Once the contract has been previewed, parties are sign it. By default, the client is required to sign the contract first, so that they can invite the contractor to sign it afterwards.

To sign the contract, make a POST request to the Sign contract endpoint.

curl --request POST \
     --url 'https://api.letsdeel.com/rest/v2/contracts/CONTRACT_ID/signatures' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer TOKEN' \
     --header 'content-type: application/json' \
     --data '
{
  "data": {
    "client_signature": "Michael Scott"
      }
}
'

In the path:

NameRequiredTypeFormatDescriptionExample
CONTRACT_IDtruestringUUIDThe ID of the agreement being signedd3m0d3m0

In the body:

NameRequiredTypeFormatDescriptionExample
client_signaturetruestringFull nameThe name of the person signing the contractMichael Scott

A successful response (200) will return a confirmation message that the contract has been created.

{
  "data": {
    "created": true
  }
}

Sign using a custom contract template

It's also possible to sign a contract using a custom contract template, as long as it was already created from the UI.

Using a custom contract template requires a contract template ID. After that, you can use the contract template ID to preview the contract agreement and to sign the contract.

📘

Only showing additional parameters

This section expands on the default process for signing a contract, only additional calls and parameters are explained. Use these calls and parameters to complement the ones explained for the default process.

Step 1. Retrieve the contract template ID

To retrieve the contract template ID, make a GET request to the Get contract templates endpoint.

curl --request GET \
     --url https://api.letsdeel.com/rest/v2/contract-templates \
     --header 'accept: application/json' \
     --header 'authorization: Bearer TOKEN'

A successful response (200) will return the list of the available contract templates. The title field can help identifying the template. Make sure to note the id of the contract template, as it will be used in the next steps to preview and sign the contract.

{
  "data": [
    {
      "id": "d3m0d3m0-d3m0-d3m0-d3m0-d3m0d3m0d3m0",
      "title": "My demo contract template"
    },
    {
      "id": "d3m0d3m0-d3m0-d3m0-d3m0-d3m0d3m0d3m0",
      "title": "My other demo contract template"
    }
  ]
}

Step 2. Preview the contract agreement using a custom contract template

When previewing the contract agreement, a custom contract template can be used instead of the default one.

To preview the contract using a custom contract template, include its ID in the request body when making a GET request to the Preview contract agreement endpoint.

curl --request GET \
     --url 'https://api.letsdeel.com/rest/v2/contracts/CONTRACT_ID/preview?templateId=TEMPLATE_ID' \
     --header 'accept: text/html' \
     --header 'authorization: Bearer TOKEN'

In the query:

NameRequiredTypeFormatDescriptionExample
templateIdfalsestringUUIDThe ID of the contract template to use for the previewd3m0d3m0-d3m0-d3m0-d3m0-d3m0d3m0d3m0

Step 3. Sign the contract using a custom contract template

Using a custom contract template requires that the contract template ID is also used when signing the contract. Include it in the request body when making a POST request to the Sign contract endpoint.

curl --request POST \
     --url https://api.letsdeel.com/rest/v2/contracts/CONTRACT_ID/signatures \
     --header 'accept: application/json' \
     --header 'authorization: Bearer TOKEN' \
     --header 'content-type: application/json' \
     --data '
{
  "data": {
    "client_signature": "Michael Scott",
    "contract_template_id": "d3m0d3m0-d3m0-d3m0-d3m0-d3m0d3m0d3m0"
  }
}
'

In the body:

NameRequiredTypeFormatDescriptionExample
data.contract_template_idfalsestringUUIDThe ID of the contract template being used to sign the contract. When the contract_template_id is not specified, contracts are created with Deel's default contract template.d3m0d3m0-d3m0-d3m0-d3m0-d3m0d3m0d3m0

What’s Next

Now that the contract has been signed, it's time to invite the contractor to sign it.