whmcs_get_affiliates
Retrieve affiliate data from WHMCS to track partner performance and manage referral programs.
Instructions
Get list of affiliates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limitstart | No | Starting offset | |
| limitnum | No | Number of results |
Implementation Reference
- src/index.ts:1146-1162 (registration)Registration of the 'whmcs_get_affiliates' MCP tool, including input schema definition and handler that delegates to WhmcsApiClient.getAffiliatesserver.registerTool( 'whmcs_get_affiliates', { title: 'Get Affiliates', description: 'Get list of affiliates', inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), }, }, async (params) => { const result = await whmcsClient.getAffiliates(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
- src/whmcs-client.ts:1335-1355 (handler)Core handler implementation: WhmcsApiClient.getAffiliates method that performs the WHMCS API call to 'GetAffiliates' action with pagination parameters and returns affiliate list data.async getAffiliates(params: { limitstart?: number; limitnum?: number; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; affiliates: { affiliate: Array<{ id: number; userid: number; date: string; visitors: number; paytype: string; payamount: string; onetime: string; balance: string; withdrawn: string; }> }; }>('GetAffiliates', params); }