curl --request POST \
--url https://api.heffl.com/api/v2/quotations \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"clientId": "<string>",
"templateId": "<string>",
"date": "2023-11-07T05:31:56Z",
"quotationProducts": [
{
"name": "<string>",
"quantity": 123,
"price": 123,
"productId": "<string>",
"description": "<string>",
"tax": 123,
"taxRateId": "<string>",
"discount": 123,
"scope": "<string>"
}
],
"contactId": "<string>",
"dealId": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"subject": "<string>",
"title": "<string>",
"isInclusiveTax": true,
"contentHtml": "<string>",
"internalNotes": "<string>",
"salesPersonId": "<string>",
"currency": "<string>",
"conversionRate": 123,
"tags": [
"<string>"
]
}
'import requests
url = "https://api.heffl.com/api/v2/quotations"
payload = {
"clientId": "<string>",
"templateId": "<string>",
"date": "2023-11-07T05:31:56Z",
"quotationProducts": [
{
"name": "<string>",
"quantity": 123,
"price": 123,
"productId": "<string>",
"description": "<string>",
"tax": 123,
"taxRateId": "<string>",
"discount": 123,
"scope": "<string>"
}
],
"contactId": "<string>",
"dealId": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"subject": "<string>",
"title": "<string>",
"isInclusiveTax": True,
"contentHtml": "<string>",
"internalNotes": "<string>",
"salesPersonId": "<string>",
"currency": "<string>",
"conversionRate": 123,
"tags": ["<string>"]
}
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({
clientId: '<string>',
templateId: '<string>',
date: '2023-11-07T05:31:56Z',
quotationProducts: [
{
name: '<string>',
quantity: 123,
price: 123,
productId: '<string>',
description: '<string>',
tax: 123,
taxRateId: '<string>',
discount: 123,
scope: '<string>'
}
],
contactId: '<string>',
dealId: '<string>',
expiryDate: '2023-11-07T05:31:56Z',
subject: '<string>',
title: '<string>',
isInclusiveTax: true,
contentHtml: '<string>',
internalNotes: '<string>',
salesPersonId: '<string>',
currency: '<string>',
conversionRate: 123,
tags: ['<string>']
})
};
fetch('https://api.heffl.com/api/v2/quotations', 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/quotations",
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([
'clientId' => '<string>',
'templateId' => '<string>',
'date' => '2023-11-07T05:31:56Z',
'quotationProducts' => [
[
'name' => '<string>',
'quantity' => 123,
'price' => 123,
'productId' => '<string>',
'description' => '<string>',
'tax' => 123,
'taxRateId' => '<string>',
'discount' => 123,
'scope' => '<string>'
]
],
'contactId' => '<string>',
'dealId' => '<string>',
'expiryDate' => '2023-11-07T05:31:56Z',
'subject' => '<string>',
'title' => '<string>',
'isInclusiveTax' => true,
'contentHtml' => '<string>',
'internalNotes' => '<string>',
'salesPersonId' => '<string>',
'currency' => '<string>',
'conversionRate' => 123,
'tags' => [
'<string>'
]
]),
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/quotations"
payload := strings.NewReader("{\n \"clientId\": \"<string>\",\n \"templateId\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"quotationProducts\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 123,\n \"taxRateId\": \"<string>\",\n \"discount\": 123,\n \"scope\": \"<string>\"\n }\n ],\n \"contactId\": \"<string>\",\n \"dealId\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"subject\": \"<string>\",\n \"title\": \"<string>\",\n \"isInclusiveTax\": true,\n \"contentHtml\": \"<string>\",\n \"internalNotes\": \"<string>\",\n \"salesPersonId\": \"<string>\",\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"tags\": [\n \"<string>\"\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/quotations")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"<string>\",\n \"templateId\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"quotationProducts\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 123,\n \"taxRateId\": \"<string>\",\n \"discount\": 123,\n \"scope\": \"<string>\"\n }\n ],\n \"contactId\": \"<string>\",\n \"dealId\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"subject\": \"<string>\",\n \"title\": \"<string>\",\n \"isInclusiveTax\": true,\n \"contentHtml\": \"<string>\",\n \"internalNotes\": \"<string>\",\n \"salesPersonId\": \"<string>\",\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/quotations")
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 \"clientId\": \"<string>\",\n \"templateId\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"quotationProducts\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 123,\n \"taxRateId\": \"<string>\",\n \"discount\": 123,\n \"scope\": \"<string>\"\n }\n ],\n \"contactId\": \"<string>\",\n \"dealId\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"subject\": \"<string>\",\n \"title\": \"<string>\",\n \"isInclusiveTax\": true,\n \"contentHtml\": \"<string>\",\n \"internalNotes\": \"<string>\",\n \"salesPersonId\": \"<string>\",\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"date": "2023-11-07T05:31:56Z",
"currency": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"subject": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"conversionRate": 123,
"isInclusiveTax": true,
"clientId": "<string>",
"contactId": "<string>",
"dealId": "<string>",
"salesPersonId": "<string>",
"templateId": "<string>",
"contentHtml": "<string>",
"internalNotes": "<string>",
"totalAmount": 123,
"subtotalAmount": 123,
"totalTaxAmount": 123,
"totalDiscountAmount": 123,
"tagIds": [
"<string>"
],
"lineItems": [
{
"name": "<string>",
"quantity": 123,
"price": 123,
"productId": "<string>",
"description": "<string>",
"tax": 123,
"taxRateId": "<string>",
"discount": 123,
"scope": "<string>"
}
],
"markedAcceptedOn": "2023-11-07T05:31:56Z",
"markedRejectedOn": "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 quotation
Creates a new quotation with line items. Requires clientId (clt_) and templateId (tpl_). Custom field values use cf_* keys — see the Custom fields guide.
curl --request POST \
--url https://api.heffl.com/api/v2/quotations \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"clientId": "<string>",
"templateId": "<string>",
"date": "2023-11-07T05:31:56Z",
"quotationProducts": [
{
"name": "<string>",
"quantity": 123,
"price": 123,
"productId": "<string>",
"description": "<string>",
"tax": 123,
"taxRateId": "<string>",
"discount": 123,
"scope": "<string>"
}
],
"contactId": "<string>",
"dealId": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"subject": "<string>",
"title": "<string>",
"isInclusiveTax": true,
"contentHtml": "<string>",
"internalNotes": "<string>",
"salesPersonId": "<string>",
"currency": "<string>",
"conversionRate": 123,
"tags": [
"<string>"
]
}
'import requests
url = "https://api.heffl.com/api/v2/quotations"
payload = {
"clientId": "<string>",
"templateId": "<string>",
"date": "2023-11-07T05:31:56Z",
"quotationProducts": [
{
"name": "<string>",
"quantity": 123,
"price": 123,
"productId": "<string>",
"description": "<string>",
"tax": 123,
"taxRateId": "<string>",
"discount": 123,
"scope": "<string>"
}
],
"contactId": "<string>",
"dealId": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"subject": "<string>",
"title": "<string>",
"isInclusiveTax": True,
"contentHtml": "<string>",
"internalNotes": "<string>",
"salesPersonId": "<string>",
"currency": "<string>",
"conversionRate": 123,
"tags": ["<string>"]
}
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({
clientId: '<string>',
templateId: '<string>',
date: '2023-11-07T05:31:56Z',
quotationProducts: [
{
name: '<string>',
quantity: 123,
price: 123,
productId: '<string>',
description: '<string>',
tax: 123,
taxRateId: '<string>',
discount: 123,
scope: '<string>'
}
],
contactId: '<string>',
dealId: '<string>',
expiryDate: '2023-11-07T05:31:56Z',
subject: '<string>',
title: '<string>',
isInclusiveTax: true,
contentHtml: '<string>',
internalNotes: '<string>',
salesPersonId: '<string>',
currency: '<string>',
conversionRate: 123,
tags: ['<string>']
})
};
fetch('https://api.heffl.com/api/v2/quotations', 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/quotations",
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([
'clientId' => '<string>',
'templateId' => '<string>',
'date' => '2023-11-07T05:31:56Z',
'quotationProducts' => [
[
'name' => '<string>',
'quantity' => 123,
'price' => 123,
'productId' => '<string>',
'description' => '<string>',
'tax' => 123,
'taxRateId' => '<string>',
'discount' => 123,
'scope' => '<string>'
]
],
'contactId' => '<string>',
'dealId' => '<string>',
'expiryDate' => '2023-11-07T05:31:56Z',
'subject' => '<string>',
'title' => '<string>',
'isInclusiveTax' => true,
'contentHtml' => '<string>',
'internalNotes' => '<string>',
'salesPersonId' => '<string>',
'currency' => '<string>',
'conversionRate' => 123,
'tags' => [
'<string>'
]
]),
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/quotations"
payload := strings.NewReader("{\n \"clientId\": \"<string>\",\n \"templateId\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"quotationProducts\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 123,\n \"taxRateId\": \"<string>\",\n \"discount\": 123,\n \"scope\": \"<string>\"\n }\n ],\n \"contactId\": \"<string>\",\n \"dealId\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"subject\": \"<string>\",\n \"title\": \"<string>\",\n \"isInclusiveTax\": true,\n \"contentHtml\": \"<string>\",\n \"internalNotes\": \"<string>\",\n \"salesPersonId\": \"<string>\",\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"tags\": [\n \"<string>\"\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/quotations")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"<string>\",\n \"templateId\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"quotationProducts\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 123,\n \"taxRateId\": \"<string>\",\n \"discount\": 123,\n \"scope\": \"<string>\"\n }\n ],\n \"contactId\": \"<string>\",\n \"dealId\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"subject\": \"<string>\",\n \"title\": \"<string>\",\n \"isInclusiveTax\": true,\n \"contentHtml\": \"<string>\",\n \"internalNotes\": \"<string>\",\n \"salesPersonId\": \"<string>\",\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/quotations")
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 \"clientId\": \"<string>\",\n \"templateId\": \"<string>\",\n \"date\": \"2023-11-07T05:31:56Z\",\n \"quotationProducts\": [\n {\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"productId\": \"<string>\",\n \"description\": \"<string>\",\n \"tax\": 123,\n \"taxRateId\": \"<string>\",\n \"discount\": 123,\n \"scope\": \"<string>\"\n }\n ],\n \"contactId\": \"<string>\",\n \"dealId\": \"<string>\",\n \"expiryDate\": \"2023-11-07T05:31:56Z\",\n \"subject\": \"<string>\",\n \"title\": \"<string>\",\n \"isInclusiveTax\": true,\n \"contentHtml\": \"<string>\",\n \"internalNotes\": \"<string>\",\n \"salesPersonId\": \"<string>\",\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"date": "2023-11-07T05:31:56Z",
"currency": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"subject": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"conversionRate": 123,
"isInclusiveTax": true,
"clientId": "<string>",
"contactId": "<string>",
"dealId": "<string>",
"salesPersonId": "<string>",
"templateId": "<string>",
"contentHtml": "<string>",
"internalNotes": "<string>",
"totalAmount": 123,
"subtotalAmount": 123,
"totalTaxAmount": 123,
"totalDiscountAmount": 123,
"tagIds": [
"<string>"
],
"lineItems": [
{
"name": "<string>",
"quantity": 123,
"price": 123,
"productId": "<string>",
"description": "<string>",
"tax": 123,
"taxRateId": "<string>",
"discount": 123,
"scope": "<string>"
}
],
"markedAcceptedOn": "2023-11-07T05:31:56Z",
"markedRejectedOn": "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
Contact or company ID (clt_ prefix)
Document template ID (tpl_ prefix)
Quotation date
Line items
1Show child attributes
Show child attributes
Optional contact person ID (clt_ prefix) when clientId is a company
Deal ID (dl_ prefix)
Expiry date
Subject
Internal title
Initial status (defaults to DRAFT)
DRAFT, SENT, ACCEPTED, REJECTED Whether prices include tax
Document HTML (defaults from template when omitted)
Internal notes
Sales person user ID (usr_ prefix)
ISO 4217 currency code
Quotation currency to team currency rate
Tag IDs (tag_ prefix)
Custom field values using cf_* keys
Response
OK
Quotation ID (qtn_ prefix)
Auto-generated quotation number
Quotation date
Quotation status
DRAFT, SENT, ACCEPTED, REJECTED ISO 4217 currency code
Subject
Expiry date
Quotation currency to team currency rate
Whether prices include tax
Contact or company ID (clt_ prefix)
Optional contact person ID (clt_ prefix) when clientId is a company
Deal ID (dl_ prefix)
Sales person user ID (usr_ prefix)
Document template ID (tpl_ prefix)
Rendered document HTML
Internal notes
Total including tax
Subtotal before tax
Total tax amount
Total discount amount
Tag IDs (tag_ prefix)
Line items (included on get; empty on list)
Show child attributes
Show child attributes
When the quotation was accepted
When the quotation was rejected
Custom field values using cf_* keys