> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.solvimon.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.solvimon.com/_mcp/server.

# write_invoice

**Live server:** test server (`test.mcp.solvimon.com`) only.

Creates and manages invoices, payments and payment schedules. Solvimon generates invoices automatically at the end of each billing period. Use `create` for one-off manual invoices.

**Actions by resource type:**

* `invoices`: `create`, `add_line`, `delete_line`, `update`, `pay`, `refund`, `credit`, `archive`, `send_by_email`
* `payments`: `authorize`, `refund`
* `payment_schedules`: `create`, `update`, `activate`, `cancel`, `pause`

**One-off invoice.** `create` with a `type`, `customer_id` and `billing_currency` makes an empty DRAFT invoice on hold. Add lines with `add_line`: a fixed amount is `FIXED` with `fixed_amount`, a unit price is `FLAT` with `amount` and `volume`. `delete_line` takes the line id. Both work on DRAFT invoices only and return the new totals.

**Finalize** with `update` and `{"on_hold": false, "status": "FINAL"}`. This assigns a permanent invoice number; after that the invoice can only be credited, so confirm first.

`pay` and `refund` need a PSP integration. `send_by_email` needs a Mailgun or SendGrid integration. `credit` issues a credit note against a finalized invoice.

**`Finalize a one-off invoice`**

```json Finalize a one-off invoice
{"action": "update", "resource_type": "invoices", "id": "invo_Tq3mVx7RnW2kLb9YcHd45", "body": {"on_hold": false, "status": "FINAL"}}
```