create_payment
Record payments against FreshBooks invoices by specifying amount, date, and payment type to update financial records and track revenue.
Instructions
Record a payment against an invoice. Amount as string. Date as YYYY-MM-DD. Types: Check, Credit, Cash, Bank Transfer, Credit Card, PayPal, ACH, Other.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice_id | Yes | ||
| amount | Yes | ||
| date | Yes | ||
| payment_type | No | Other | |
| note | No | ||
| currency_code | No | USD |
Implementation Reference
- src/mcp_freshbooks/server.py:331-350 (handler)The handler function that executes the creation of a payment in FreshBooks.
async def create_payment( invoice_id: int, amount: str, date: str, payment_type: str = "Other", note: str = "", currency_code: str = "USD", ) -> str: """Record a payment against an invoice. Amount as string. Date as YYYY-MM-DD. Types: Check, Credit, Cash, Bank Transfer, Credit Card, PayPal, ACH, Other.""" data = { "invoiceid": invoice_id, "amount": {"amount": amount, "code": currency_code}, "date": date, "type": payment_type, } if note: data["note"] = note result = await client.accounting_create("payments/payments", "payment", data) p = result.get("payment", result) return f"Payment of ${amount} recorded against invoice {invoice_id} (Payment ID: {p.get('id')})" - src/mcp_freshbooks/server.py:329-330 (registration)The MCP tool registration for create_payment using the @mcp.tool() decorator.
@mcp.tool() @_handle_errors