addPayment
Add a payment to a customer's bill in the Mews MCP server by specifying the customer ID, payment amount, and method. Integrates with the Mews hospitality platform for financial transactions.
Instructions
Adds a new payment to a customer's bill
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Amount | Yes | Payment amount object | |
| BillId | No | Specific bill ID to apply payment to | |
| ConsumedUtc | No | Payment consumption date/time (ISO 8601) | |
| CustomerId | Yes | Customer ID for the payment | |
| Notes | No | Payment notes | |
| PaymentMethodId | Yes | Payment method identifier |
Implementation Reference
- src/tools/payments/addPayment.ts:45-58 (handler)The execute function implementing the core logic of the addPayment tool. It spreads the input arguments into a requestData object and calls the Mews API endpoint '/api/connector/v1/payments/add' using the mewsRequest utility, then returns the JSON-stringified result.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/payments/add', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema for the addPayment tool, specifying an object with properties CustomerId, BillId (optional), Amount (required object with Currency and Value), PaymentMethodId, Notes, ConsumedUtc; requires CustomerId, Amount, PaymentMethodId.inputSchema: { type: 'object', properties: { CustomerId: { type: 'string', description: 'Customer ID for the payment' }, BillId: { type: 'string', description: 'Specific bill ID to apply payment to' }, Amount: { type: 'object', properties: { Currency: { type: 'string', description: 'Payment currency code' }, Value: { type: 'number', description: 'Payment amount value' } }, required: ['Currency', 'Value'], description: 'Payment amount object' }, PaymentMethodId: { type: 'string', description: 'Payment method identifier' }, Notes: { type: 'string', description: 'Payment notes' }, ConsumedUtc: { type: 'string', description: 'Payment consumption date/time (ISO 8601)' } }, required: ['CustomerId', 'Amount', 'PaymentMethodId'], additionalProperties: false },
- src/tools/index.ts:126-126 (registration)Includes addPaymentTool in the central allTools array, which serves as the registry of all MCP tools.addPaymentTool,
- src/tools/index.ts:41-41 (registration)Imports the addPaymentTool from its dedicated implementation file for inclusion in the tools registry.import { addPaymentTool } from './payments/addPayment.js';