pohoda_delete_order
Delete an order from POHODA accounting software by specifying its ID. This tool removes order records to maintain accurate data management.
Instructions
Delete an order from POHODA by ID. Requires the order ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Order ID to delete (required) |
Implementation Reference
- src/tools/orders.ts:157-179 (handler)The handler and registration logic for the 'pohoda_delete_order' tool. It uses buildImportDoc to create a deletion XML request containing an actionType set to 'delete' and a filter with the ID, then sends it to the POHODA client.
server.tool( "pohoda_delete_order", "Delete an order from POHODA by ID. Requires the order ID.", { id: z.number().describe("Order ID to delete (required)"), }, async (params) => { try { const xml = buildImportDoc({ ico: client.ico }, (item) => { const ord = item.ele(NS.ord, "ord:order").att("version", "2.0"); const actionType = ord.ele(NS.ord, "ord:actionType"); const del = actionType.ele(NS.ord, "ord: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(`Order deleted successfully. ${result.message}`) : err(result.message); } catch (e) { return err((e as Error).message); } } );