Skip to main content
Glama

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
NameRequiredDescriptionDefault
invoice_idYes
amountYes
dateYes
payment_typeNoOther
noteNo
currency_codeNoUSD

Implementation Reference

  • 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')})"
  • The MCP tool registration for create_payment using the @mcp.tool() decorator.
    @mcp.tool()
    @_handle_errors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AlexlaGuardia/MCP-Freshbooks'

If you have feedback or need assistance with the MCP directory API, please join our Discord server