Apply Credit
whmcs_apply_creditCredit a WHMCS invoice with a specified amount, optionally disabling the email notification.
Instructions
Apply credit to an invoice
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoiceid | Yes | Invoice ID | |
| amount | Yes | Amount of credit to apply | |
| noemail | No | Do not send email |
Implementation Reference
- src/index.ts:372-389 (registration)Tool registration of 'whmcs_apply_credit' with input schema for invoiceid, amount, and optional noemail. Handler delegates to whmcsClient.applyCredit().
server.registerTool( 'whmcs_apply_credit', { title: 'Apply Credit', description: 'Apply credit to an invoice', inputSchema: { invoiceid: z.number().describe('Invoice ID'), amount: z.number().describe('Amount of credit to apply'), noemail: z.boolean().optional().describe('Do not send email'), }, }, async (params) => { const result = await whmcsClient.applyCredit(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:377-381 (schema)Input schema for whmcs_apply_credit: invoiceid (number, required), amount (number, required), noemail (boolean, optional).
inputSchema: { invoiceid: z.number().describe('Invoice ID'), amount: z.number().describe('Amount of credit to apply'), noemail: z.boolean().optional().describe('Do not send email'), }, - src/whmcs-client.ts:570-576 (handler)Handler method applyCredit() on WhmcsApiClient class. Calls the WHMCS API 'ApplyCredit' action with invoiceid, amount, and optional noemail.
async applyCredit(params: { invoiceid: number; amount: number; noemail?: boolean; }) { return this.call<WhmcsApiResponse & { invoiceid: number }>('ApplyCredit', params); }