Create Quote
whmcs_create_quoteCreate a new quote by providing subject, stage, validity date, and optional client details or notes.
Instructions
Create a new quote
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subject | Yes | Quote subject | |
| stage | Yes | Quote stage | |
| validuntil | Yes | Valid until date (YYYY-MM-DD) | |
| userid | No | Client ID | |
| firstname | No | First name | |
| lastname | No | Last name | |
| companyname | No | Company name | |
| No | |||
| proposal | No | Proposal text | |
| customernotes | No | Customer notes | |
| adminnotes | No | Admin notes |
Implementation Reference
- src/index.ts:1248-1272 (registration)Tool registration in index.ts - defines the 'whmcs_create_quote' tool with input schema (subject, stage, validuntil, userid, etc.) and a handler that calls whmcsClient.createQuote(params)
'whmcs_create_quote', { title: 'Create Quote', description: 'Create a new quote', inputSchema: { subject: z.string().describe('Quote subject'), stage: z.enum(['Draft', 'Delivered', 'On Hold', 'Accepted', 'Lost', 'Dead']).describe('Quote stage'), validuntil: z.string().describe('Valid until date (YYYY-MM-DD)'), userid: z.number().optional().describe('Client ID'), firstname: z.string().optional().describe('First name'), lastname: z.string().optional().describe('Last name'), companyname: z.string().optional().describe('Company name'), email: z.string().optional().describe('Email'), proposal: z.string().optional().describe('Proposal text'), customernotes: z.string().optional().describe('Customer notes'), adminnotes: z.string().optional().describe('Admin notes'), }, }, async (params) => { const result = await whmcsClient.createQuote(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:1252-1264 (schema)Input schema definition for the whmcs_create_quote tool, specifying required fields (subject, stage, validuntil) and optional fields (userid, firstname, lastname, companyname, email, proposal, customernotes, adminnotes)
inputSchema: { subject: z.string().describe('Quote subject'), stage: z.enum(['Draft', 'Delivered', 'On Hold', 'Accepted', 'Lost', 'Dead']).describe('Quote stage'), validuntil: z.string().describe('Valid until date (YYYY-MM-DD)'), userid: z.number().optional().describe('Client ID'), firstname: z.string().optional().describe('First name'), lastname: z.string().optional().describe('Last name'), companyname: z.string().optional().describe('Company name'), email: z.string().optional().describe('Email'), proposal: z.string().optional().describe('Proposal text'), customernotes: z.string().optional().describe('Customer notes'), adminnotes: z.string().optional().describe('Admin notes'), }, - src/index.ts:1266-1271 (handler)Handler function for whmcs_create_quote - delegates to whmcsClient.createQuote(params) and returns JSON-stringified result
async (params) => { const result = await whmcsClient.createQuote(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/whmcs-client.ts:1458-1487 (helper)The WhmcsApiClient.createQuote method that sends the actual 'CreateQuote' API request to WHMCS. Accepts parameters (subject, stage, validuntil, userid, firstname, lastname, companyname, email, address fields, currency, proposal, customernotes, adminnotes, lineitems) and returns { quoteid }
async createQuote(params: { subject: string; stage: 'Draft' | 'Delivered' | 'On Hold' | 'Accepted' | 'Lost' | 'Dead'; validuntil: string; userid?: number; firstname?: string; lastname?: string; companyname?: string; email?: string; address1?: string; address2?: string; city?: string; state?: string; postcode?: string; country?: string; phonenumber?: string; currency?: number; proposal?: string; customernotes?: string; adminnotes?: string; lineitems?: Array<{ desc: string; qty: number; up: number; discount: number; taxable: boolean; }>; }) { return this.call<WhmcsApiResponse & { quoteid: number }>('CreateQuote', params); }