siigo_create_credit_note
Generate credit notes in Siigo accounting software to document refunds, returns, or billing adjustments for Colombian businesses.
Instructions
Create a new credit note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| creditNote | Yes | Credit note data |
Implementation Reference
- src/siigo-client.ts:137-139 (handler)Core tool implementation: makes authenticated POST request to Siigo API /v1/credit-notes endpoint to create a credit note.async createCreditNote(creditNote: any): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('POST', '/v1/credit-notes', creditNote); }
- src/index.ts:986-989 (handler)MCP server handler wrapper: extracts args.creditNote, calls SiigoClient.createCreditNote, and returns JSON-formatted response.private async handleCreateCreditNote(args: any) { const result = await this.siigoClient.createCreditNote(args.creditNote); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:468-478 (registration)Tool registration in getTools(): defines name, description, and input schema for MCP ListTools.{ name: 'siigo_create_credit_note', description: 'Create a new credit note', inputSchema: { type: 'object', properties: { creditNote: { type: 'object', description: 'Credit note data' }, }, required: ['creditNote'], }, },
- src/index.ts:471-477 (schema)Input schema validation for the tool arguments.inputSchema: { type: 'object', properties: { creditNote: { type: 'object', description: 'Credit note data' }, }, required: ['creditNote'], },
- src/siigo-client.ts:41-59 (helper)Helper method used by all API calls: handles authentication, makes axios request, 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}`); } }