Get Client Products
whmcs_get_client_productsGet products/services owned by a client with optional filters for service ID, domain, product ID, and pagination.
Instructions
Get products/services owned by a client
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientid | No | The client ID | |
| serviceid | No | Specific service ID | |
| domain | No | Filter by domain | |
| pid | No | Filter by product ID | |
| limitstart | No | Starting offset | |
| limitnum | No | Number of results |
Implementation Reference
- src/index.ts:173-193 (registration)Tool registration for 'whmcs_get_client_products' with Zod schema and handler that delegates to whmcsClient.getClientProducts()
server.registerTool( 'whmcs_get_client_products', { title: 'Get Client Products', description: 'Get products/services owned by a client', inputSchema: { clientid: z.number().optional().describe('The client ID'), serviceid: z.number().optional().describe('Specific service ID'), domain: z.string().optional().describe('Filter by domain'), pid: z.number().optional().describe('Filter by product ID'), limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), }, }, async (params) => { const result = await whmcsClient.getClientProducts(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:178-186 (schema)Input schema definition for the whmcs_get_client_products tool using Zod validation
inputSchema: { clientid: z.number().optional().describe('The client ID'), serviceid: z.number().optional().describe('Specific service ID'), domain: z.string().optional().describe('Filter by domain'), pid: z.number().optional().describe('Filter by product ID'), limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), }, }, - src/whmcs-client.ts:246-300 (handler)Handler method getClientProducts on WhmcsApiClient that calls WHMCS API 'GetClientsProducts' action with typed parameters and return type
async getClientProducts(params: { clientid?: number; serviceid?: number; domain?: string; pid?: number; username2?: string; limitstart?: number; limitnum?: number; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; products: { product: Array<{ id: number; clientid: number; orderid: number; pid: number; regdate: string; name: string; translated_name: string; groupname: string; translated_groupname: string; domain: string; dedicatedip: string; serverid: number; servername: string; serverip: string; serverhostname: string; suspensionreason: string; firstpaymentamount: string; recurringamount: string; paymentmethod: string; paymentmethodname: string; billingcycle: string; nextduedate: string; status: string; username: string; password: string; subscriptionid: string; promoid: number; overideautosuspend: string; overidesuspenduntil: string; ns1: string; ns2: string; assignedips: string; notes: string; diskusage: number; disklimit: number; bwusage: number; bwlimit: number; lastupdate: string; }> }; }>('GetClientsProducts', params); }