Create purchase
Register a purchase from a supplier or a cash purchase, with VAT, cost account and payment.
MCP tool fiken_write → create_purchase
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
| Name | Type | Description |
|---|---|---|
| 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. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "fiken_write",
"arguments": {
"operation": "create_purchase",
"arguments": {
"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
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"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
},
"isError": false
}