siigo_create_payment_receipt
Generate payment receipts in Siigo accounting software to record customer payments and maintain accurate financial records.
Instructions
Create a new payment receipt
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paymentReceipt | Yes | Payment receipt data |
Implementation Reference
- src/index.ts:1041-1044 (handler)MCP tool handler for 'siigo_create_payment_receipt'. Extracts args.paymentReceipt, calls SiigoClient.createPaymentReceipt, and returns the result as JSON text content.private async handleCreatePaymentReceipt(args: any) { const result = await this.siigoClient.createPaymentReceipt(args.paymentReceipt); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/siigo-client.ts:184-186 (helper)SiigoClient method that performs the POST request to Siigo API endpoint /v1/payment-receipts to create the payment receipt.async createPaymentReceipt(paymentReceipt: any): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('POST', '/v1/payment-receipts', paymentReceipt); }
- src/index.ts:596-606 (registration)Tool registration in getTools(): defines name, description, and input schema for the tool.{ name: 'siigo_create_payment_receipt', description: 'Create a new payment receipt', inputSchema: { type: 'object', properties: { paymentReceipt: { type: 'object', description: 'Payment receipt data' }, }, required: ['paymentReceipt'], }, },
- src/index.ts:131-132 (handler)Dispatch case in CallToolRequestSchema handler that routes to the specific tool handler.case 'siigo_create_payment_receipt': return await this.handleCreatePaymentReceipt(args);
- src/siigo-client.ts:41-58 (helper)Core helper method in SiigoClient that handles authentication, makes Axios requests to Siigo API, and processes responses/errors.private async makeRequest<T>(method: string, endpoint: string, data?: any, params?: any): Promise<SiigoApiResponse<T>> { await this.authenticate(); try { const response: AxiosResponse<SiigoApiResponse<T>> = await this.httpClient.request({ method, url: endpoint, data, params, }); return response.data; } catch (error: any) { if (error.response?.data) { return error.response.data; } throw new Error(`API request failed: ${error.message}`); }