Create purchase

Register a purchase from a supplier or a cash purchase, with VAT, cost account and payment.

POST https://cotlet.dev/api/v1/fiken/purchases

write Confirm

Registers one purchase like Registrer kjøp in Fiken: a supplier purchase (kjøp fra leverandør) or a cash purchase (kontantkjøp), with one or more lines of gross amount, VAT type and cost account. Attach a document with inbox_document_id. paid_from is bank_account, cash, out_of_pocket (Utlegg, paid by you personally) or unpaid; an unpaid purchase is paid later in Fiken. A booked purchase cannot be edited directly: Fiken cancels the booking and makes a new draft. Check list_purchases for the same invoice number first. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: create_purchase
NameTypeDescription
kind enum required enum supplier or cash_purchase.
supplier_id integer integer Contact ID from list_contacts. Required for supplier.
date date required date Invoice or receipt date.
invoice_number string string The supplier's invoice number, used to avoid booking a document twice.
due_date date date Due date, if different from the invoice date.
lines array required array Objects with description, gross_amount, vat_type (for example HIGH, MEDIUM, LOW or NONE) and expense_account. Several objects split the purchase.
paid_from enum enum bank_account, cash, out_of_pocket or unpaid. Default: unpaid.
bank_account string string Account code from list_bank_accounts. Required for bank_account.
payment_date date date Date of payment. Default: the purchase date.
inbox_document_id integer integer Document ID from list_inbox or upload_receipt.
currency string string ISO 4217 code. Default: NOK.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/fiken/purchases \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"supplier","supplier_id":6120455,"date":"2026-10-09","invoice_number":"88214","due_date":"2026-10-23","lines":[{"description":"Printer paper and toner","gross_amount":1250,"vat_type":"HIGH","expense_account":"6800"}],"paid_from":"bank_account","bank_account":"1920:10001","payment_date":"2026-10-09","inbox_document_id":3318240}'
Python
result = client.call("fiken", "create_purchase", {"kind":"supplier","supplier_id":6120455,"date":"2026-10-09","invoice_number":"88214","due_date":"2026-10-23","lines":[{"description":"Printer paper and toner","gross_amount":1250,"vat_type":"HIGH","expense_account":"6800"}],"paid_from":"bank_account","bank_account":"1920:10001","payment_date":"2026-10-09","inbox_document_id":3318240})
Node.js
const result = await cotlet.call('fiken', 'create_purchase', {"kind":"supplier","supplier_id":6120455,"date":"2026-10-09","invoice_number":"88214","due_date":"2026-10-23","lines":[{"description":"Printer paper and toner","gross_amount":1250,"vat_type":"HIGH","expense_account":"6800"}],"paid_from":"bank_account","bank_account":"1920:10001","payment_date":"2026-10-09","inbox_document_id":3318240});
CLI
cotlet call fiken create_purchase --data '{"kind":"supplier","supplier_id":6120455,"date":"2026-10-09","invoice_number":"88214","due_date":"2026-10-23","lines":[{"description":"Printer paper and toner","gross_amount":1250,"vat_type":"HIGH","expense_account":"6800"}],"paid_from":"bank_account","bank_account":"1920:10001","payment_date":"2026-10-09","inbox_document_id":3318240}'

Example response

JSON

{
  "purchase_id": 8820145,
  "kind": "supplier",
  "supplier": "Kontorbutikken AS",
  "date": "2026-10-09",
  "invoice_number": "88214",
  "net": 1000,
  "vat": 250,
  "gross": 1250,
  "currency": "NOK",
  "paid": true,
  "balance": 0,
  "document_attached": true
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.