Save invoice draft

Save an invoice as a draft without a number, to review and issue in the app.

MCP tool ifirma_write → save_invoice_draft

write

Does what "Zapisz szkic" does: saves the invoice without a number, and it shows in the invoice list. A draft reaches no one and can be edited or deleted in the app, so save_invoice_draft runs without asking first. It takes the same parameters as issue_invoice.

Parameters

Parameters: save_invoice_draft
NameTypeDescription
contractor_id string required string Contractor ID from list_contractors or create_contractor.
lines array required array Lines: {name, quantity, unit, unit_price, vat_rate}. vat_rate is 23, 8, 5, 0 or exempt.
calculate_from string string net or gross: which price you give. Default: net.
issue_date string string YYYY-MM-DD. Default: today.
due_date string string YYYY-MM-DD.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ifirma_write",
    "arguments": {
      "operation": "save_invoice_draft",
      "arguments": {
        "contractor_id": "contractor_8c41d2",
        "lines": "lines"
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "id": 7020119,
    "number": null,
    "draft": true,
    "buyer": "Blue Fern Studio",
    "gross": 1230,
    "currency": "PLN"
  },
  "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.