delete_vouchers_batches_by_id

Changes data · you confirm first Idempotent

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

ArgumentTypeDescription
idpathstring (uuid)requiredBatch 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.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "delete_vouchers_batches_by_id",
    "arguments": {
      "id": "11111111-1111-4111-8111-111111111111"
    }
  }
}
Confirmation
The client shows the person the exact request and waits. Nothing runs until they tick Make this change. See Reading and changing.

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.

json
{
  "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

FieldTypeDescription
allocationCreditedintegerCENTS returned to the holder's allocation by a shrink.
allocationDebitedintegerCENTS drawn from the holder's allocation by a grow.
assignedTostring (uuid) | null
batchIdstring (uuid)
previousQuantityinteger
quantityinteger
vouchersMintedintegerVouchers a grow minted (CREATED). 0 for a shrink.
vouchersReleasedintegerVouchers a shrink voided. 0 for a grow.
deletedtrue

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.

400

The request was malformed or failed a guard.

403

Authenticated, but the caller holds none of the required permissions.

404

No such resource — or none this caller may see.

409

The 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.

json
{
  "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
  }
}