addAccountingItems
Add charges, payments, and other financial items to customer bills in the Mews hospitality platform to manage billing and accounting transactions.
Instructions
Adds new accounting items (charges, payments, etc.) to customer bills
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| AccountingItems | Yes | Array of accounting item objects to create |
Implementation Reference
- The main handler function that executes the tool by calling the Mews API endpoint /api/connector/v1/accountingItems/add with the provided accounting items data.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; const requestData = { ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/accountingItems/add', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- The input schema defining the structure of the AccountingItems array, including required fields like CustomerId, AccountingCategoryId, and Amount object.inputSchema: { type: 'object', properties: { AccountingItems: { type: 'array', items: { type: 'object', properties: { CustomerId: { type: 'string', description: 'Customer ID' }, AccountingCategoryId: { type: 'string', description: 'Accounting category ID' }, Amount: { type: 'object', properties: { Currency: { type: 'string', description: 'Currency code' }, Value: { type: 'number', description: 'Amount value' } }, required: ['Currency', 'Value'], description: 'Amount object' }, ConsumedUtc: { type: 'string', description: 'Consumption date/time (ISO 8601)' }, Notes: { type: 'string', description: 'Item notes' }, Name: { type: 'string', description: 'Item name' } }, required: ['CustomerId', 'AccountingCategoryId', 'Amount'] }, description: 'Array of accounting item objects to create' } }, required: ['AccountingItems'], additionalProperties: false },
- src/tools/index.ts:123-123 (registration)Registration of the addAccountingItemsTool in the allTools array, making it available for execution.addAccountingItemsTool,
- src/tools/index.ts:38-38 (registration)Import statement that brings the addAccountingItemsTool into the index file for registration.import { addAccountingItemsTool } from './finance/addAccountingItems.js';