Get Orders
whmcs_get_ordersRetrieve orders from WHMCS with optional filters by ID, client, status, or pagination.
Instructions
Get orders with optional filtering
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limitstart | No | Starting offset | |
| limitnum | No | Number of results | |
| id | No | Specific order ID | |
| userid | No | Filter by client ID | |
| status | No | Filter by status |
Implementation Reference
- src/index.ts:771-790 (registration)Registration of the 'whmcs_get_orders' tool via server.registerTool with input schema (limitstart, limitnum, id, userid, status) and handler that delegates to whmcsClient.getOrders()
server.registerTool( 'whmcs_get_orders', { title: 'Get Orders', description: 'Get orders with optional filtering', inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), id: z.number().optional().describe('Specific order ID'), userid: z.number().optional().describe('Filter by client ID'), status: z.string().optional().describe('Filter by status'), }, }, async (params) => { const result = await whmcsClient.getOrders(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:784-790 (handler)The async handler function for whmcs_get_orders that calls whmcsClient.getOrders(params) and returns the JSON-stringified result
async (params) => { const result = await whmcsClient.getOrders(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:776-783 (schema)Input schema (Zod) for whmcs_get_orders: limitstart (number optional), limitnum (number optional), id (number optional), userid (number optional), status (string optional)
inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), id: z.number().optional().describe('Specific order ID'), userid: z.number().optional().describe('Filter by client ID'), status: z.string().optional().describe('Filter by status'), }, }, - src/whmcs-client.ts:952-1002 (helper)The WhmcsApiClient.getOrders() helper method that sends the 'GetOrders' action to the WHMCS API with typed parameters and response
/** * Get orders */ async getOrders(params: { limitstart?: number; limitnum?: number; id?: number; userid?: number; status?: string; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; orders: { order: Array<{ id: number; ordernum: string; userid: number; contactid: number; requestor_id: number; date: string; nameservers: string; transfersecret: string; renewals: string; promocode: string; promotype: string; promovalue: string; orderdata: string; amount: string; paymentmethod: string; invoiceid: number; status: string; ipaddress: string; fraudmodule: string; fraudoutput: string; notes: string; paymentmethodname: string; paymentstatus: string; lineitems: { lineitem: Array<{ type: string; relid: number; producttype: string; product: string; domain: string; billingcycle: string; amount: string; status: string; }> }; }> }; }>('GetOrders', params); }