Create a contract
Learn how to create a contract and start hiring independent contractors
Creating a contract is the first step to hiring an independent contractor through Deel.
This guide explains the endpoints involved in the process and the high-level data structure, and will prepare you to create the various contract types available.
Before you begin
There's a few pieces of information that will be needed as you progress through this guide. Retrieving them beforehand will help you save when you need to prepare the payload.
Before preparing the payload, make sure to retrieve:
- A valid token to authenticate your requests
- The legal entity ID from the Get list of legal entities endpoint
- The group ID from the Get team list
Other endpoints will be used to retrieve additional information needed to create a contract
We recommend becoming familiar with them:
Request payload structure
All the contracts are created using the Create contract endpoint. The difference between them is in the parameters that you will pass in the request payload.
The request payload will include the contract details in the data
object. We'll look at each object of the payload in the following sections of the article, and look at a full sample request towards the end.
curl --request POST \
--url 'https://api.letsdeel.com/rest/v2/contracts' \
--header 'authorization: Bearer TOKEN' \
--header 'content-type: application/json' \
--data-raw '
{
"data": {
…
}
}'
Creating a contract with a custom PDF
You can also create a contract with a custom PDF. To do so, you must use
form-data
for the request body and attach the file. For example:curl --request POST \ --url 'https://api.letsdeel.com/rest/v2/contracts' \ --header 'authorization: Bearer TOKEN' \ --header 'content-type: multipart/form-data' \ --form 'param1="value1"' \ --form 'param2="value2"' \ --form 'parent_param[child_param]="value3"' \ --form 'custom_contract_file=@"{path_to_pdf_file}"'
Where
{path_to_pdf_file}
is the path to the PDF file on your local machine.
Updated 6 months ago
Now that you know how to structure your requests to create a contract, let's look at the various contract type available: