Skip to main content

Create Invoices with the API

This guide explains how to create invoices through the Fiskl API from the products and services in your catalog. It covers product IDs, invoice numbers, and custom fields such as a PO number. It also maps each field of the Fiskl Zapier action to the API, so you can move an existing automation across.

Before You Begin​

  • Create an API key with the permissions below. See Create and Manage API Keys.
  • Have the ID of the client you are invoicing. GET /v1/clients returns it.
  • Have the IDs of the products and services you sell. GET /v1/products returns them.
ActionAPI key permissionOAuth scope
List products and servicesproduct.readproducts:read
Create, preview, and update invoicesinvoice.writeinvoicing:write
Send invoices by emailinvoice.write and invoice.sendinvoicing:write

How Products and Invoice Lines Work​

A product or service in your catalog is a template. It holds a name, a price, a unit, taxes, and an income ledger account. An invoice line is a copy of that template that belongs to one invoice.

When a line carries a productId, Fiskl ties the line to that catalog item. The line starts with the item's details, and anything you send on the line replaces them for that invoice only. The catalog item stays as it is, so you can sell the same item at a different price or quantity on every invoice.

A line without a productId works differently. Fiskl looks for a catalog item with the same name and kind, and ties the line to the first match. If nothing matches, Fiskl adds a new item to your catalog.

tip

Send productId on every line that sells a catalog item. Your catalog stays free of duplicates, and each sale reports against the right product or service.

The API creates product and service lines only. Time entries, mileage, and billable expenses each belong to one invoice, and you add them in the Fiskl app.

Create an Invoice​

Send one POST request with the client, the dates, and the line items:

curl -X POST https://api.fiskl.com/v1/invoices \
-H "Authorization: Bearer fsk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"externalId": "order-2026-000123",
"clientId": 72568,
"currencyCode": "USD",
"invoiceDate": "2026-03-01",
"dueDate": "2026-03-31",
"invoiceNumber": "251020001",
"customFields": [
{ "label": "PO number", "value": "PO-88213" }
],
"items": [
{ "productId": 49444, "price": 40000, "quantity": 1, "note": "Sep rental, SN# TYKA013783" },
{ "productId": 49594, "quantity": 2 }
],
"notes": "Thank you for your business!"
}'

A successful request returns 201 and the saved invoice. This example shows the main fields:

{
"id": 362715,
"serialNumber": "251020001",
"status": "Open",
"total": 90000,
"customFields": [
{ "label": "PO number", "value": "PO-88213" }
],
"items": [
{ "productId": 49444, "name": "Laptop rental", "note": "Sep rental, SN# TYKA013783", "quantity": 1.0, "price": 40000, "total": 40000 },
{ "productId": 49594, "name": "Setup fee", "quantity": 2.0, "price": 25000, "total": 50000 }
]
}

The invoice is saved with the status Open, which means it has not been sent. Amounts are integer minor units, so 40000 means 400.00. Fiskl calculates the line totals, the taxes, and the invoice total, and ignores any totals you send.

Invoice Fields​

FieldRequiredWhat it does
clientIdYesThe client to invoice
invoiceDateYesThe issue date, as YYYY-MM-DD
dueDateYesThe payment due date, on or after invoiceDate
itemsYesThe line items, at least one
externalIdNoYour own reference, which makes the request safe to retry
currencyCodeNoDefaults to the client's currency, then your base currency
invoiceNumberNoDefaults to the next number in your sequence
saleDateNoThe sale date, when it differs from the invoice date
nameNoThe invoice title shown in Fiskl
notesNoNotes printed on the invoice
customFieldsNoLabelled values printed on the invoice
templateIdNoDefaults to your default invoice template
manualPaymentMethodIdsNoManual payment methods to show, none by default
onlinePaymentMethodsNoOnline payment methods to offer, none by default

GET /v1/invoice-templates and GET /v1/payment-methods return the template IDs and payment method values.

Line Item Fields​

Each field below is optional when the line has a productId. The last column shows what the line uses when you leave the field out.

FieldWhat it doesDefault with a productId
productIdTies the line to a catalog item—
nameThe line titleThe item's name
noteThe description under the titleThe item's note
priceThe unit price in minor unitsThe item's price
quantityThe quantity1
unitThe unit of measureThe item's unit
typeProduct or ServiceThe item's kind
taxIdsThe taxes to apply, in orderThe item's taxes
categoryIdThe income ledger accountThe item's ledger account

A line takes the item's price only when the item uses the same currency as the invoice. For an invoice in another currency, send price on the line. To apply no tax to a line, send taxIds as an empty list.

A line without a productId needs a name and a price. Its type defaults to Service.

Set the Invoice Number​

Leave invoiceNumber out and Fiskl assigns the next number in your sequence. Send it to use your own number. If that number is already taken, Fiskl moves to the next free number. Read serialNumber in the response to see the number the invoice received.

warning

The number you send becomes the new base of your sequence. After you send 251020001, the next invoice without a number is 251020002, including invoices created in the Fiskl app.

invoiceNumber is different from externalId. The invoice number is printed on the invoice and seen by your client. externalId is a private reference that protects against duplicates. If you repeat a request with the same externalId, Fiskl returns the invoice already created, with status 200.

Add Custom Fields​

Use customFields to print extra labelled values on the invoice, such as a purchase order number. Each entry needs a label, and takes a value. These are the same fields as Custom Fields on an invoice in the Fiskl app.

"customFields": [
{ "label": "PO number", "value": "PO-88213" },
{ "label": "Project", "value": "Harbour refit" }
]

Preview, Update, and Send​

Preview. Send the same body to POST /v1/invoices/preview to get the calculated totals without saving anything.

Update. PUT /v1/invoices/{id} replaces the invoice's fields and all of its lines, so send every line you want to keep. You can update an invoice only while its status is Open. These fields behave differently on an update:

  • invoiceNumber and externalId are ignored, and the invoice keeps the values it has.
  • customFields, templateId, and the payment method fields keep their current values when you leave them out.
  • An empty list removes the custom fields or the payment methods.

Send. POST /v1/invoices/{id}/send emails the invoice to the client and marks it as sent. This request needs an Idempotency-Key header with a value that is unique for each send. The body is optional, and takes to, cc, bcc, and message as text values.

curl -X POST https://api.fiskl.com/v1/invoices/362715/send \
-H "Authorization: Bearer fsk_your_key_here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: send-order-2026-000123" \
-d '{ "message": "Please find your invoice attached." }'

Move from Zapier to the API​

The Fiskl Zapier action takes comma-separated lists, one list per line field. The API takes one object per line in items instead. Use this table to map each Zapier field.

Zapier fieldAPI fieldNotes
Client IdclientId
Line item idsitems[].productIdOne line per ID
Line item namesitems[].nameLeave out to keep the catalog name
Line item descriptionsitems[].note
Line item priceitems[].priceMinor units, as in Zapier
Line item quantitiesitems[].quantity
Line item Typeitems[].type
Line item Unitsitems[].unit
Line item Currency—Lines use the invoice currency
Invoice numberinvoiceNumber
Invoice namename
Invoice currencycurrencyCodeA code such as USD
Invoice dateinvoiceDateRequired by the API
Invoice due datedueDateRequired by the API
Invoice sale datesaleDate
Invoice template IDtemplateId
Manual payment methodsmanualPaymentMethodIds
Payment methodsonlinePaymentMethods
Invoice notesnotes
Custom label and custom valuecustomFieldsThe API takes more than one field
Invoice language ID—The invoice uses your company's invoice language
Deposit percent and amount—Not available through the API
Discount percent and amount—Not available through the API

Two behaviours differ from Zapier:

  • Lines stay tied to the product ID you send. The Zapier action copies the catalog item onto the line, then matches the line back to the catalog by name. With two items of the same name, the line can end up on the wrong one. The API uses the ID you send.
  • Dates are required. Zapier fills in today's date and your payment terms when you leave the dates out. The API needs both invoiceDate and dueDate.

Common Issues​

The request returns 400 with "Unknown value"

An ID in the request does not exist in the company of your API key. The message names the value. Check the clientId, each productId, and any taxIds, categoryId, or templateId against the lists the API returns.

The request returns 400 and says the price is required

The line has no price, and Fiskl could not take one from the catalog. This happens when the line has no productId, or when the catalog item uses a different currency from the invoice. Send price on the line.

The invoice received a different number from the one you sent

Another invoice already uses that number, so Fiskl moved to the next free one. Read serialNumber in the response and store that value in your own system.

New items keep appearing in your catalog

Lines without a productId add a catalog item whenever their name matches nothing in the catalog. Send productId on each line, and put the text that changes per invoice in note.

The update returns 400 and says the status is incorrect

Only invoices with the status Open can be updated. An invoice that was sent or paid is locked. Create a new invoice, or issue a credit note against the original.