curl --request POST \
--url https://api.heffl.com/api/v1/clients \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "company",
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"salutation": "<string>",
"phone": "<string>",
"email": "[email protected]",
"jobTitle": "<string>",
"website": "<unknown>",
"taxNumber": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"openingBalance": 0
}
'import requests
url = "https://api.heffl.com/api/v1/clients"
payload = {
"type": "company",
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"salutation": "<string>",
"phone": "<string>",
"email": "[email protected]",
"jobTitle": "<string>",
"website": "<unknown>",
"taxNumber": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"openingBalance": 0
}
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({
type: 'company',
name: '<string>',
firstName: '<string>',
lastName: '<string>',
salutation: '<string>',
phone: '<string>',
email: '[email protected]',
jobTitle: '<string>',
website: '<unknown>',
taxNumber: '<string>',
billingAddress: {
city: '<string>',
address: '<string>',
landmark: '<string>',
state: '<string>',
country: '<string>',
postalCode: '<string>'
},
openingBalance: 0
})
};
fetch('https://api.heffl.com/api/v1/clients', 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/v1/clients",
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([
'type' => 'company',
'name' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'salutation' => '<string>',
'phone' => '<string>',
'email' => '[email protected]',
'jobTitle' => '<string>',
'website' => '<unknown>',
'taxNumber' => '<string>',
'billingAddress' => [
'city' => '<string>',
'address' => '<string>',
'landmark' => '<string>',
'state' => '<string>',
'country' => '<string>',
'postalCode' => '<string>'
],
'openingBalance' => 0
]),
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/v1/clients"
payload := strings.NewReader("{\n \"type\": \"company\",\n \"name\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"salutation\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"[email protected]\",\n \"jobTitle\": \"<string>\",\n \"website\": \"<unknown>\",\n \"taxNumber\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"openingBalance\": 0\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/v1/clients")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"company\",\n \"name\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"salutation\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"[email protected]\",\n \"jobTitle\": \"<string>\",\n \"website\": \"<unknown>\",\n \"taxNumber\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"openingBalance\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v1/clients")
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 \"type\": \"company\",\n \"name\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"salutation\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"[email protected]\",\n \"jobTitle\": \"<string>\",\n \"website\": \"<unknown>\",\n \"taxNumber\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"openingBalance\": 0\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"website": "<string>",
"stageId": "<string>",
"customFields": {}
}Create a new client
Creates a new client/company in your CRM. The client will be assigned to the user associated with your API key.
curl --request POST \
--url https://api.heffl.com/api/v1/clients \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "company",
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"salutation": "<string>",
"phone": "<string>",
"email": "[email protected]",
"jobTitle": "<string>",
"website": "<unknown>",
"taxNumber": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"openingBalance": 0
}
'import requests
url = "https://api.heffl.com/api/v1/clients"
payload = {
"type": "company",
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"salutation": "<string>",
"phone": "<string>",
"email": "[email protected]",
"jobTitle": "<string>",
"website": "<unknown>",
"taxNumber": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"openingBalance": 0
}
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({
type: 'company',
name: '<string>',
firstName: '<string>',
lastName: '<string>',
salutation: '<string>',
phone: '<string>',
email: '[email protected]',
jobTitle: '<string>',
website: '<unknown>',
taxNumber: '<string>',
billingAddress: {
city: '<string>',
address: '<string>',
landmark: '<string>',
state: '<string>',
country: '<string>',
postalCode: '<string>'
},
openingBalance: 0
})
};
fetch('https://api.heffl.com/api/v1/clients', 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/v1/clients",
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([
'type' => 'company',
'name' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'salutation' => '<string>',
'phone' => '<string>',
'email' => '[email protected]',
'jobTitle' => '<string>',
'website' => '<unknown>',
'taxNumber' => '<string>',
'billingAddress' => [
'city' => '<string>',
'address' => '<string>',
'landmark' => '<string>',
'state' => '<string>',
'country' => '<string>',
'postalCode' => '<string>'
],
'openingBalance' => 0
]),
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/v1/clients"
payload := strings.NewReader("{\n \"type\": \"company\",\n \"name\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"salutation\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"[email protected]\",\n \"jobTitle\": \"<string>\",\n \"website\": \"<unknown>\",\n \"taxNumber\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"openingBalance\": 0\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/v1/clients")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"company\",\n \"name\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"salutation\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"[email protected]\",\n \"jobTitle\": \"<string>\",\n \"website\": \"<unknown>\",\n \"taxNumber\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"openingBalance\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v1/clients")
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 \"type\": \"company\",\n \"name\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"salutation\": \"<string>\",\n \"phone\": \"<string>\",\n \"email\": \"[email protected]\",\n \"jobTitle\": \"<string>\",\n \"website\": \"<unknown>\",\n \"taxNumber\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"openingBalance\": 0\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"website": "<string>",
"stageId": "<string>",
"customFields": {}
}Authorizations
API key for authentication. Get yours at app.heffl.com/settings/developers
Body
Client type: company for companies, contact for contacts
company, contact Company name (required for companies, optional for contacts)
First name (required for contacts)
Last name (optional for contacts)
Title (Mr., Mrs., Dr., etc.)
Phone number with country code
Email address
Job title or position
Company website URL
Tax ID or VAT number
Billing address details
Show child attributes
Show child attributes
Starting account balance (defaults to 0)
x >= 0Optional primary contact for company records
Show child attributes
Show child attributes
Response
OK
Client public ID
Auto-generated client number
Client name
Client type
company, contact When the client was created
First name (for contacts)
Last name (for contacts)
Email address
Phone number
Website URL
Client stage public ID
Custom field values
Show child attributes
Show child attributes