pohoda_delete_invoice
Remove invoices from POHODA accounting software by specifying the invoice ID. This tool helps maintain accurate financial records by deleting specific invoices when needed.
Instructions
Delete an invoice from POHODA by ID. Requires the invoice ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Invoice ID to delete (required) |
Implementation Reference
- src/tools/invoices.ts:167-189 (handler)The implementation of the `pohoda_delete_invoice` tool. It constructs an XML request to delete an invoice by its ID and handles the response.
server.tool( "pohoda_delete_invoice", "Delete an invoice from POHODA by ID. Requires the invoice ID.", { id: z.number().describe("Invoice ID to delete (required)"), }, async (params) => { try { const xml = buildImportDoc({ ico: client.ico }, (item) => { const inv = item.ele(NS.inv, "inv:invoice").att("version", "2.0"); const actionType = inv.ele(NS.inv, "inv:actionType"); const del = actionType.ele(NS.inv, "inv:delete"); const filter = del.ele(NS.ftr, "ftr:filter"); filter.ele(NS.ftr, "ftr:id").txt(String(params.id)); }); const response = await client.sendXml(xml); const result = extractImportResult(parseResponse(response)); return result.success ? ok(`Invoice deleted successfully. ${result.message}`) : err(result.message); } catch (e) { return err((e as Error).message); } } );