list_invoices
Retrieve and filter invoices from FreshBooks by status, customer, or pagination to manage billing records.
Instructions
List invoices with optional filters. Status: draft, sent, viewed, outstanding, paid.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| per_page | No | ||
| status | No | ||
| customer_id | No |
Implementation Reference
- src/mcp_freshbooks/server.py:120-135 (handler)Implementation of the 'list_invoices' MCP tool, which fetches invoice data from the FreshBooks client and summarizes it.
async def list_invoices( page: int = 1, per_page: int = 25, status: str | None = None, customer_id: int | None = None, ) -> str: """List invoices with optional filters. Status: draft, sent, viewed, outstanding, paid.""" filters = {} if status: filters["display_status"] = status if customer_id: filters["customerid"] = customer_id result = await client.accounting_list( "invoices/invoices", page, per_page, filters, includes=["lines"] ) return _summarize_list(result, "invoices", ["id", "invoice_number", "display_status", "amount", "outstanding", "customerid", "due_date"])