curl --request POST \
--url https://api.heffl.com/api/v2/deals \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"clientId": "<string>",
"pipelineId": "<string>",
"stageId": "<string>",
"leadId": "<string>",
"sourceId": "<string>",
"ownerUserId": "<string>",
"price": 123,
"expectedCloseDate": "2023-11-07T05:31:56Z",
"currency": "<string>",
"isInclusiveTax": true,
"assignees": [
"<string>"
],
"contacts": [
"<string>"
],
"tags": [
"<string>"
],
"products": [
{
"name": "<string>",
"quantity": 1,
"price": 1,
"productId": "<string>",
"description": "<string>",
"tax": 1,
"taxRateId": "<string>",
"discount": 1
}
]
}
'import requests
url = "https://api.heffl.com/api/v2/deals"
payload = {
"title": "<string>",
"clientId": "<string>",
"pipelineId": "<string>",
"stageId": "<string>",
"leadId": "<string>",
"sourceId": "<string>",
"ownerUserId": "<string>",
"price": 123,
"expectedCloseDate": "2023-11-07T05:31:56Z",
"currency": "<string>",
"isInclusiveTax": True,
"assignees": ["<string>"],
"contacts": ["<string>"],
"tags": ["<string>"],
"products": [
{
"name": "<string>",
"quantity": 1,
"price": 1,
"productId": "<string>",
"description": "<string>",
"tax": 1,
"taxRateId": "<string>",
"discount": 1
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
clientId: '<string>',
pipelineId: '<string>',
stageId: '<string>',
leadId: '<string>',
sourceId: '<string>',
ownerUserId: '<string>',
price: 123,
expectedCloseDate: '2023-11-07T05:31:56Z',
currency: '<string>',
isInclusiveTax: true,
assignees: ['<string>'],
contacts: ['<string>'],
tags: ['<string>'],
products: [
{
name: '<string>',
quantity: 1,
price: 1,
productId: '<string>',
description: '<string>',
tax: 1,
taxRateId: '<string>',
discount: 1
}
]
})
};
fetch('https://api.heffl.com/api/v2/deals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.heffl.com/api/v2/deals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'clientId' => '<string>',
'pipelineId' => '<string>',
'stageId' => '<string>',
'leadId' => '<string>',
'sourceId' => '<string>',
'ownerUserId' => '<string>',
'price' => 123,
'expectedCloseDate' => '2023-11-07T05:31:56Z',
'currency' => '<string>',
'isInclusiveTax' => true,
'assignees' => [
'<string>'
],
'contacts' => [
'<string>'
],
'tags' => [
'<string>'
],
'products' => [
[
'name' => '<string>',
'quantity' => 1,
'price' => 1,
'productId' => '<string>',
'description' => '<string>',
'tax' => 1,
'taxRateId' => '<string>',
'discount' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heffl.com/api/v2/deals"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"clientId\": \"<string>\",\n \"pipelineId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"price\": 123,\n \"expectedCloseDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"isInclusiveTax\": true,\n \"assignees\": [\n \"<string>\"\n ],\n \"contacts\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"products\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 1,\n \"price\": 1,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 1,\n \"taxRateId\": \"<string>\",\n \"discount\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.heffl.com/api/v2/deals")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"clientId\": \"<string>\",\n \"pipelineId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"price\": 123,\n \"expectedCloseDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"isInclusiveTax\": true,\n \"assignees\": [\n \"<string>\"\n ],\n \"contacts\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"products\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 1,\n \"price\": 1,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 1,\n \"taxRateId\": \"<string>\",\n \"discount\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/deals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"clientId\": \"<string>\",\n \"pipelineId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"price\": 123,\n \"expectedCloseDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"isInclusiveTax\": true,\n \"assignees\": [\n \"<string>\"\n ],\n \"contacts\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"products\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 1,\n \"price\": 1,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 1,\n \"taxRateId\": \"<string>\",\n \"discount\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"title": "<string>",
"contactEmails": [
"<string>"
],
"clientId": "<string>",
"client": {},
"price": 123,
"expectedCloseDate": "2023-11-07T05:31:56Z",
"pipelineId": "<string>",
"stageId": "<string>",
"stage": "<string>",
"leadId": "<string>",
"leadName": "<string>",
"crmSourceId": "<string>",
"source": "<string>",
"ownerUserId": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create deal
Creates a new deal in your CRM pipeline. Related entity IDs use prefixed string IDs (for example clt_, dpl_, dps_). Custom field values use cf_* keys — see the Custom fields guide.
curl --request POST \
--url https://api.heffl.com/api/v2/deals \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"clientId": "<string>",
"pipelineId": "<string>",
"stageId": "<string>",
"leadId": "<string>",
"sourceId": "<string>",
"ownerUserId": "<string>",
"price": 123,
"expectedCloseDate": "2023-11-07T05:31:56Z",
"currency": "<string>",
"isInclusiveTax": true,
"assignees": [
"<string>"
],
"contacts": [
"<string>"
],
"tags": [
"<string>"
],
"products": [
{
"name": "<string>",
"quantity": 1,
"price": 1,
"productId": "<string>",
"description": "<string>",
"tax": 1,
"taxRateId": "<string>",
"discount": 1
}
]
}
'import requests
url = "https://api.heffl.com/api/v2/deals"
payload = {
"title": "<string>",
"clientId": "<string>",
"pipelineId": "<string>",
"stageId": "<string>",
"leadId": "<string>",
"sourceId": "<string>",
"ownerUserId": "<string>",
"price": 123,
"expectedCloseDate": "2023-11-07T05:31:56Z",
"currency": "<string>",
"isInclusiveTax": True,
"assignees": ["<string>"],
"contacts": ["<string>"],
"tags": ["<string>"],
"products": [
{
"name": "<string>",
"quantity": 1,
"price": 1,
"productId": "<string>",
"description": "<string>",
"tax": 1,
"taxRateId": "<string>",
"discount": 1
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
clientId: '<string>',
pipelineId: '<string>',
stageId: '<string>',
leadId: '<string>',
sourceId: '<string>',
ownerUserId: '<string>',
price: 123,
expectedCloseDate: '2023-11-07T05:31:56Z',
currency: '<string>',
isInclusiveTax: true,
assignees: ['<string>'],
contacts: ['<string>'],
tags: ['<string>'],
products: [
{
name: '<string>',
quantity: 1,
price: 1,
productId: '<string>',
description: '<string>',
tax: 1,
taxRateId: '<string>',
discount: 1
}
]
})
};
fetch('https://api.heffl.com/api/v2/deals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.heffl.com/api/v2/deals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'clientId' => '<string>',
'pipelineId' => '<string>',
'stageId' => '<string>',
'leadId' => '<string>',
'sourceId' => '<string>',
'ownerUserId' => '<string>',
'price' => 123,
'expectedCloseDate' => '2023-11-07T05:31:56Z',
'currency' => '<string>',
'isInclusiveTax' => true,
'assignees' => [
'<string>'
],
'contacts' => [
'<string>'
],
'tags' => [
'<string>'
],
'products' => [
[
'name' => '<string>',
'quantity' => 1,
'price' => 1,
'productId' => '<string>',
'description' => '<string>',
'tax' => 1,
'taxRateId' => '<string>',
'discount' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heffl.com/api/v2/deals"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"clientId\": \"<string>\",\n \"pipelineId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"price\": 123,\n \"expectedCloseDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"isInclusiveTax\": true,\n \"assignees\": [\n \"<string>\"\n ],\n \"contacts\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"products\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 1,\n \"price\": 1,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 1,\n \"taxRateId\": \"<string>\",\n \"discount\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.heffl.com/api/v2/deals")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"clientId\": \"<string>\",\n \"pipelineId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"price\": 123,\n \"expectedCloseDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"isInclusiveTax\": true,\n \"assignees\": [\n \"<string>\"\n ],\n \"contacts\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"products\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 1,\n \"price\": 1,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 1,\n \"taxRateId\": \"<string>\",\n \"discount\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/deals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"clientId\": \"<string>\",\n \"pipelineId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"price\": 123,\n \"expectedCloseDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"isInclusiveTax\": true,\n \"assignees\": [\n \"<string>\"\n ],\n \"contacts\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"products\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 1,\n \"price\": 1,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 1,\n \"taxRateId\": \"<string>\",\n \"discount\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"title": "<string>",
"contactEmails": [
"<string>"
],
"clientId": "<string>",
"client": {},
"price": 123,
"expectedCloseDate": "2023-11-07T05:31:56Z",
"pipelineId": "<string>",
"stageId": "<string>",
"stage": "<string>",
"leadId": "<string>",
"leadName": "<string>",
"crmSourceId": "<string>",
"source": "<string>",
"ownerUserId": "<string>",
"ownerId": "<string>",
"ownerName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
API key for authentication. Get yours at app.heffl.com/settings/developers
Body
Deal title
Contact or company ID (clt_ prefix)
Pipeline ID
Pipeline stage ID
Lead ID
CRM source ID
Owner user ID
Deal value
Expected close date
Deal priority
LOW, MEDIUM, HIGH Deal status
ACTIVE, WON, LOST 3-letter ISO currency code
Whether prices include tax
Assignee user IDs
Contact IDs linked to the deal
Tag IDs
Deal line items
Show child attributes
Show child attributes
Custom field values using cf_* keys. Only documented fields and cf_* keys are accepted.
Response
OK
Deal ID
Auto-generated deal number
Deal title
Emails of linked contacts
Contact or company ID (clt_ prefix)
Linked client record
Deal value
Expected close date
Deal status
ACTIVE, WON, LOST Deal priority
LOW, MEDIUM, HIGH Pipeline ID (dpl_ prefix)
Pipeline stage ID (dps_ prefix)
Pipeline stage name
Lead ID
Lead name
CRM source ID (src_ prefix)
CRM source name
Owner user ID (usr_ prefix)
Owner user ID (usr_ prefix)
Owner name
When the deal was created
When the deal was last updated
Custom field values as top-level cf_* keys (for example cf_priority). There is no customFields wrapper.