Cancel Order
whmcs_cancel_orderCancel a WHMCS order by specifying the order ID. Optionally cancel the associated subscription and suppress email notifications.
Instructions
Cancel an order
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderid | Yes | Order ID | |
| cancelsub | No | Cancel subscription | |
| noemail | No | Do not send email |
Implementation Reference
- src/index.ts:815-832 (registration)Registration of the 'whmcs_cancel_order' tool via server.registerTool. Defines the input schema (orderid required, cancelsub and noemail optional) and the handler that calls whmcsClient.cancelOrder(params).
server.registerTool( 'whmcs_cancel_order', { title: 'Cancel Order', description: 'Cancel an order', inputSchema: { orderid: z.number().describe('Order ID'), cancelsub: z.boolean().optional().describe('Cancel subscription'), noemail: z.boolean().optional().describe('Do not send email'), }, }, async (params) => { const result = await whmcsClient.cancelOrder(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/whmcs-client.ts:1020-1029 (handler)The cancelOrder method on WhmcsApiClient. Calls the WHMCS API 'CancelOrder' action with params (orderid, cancelsub, noemail) and returns the API response.
/** * Cancel an order */ async cancelOrder(params: { orderid: number; cancelsub?: boolean; noemail?: boolean; }) { return this.call<WhmcsApiResponse>('CancelOrder', params); }