Accept Order
whmcs_accept_orderAccepts a pending WHMCS order and processes it, provisioning services and sending notifications as configured.
Instructions
Accept and process a pending order
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderid | Yes | Order ID | |
| serverid | No | Server to provision on | |
| serviceusername | No | Username for service | |
| servicepassword | No | Password for service | |
| registrar | No | Domain registrar module | |
| autosetup | No | Auto setup products | |
| sendemail | No | Send setup email |
Implementation Reference
- src/index.ts:792-813 (registration)Registration of the 'whmcs_accept_order' tool on the MCP server, including its Zod input schema (orderid, serverid, serviceusername, servicepassword, registrar, autosetup, sendemail) and the handler that calls whmcsClient.acceptOrder(params).
server.registerTool( 'whmcs_accept_order', { title: 'Accept Order', description: 'Accept and process a pending order', inputSchema: { orderid: z.number().describe('Order ID'), serverid: z.number().optional().describe('Server to provision on'), serviceusername: z.string().optional().describe('Username for service'), servicepassword: z.string().optional().describe('Password for service'), registrar: z.string().optional().describe('Domain registrar module'), autosetup: z.boolean().optional().describe('Auto setup products'), sendemail: z.boolean().optional().describe('Send setup email'), }, }, async (params) => { const result = await whmcsClient.acceptOrder(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:807-812 (handler)The handler function for 'whmcs_accept_order' that receives the validated params, calls whmcsClient.acceptOrder(params), and returns the JSON-stringified result.
async (params) => { const result = await whmcsClient.acceptOrder(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/index.ts:797-806 (schema)Zod input schema for 'whmcs_accept_order' defining required orderid (number) and optional fields: serverid, serviceusername, servicepassword, registrar, autosetup, sendemail.
inputSchema: { orderid: z.number().describe('Order ID'), serverid: z.number().optional().describe('Server to provision on'), serviceusername: z.string().optional().describe('Username for service'), servicepassword: z.string().optional().describe('Password for service'), registrar: z.string().optional().describe('Domain registrar module'), autosetup: z.boolean().optional().describe('Auto setup products'), sendemail: z.boolean().optional().describe('Send setup email'), }, }, - src/whmcs-client.ts:1007-1018 (helper)The acceptOrder method on the WhmcsApiClient class that maps typed parameters to the WHMCS API 'AcceptOrder' call via this.call().
async acceptOrder(params: { orderid: number; serverid?: number; serviceusername?: string; servicepassword?: string; registrar?: string; sendregistrar?: boolean; autosetup?: boolean; sendemail?: boolean; }) { return this.call<WhmcsApiResponse>('AcceptOrder', params); } - src/whmcs-client.ts:1004-1018 (helper)Full acceptOrder method including JSDoc comment, parameter type definition, and the API call delegation.
/** * Accept an order */ async acceptOrder(params: { orderid: number; serverid?: number; serviceusername?: string; servicepassword?: string; registrar?: string; sendregistrar?: boolean; autosetup?: boolean; sendemail?: boolean; }) { return this.call<WhmcsApiResponse>('AcceptOrder', params); }