Skip to main content
POST
/
invoices
Create a new invoice
curl --request POST \
  --url https://api.heffl.com/api/v1/invoices \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "clientId": "<string>",
  "date": "2023-11-07T05:31:56Z",
  "dueDate": "2023-11-07T05:31:56Z",
  "lineItems": [
    {
      "name": "<string>",
      "productId": "<string>",
      "quantity": 0,
      "price": 0,
      "description": "<string>",
      "taxRateId": "<string>",
      "discount": 0,
      "discountType": "fixed",
      "buyPrice": 0
    }
  ],
  "isInclusiveTax": false,
  "status": "DRAFT",
  "contactId": "<string>",
  "subject": "<string>",
  "notes": "<string>",
  "salesPersonId": "<string>",
  "templateId": "<string>",
  "tags": []
}
'
{
  "id": "<string>",
  "number": "<string>",
  "date": "2023-11-07T05:31:56Z",
  "dueDate": "2023-11-07T05:31:56Z",
  "status": "<string>",
  "currency": "<string>",
  "isInclusiveTax": true,
  "subTotal": 123,
  "taxTotal": 123,
  "discountTotal": 123,
  "total": 123,
  "pendingTotal": 123,
  "paidTotal": 123,
  "lineItems": [
    {
      "name": "<string>",
      "quantity": 123,
      "price": 123,
      "tax": 123,
      "discount": 123,
      "discountType": "fixed",
      "buyPrice": 123,
      "viewType": "LINE_ITEM",
      "amount": 123,
      "taxAmount": 123,
      "discountAmount": 123,
      "description": "<string>",
      "productId": 123
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "clientId": "<string>",
  "contactId": "<string>",
  "subject": "<string>",
  "notes": "<string>",
  "salesPersonId": 123,
  "customFields": {}
}

Authorizations

x-api-key
string
header
required

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

Body

application/json
clientId
string
required

Client public ID (required)

date
string<date-time>
required

Invoice date

dueDate
string<date-time>
required

Due date

lineItems
object[]
required

Invoice line items

Minimum array length: 1
isInclusiveTax
boolean
default:false

Whether prices include tax

status
enum<string>
default:DRAFT

Invoice status (DRAFT or SENT)

Available options:
DRAFT,
SENT
contactId
string | null

Contact public ID

subject
string | null

Invoice subject

notes
string | null

Invoice notes

salesPersonId
string | null

Sales person user public ID

templateId
string | null

Document template public ID. If not provided, uses the team's default invoice template.

tags
number[]

Tag IDs to associate with the invoice

{key}
any

Response

200 - application/json

OK

id
string
required

Invoice public ID

number
string
required

Auto-generated invoice number

date
string<date-time>
required

Invoice date

dueDate
string<date-time>
required

Invoice due date

status
string
required

Invoice status

currency
string
required

Currency code

isInclusiveTax
boolean
required

Whether prices include tax

subTotal
number
required

Subtotal before tax

taxTotal
number
required

Total tax amount

discountTotal
number
required

Total discount amount

total
number
required

Grand total

pendingTotal
number
required

Amount pending

paidTotal
number
required

Total amount paid

lineItems
object[]
required

Invoice line items

createdAt
string<date-time>
required

When the invoice was created

clientId
string | null

Client public ID

contactId
string | null

Contact public ID

subject
string | null

Invoice subject

notes
string | null

Invoice notes

salesPersonId
number | null

Sales person user ID

customFields
object

Custom field values