Skip to main content
Glama

whmcs_get_invoices

Retrieve and filter invoices from WHMCS by client ID, status, or date range to manage billing records.

Instructions

Get invoices with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitstartNoStarting offset
limitnumNoNumber of results
useridNoFilter by client ID
statusNoFilter by status
orderbyNoField to order by
orderNoSort order

Implementation Reference

  • Core handler implementation for whmcs_get_invoices tool. Makes the WHMCS API call to 'GetInvoices' with provided parameters and returns the response.
    /** * Get invoices */ async getInvoices(params: { limitstart?: number; limitnum?: number; userid?: number; status?: 'Paid' | 'Unpaid' | 'Cancelled' | 'Refunded' | 'Collections' | 'Draft'; orderby?: string; order?: 'asc' | 'desc'; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; invoices: { invoice: Array<{ id: number; userid: number; firstname: string; lastname: string; companyname: string; invoicenum: string; date: string; duedate: string; datepaid: string; last_capture_attempt: string; subtotal: string; credit: string; tax: string; tax2: string; total: string; taxrate: string; taxrate2: string; status: string; paymentmethod: string; paymethodid: string | null; notes: string; currencycode: string; currencyprefix: string; currencysuffix: string; }> }; }>('GetInvoices', params); }
  • src/index.ts:258-277 (registration)
    Registers the MCP tool 'whmcs_get_invoices' including input schema validation using Zod and thin handler wrapper that delegates to WhmcsApiClient.getInvoices.
    server.registerTool( 'whmcs_get_invoices', { title: 'Get Invoices', description: 'Get invoices with optional filtering', inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), userid: z.number().optional().describe('Filter by client ID'), status: z.enum(['Paid', 'Unpaid', 'Cancelled', 'Refunded', 'Collections', 'Draft']).optional().describe('Filter by status'), orderby: z.string().optional().describe('Field to order by'), order: z.enum(['asc', 'desc']).optional().describe('Sort order'), }, }, async (params) => { const result = await whmcsClient.getInvoices(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • Input schema definition for whmcs_get_invoices tool using Zod for validation of filtering and pagination parameters.
    limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), userid: z.number().optional().describe('Filter by client ID'), status: z.enum(['Paid', 'Unpaid', 'Cancelled', 'Refunded', 'Collections', 'Draft']).optional().describe('Filter by status'), orderby: z.string().optional().describe('Field to order by'), order: z.enum(['asc', 'desc']).optional().describe('Sort order'), },

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