Skip to main content
POST
/
clients
Create a new client
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>"
  },
  "cf_": "<unknown>",
  "openingBalance": 0
}
'
{
  "id": "<string>",
  "number": "<string>",
  "name": "<string>",
  "type": "company",
  "createdAt": "2023-11-07T05:31:56Z",
  "firstName": "<string>",
  "lastName": "<string>"
}

Authorizations

x-api-key
string
header
required

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

Body

application/json
type
enum<string>
default:company

Client type: company for companies, contact for contacts

Available options:
company,
contact
name
string

Company name (required for companies, optional for contacts)

firstName
string

First name (required for contacts, not allowed for companies)

lastName
string

Last name (optional for contacts, not allowed for companies)

salutation
string

Title (Mr., Mrs., Dr., etc.) (not allowed for companies)

phone
string

Phone number with country code (not allowed for companies)

email
string<email> | null

Email address (not allowed for companies)

jobTitle
string

Job title or position (not allowed for companies)

website
any | null

Company website URL (not available for contacts)

taxNumber
string | null

Tax ID or VAT number

billingAddress
object

Billing address details

cf_
any | null

Custom fields, that start with cf_

openingBalance
number
default:0

Starting account balance (defaults to 0)

Required range: x >= 0
{key}
any

Response

200 - application/json

OK

Successfully created client

id
string
required

Client ID

number
string
required

Auto-generated client number

name
string
required

Client name

type
enum<string>
required

Client type: company or contact

Available options:
company,
contact
createdAt
string<date-time>
required

When the client was created

firstName
string | null

First name (for contacts)

lastName
string | null

Last name (for contacts)