Book KSeF purchase invoice

Book a purchase invoice from KSeF as a cost.

MCP tool ifirma_write → book_ksef_purchase_invoice

write Confirm

Does what "Zaksięguj" does on a document from list_ksef_purchase_invoices. It works for VAT and corrective invoices; advance and final invoices are booked in an order and are refused. The cost then appears in Wydatki, Lista wydatków. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: book_ksef_purchase_invoice
NameTypeDescription
ksef_number string required string KSeF number from list_ksef_purchase_invoices.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ifirma_write",
    "arguments": {
      "operation": "book_ksef_purchase_invoice",
      "arguments": {
        "ksef_number": "7010003987-20261012-AB12CD34EF56-7A"
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "ksef_number": "7010003987-20261012-AB12CD34EF56-7A",
    "booked": true,
    "seller_number": "FV 118/2026",
    "gross": 800
  },
  "isError": false
}

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.