Skip to main content
POST
/
deals
Create deal
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
    }
  ]
}
'
{
  "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"
}

Authorizations

x-api-key
string
header
required

API key for authentication. Get yours at app.heffl.com/settings/developers

Body

application/json
title
string
required

Deal title

clientId
string
required

Contact or company ID (clt_ prefix)

pipelineId
string
required

Pipeline ID

stageId
string | null

Pipeline stage ID

leadId
string

Lead ID

sourceId
string

CRM source ID

ownerUserId
string

Owner user ID

price
number

Deal value

expectedCloseDate
string<date-time>

Expected close date

priority
enum<string>

Deal priority

Available options:
LOW,
MEDIUM,
HIGH
status
enum<string>

Deal status

Available options:
ACTIVE,
WON,
LOST
currency
string

3-letter ISO currency code

isInclusiveTax
boolean

Whether prices include tax

assignees
string[]

Assignee user IDs

contacts
string[]

Contact IDs linked to the deal

tags
string[]

Tag IDs

products
object[]

Deal line items

{key}
any

Custom field values using cf_* keys. Only documented fields and cf_* keys are accepted.

Response

OK

id
string
required

Deal ID

number
string
required

Auto-generated deal number

title
string
required

Deal title

contactEmails
string[]
required

Emails of linked contacts

clientId
string | null

Contact or company ID (clt_ prefix)

client
object

Linked client record

price
number | null

Deal value

expectedCloseDate
string<date-time> | null

Expected close date

status
enum<string> | null

Deal status

Available options:
ACTIVE,
WON,
LOST
priority
enum<string> | null

Deal priority

Available options:
LOW,
MEDIUM,
HIGH
pipelineId
string | null

Pipeline ID (dpl_ prefix)

stageId
string | null

Pipeline stage ID (dps_ prefix)

stage
string | null

Pipeline stage name

leadId
string | null

Lead ID

leadName
string | null

Lead name

crmSourceId
string | null

CRM source ID (src_ prefix)

source
string | null

CRM source name

ownerUserId
string | null

Owner user ID (usr_ prefix)

ownerId
string | null

Owner user ID (usr_ prefix)

ownerName
string | null

Owner name

createdAt
string<date-time> | null

When the deal was created

updatedAt
string<date-time> | null

When the deal was last updated

{key}
any

Custom field values as top-level cf_* keys (for example cf_priority). There is no customFields wrapper.