Skip to main content
Glama

whmcs_add_payment

Record payments on WHMCS invoices by specifying invoice ID, transaction details, gateway, and amount. Use this tool to update payment records in your WHMCS installation.

Instructions

Record a payment on an invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceidYesInvoice ID
transidYesTransaction ID
gatewayYesPayment gateway name
amountNoPayment amount
feesNoTransaction fees
noemailNoDo not send email
dateNoPayment date (YYYY-MM-DD)

Implementation Reference

  • Core implementation of the tool logic: records a payment on an invoice by invoking the WHMCS API 'AddInvoicePayment' endpoint.
    async addPayment(params: { invoiceid: number; transid: string; gateway: string; amount?: number; fees?: number; noemail?: boolean; date?: string; }) { return this.call<WhmcsApiResponse>('AddInvoicePayment', params); }
  • Input schema using Zod for validating tool parameters.
    inputSchema: { invoiceid: z.number().describe('Invoice ID'), transid: z.string().describe('Transaction ID'), gateway: z.string().describe('Payment gateway name'), amount: z.number().optional().describe('Payment amount'), fees: z.number().optional().describe('Transaction fees'), noemail: z.boolean().optional().describe('Do not send email'), date: z.string().optional().describe('Payment date (YYYY-MM-DD)'), },
  • src/index.ts:349-370 (registration)
    MCP server tool registration including title, description, schema, and thin wrapper handler delegating to WhmcsApiClient.addPayment.
    server.registerTool( 'whmcs_add_payment', { title: 'Add Payment', description: 'Record a payment on an invoice', inputSchema: { invoiceid: z.number().describe('Invoice ID'), transid: z.string().describe('Transaction ID'), gateway: z.string().describe('Payment gateway name'), amount: z.number().optional().describe('Payment amount'), fees: z.number().optional().describe('Transaction fees'), noemail: z.boolean().optional().describe('Do not send email'), date: z.string().optional().describe('Payment date (YYYY-MM-DD)'), }, }, async (params) => { const result = await whmcsClient.addPayment(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );

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/scarecr0w12/whmcs-mcp-server'

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