create_payment
Record payments for work orders in Shopmonkey by specifying amount, method, and order ID to track financial transactions.
Instructions
Record a new payment in Shopmonkey.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Work order ID to apply the payment to | |
| amount | Yes | Payment amount in dollars | |
| method | No | Payment method (e.g., cash, credit_card, check) | |
| notes | No | Additional notes about the payment |
Implementation Reference
- src/tools/payments.ts:70-76 (handler)The handler function that executes the 'create_payment' tool logic by sending a POST request to the '/payment' endpoint.
async create_payment(args) { if (!args.orderId) return { content: [{ type: 'text', text: 'Error: orderId is required' }], isError: true }; if (args.amount === undefined) return { content: [{ type: 'text', text: 'Error: amount is required' }], isError: true }; const body = pickFields(args, CREATE_FIELDS); const data = await shopmonkeyRequest<Payment>('POST', '/payment', body); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/payments.ts:27-39 (schema)The definition and input schema for the 'create_payment' tool.
name: 'create_payment', description: 'Record a new payment in Shopmonkey.', inputSchema: { type: 'object' as const, properties: { orderId: { type: 'string', description: 'Work order ID to apply the payment to' }, amount: { type: 'number', description: 'Payment amount in dollars' }, method: { type: 'string', description: 'Payment method (e.g., cash, credit_card, check)' }, notes: { type: 'string', description: 'Additional notes about the payment' }, }, required: ['orderId', 'amount'], }, },