list_payments
Retrieve payment records from Shopmonkey with filtering by work order or location and pagination controls for efficient data management.
Instructions
List payments from Shopmonkey. Supports filtering and pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | No | Filter payments by work order ID | |
| locationId | No | Filter by location ID. Defaults to SHOPMONKEY_LOCATION_ID env var if set. | |
| limit | No | Maximum number of results to return (default: 25) | |
| page | No | Page number for pagination (default: 1) |
Implementation Reference
- src/tools/payments.ts:52-62 (handler)The implementation of the `list_payments` tool handler. It parses arguments, applies default location settings, makes a request to the Shopmonkey API, and returns the formatted response.
async list_payments(args) { const params: Record<string, string> = {}; if (args.orderId !== undefined) params.orderId = String(args.orderId); if (args.locationId !== undefined) params.locationId = String(args.locationId); if (args.limit !== undefined) params.limit = String(args.limit); if (args.page !== undefined) params.page = String(args.page); applyDefaultLocation(params); const data = await shopmonkeyRequest<Payment[]>('GET', '/payment', undefined, params); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/payments.ts:8-20 (schema)The schema definition for `list_payments` in the `definitions` array, describing the tool's input parameters and functionality.
{ name: 'list_payments', description: 'List payments from Shopmonkey. Supports filtering and pagination.', inputSchema: { type: 'object' as const, properties: { orderId: { type: 'string', description: 'Filter payments by work order ID' }, locationId: { type: 'string', description: 'Filter by location ID. Defaults to SHOPMONKEY_LOCATION_ID env var if set.' }, limit: { type: 'number', description: 'Maximum number of results to return (default: 25)' }, page: { type: 'number', description: 'Page number for pagination (default: 1)' }, }, }, },