delete_vouchers_batches_by_id
Calls DELETE /api/vouchers/batches/{id} as the signed-in person · REST reference
Delete a voucher batch, releasing its vouchers first
Resizes the batch to zero — voiding every voucher in it and crediting their value back to the holder's allocation — and then soft-deletes it. A batch any of whose vouchers has been ISSUED or gone further cannot be deleted: the resize is refused with 409 naming the lowest quantity it can be shrunk to, and nothing is voided or deleted. Two DAL writes: if the soft-delete fails after the release, the batch is left empty and a retry completes it. Requires execute:CreateVoucherBatchCommand, as the resize does.
Arguments
| Argument | Type | Description | |
|---|---|---|---|
idpath | string (uuid) | required | Batch id. |
Example call
A client sends this over the MCP session; Claude and other agents build it for you. The values are placeholders — the shape is real.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "delete_vouchers_batches_by_id",
"arguments": {
"id": "11111111-1111-4111-8111-111111111111"
}
}
}Result
On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.
The batch's vouchers were released and the batch soft-deleted.
{
"allocationCredited": 1,
"allocationDebited": 1,
"batchId": "11111111-1111-4111-8111-111111111111",
"previousQuantity": 1,
"quantity": 1,
"vouchersMinted": 1,
"vouchersReleased": 1,
"deleted": true,
"assignedTo": "11111111-1111-4111-8111-111111111111"
}Fields
| Field | Type | Description |
|---|---|---|
allocationCredited | integer | CENTS returned to the holder's allocation by a shrink. |
allocationDebited | integer | CENTS drawn from the holder's allocation by a grow. |
assignedTo | string (uuid) | null | |
batchId | string (uuid) | |
previousQuantity | integer | |
quantity | integer | |
vouchersMinted | integer | Vouchers a grow minted (CREATED). 0 for a shrink. |
vouchersReleased | integer | Vouchers a shrink voided. 0 for a grow. |
deleted | true |
When it fails
A failed call returns isError: true with the API's message as text. A change the person declines, or lets time out, also comes back this way and nothing changes.
400The request was malformed or failed a guard.
403Authenticated, but the caller holds none of the required permissions.
404No such resource — or none this caller may see.
409The resource is not in a state that allows this operation.
What the model is shown
This is the tool exactly as the server lists it in tools/list. The description starts with the REST call it makes.
{
"name": "delete_vouchers_batches_by_id",
"description": "DELETE /api/vouchers/batches/{id} — Resizes the batch to zero — voiding every voucher in it and crediting their value back to the holder's allocation — and then soft-deletes it. A batch any of whose vouchers has been ISSUED or gone further cannot be deleted: the resize is refused with 409 naming the lowest quantity it can be shrunk to, and nothing is voided or deleted. Two DAL writes: if the soft-delete fails after the release, the batch is left empty and a retry completes it. Requires `execute:CreateVoucherBatchCommand`, as the resize does.\n\nThis changes data. The person is asked to confirm it before it runs, and nothing happens if they decline.",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Batch id."
}
},
"required": [
"id"
]
},
"annotations": {
"readOnlyHint": false,
"destructiveHint": true,
"idempotentHint": true,
"openWorldHint": false
}
}