post_vouchers_batches_by_id_reprint
Calls POST /api/vouchers/batches/{id}/reprint as the signed-in person · REST reference
Reprint every reprintable voucher of a physical batch
Carries out the plan GET /api/vouchers/batches/{id}/reprint describes, in ONE DAL transaction — every voucher it takes becomes VOIDED_REPRINTED and gets a replacement, or nothing does — then prints every replacement in one job, and an accepted print issues them. confirm must carry the voided and replaced counts the operator was shown: if the batch has changed since, nothing is reprinted (409 PLAN_CHANGED, naming the new counts). 409 NOTHING_TO_REPRINT when the plan takes nothing. The same money and expiry rules as a single reprint (POST /api/vouchers/{id}/reprint): replacing dead vouchers re-commits their value from the pool (400 when it cannot), a replacement of an EXPIRED or lapsed voucher gets a fresh 180-day term, and the reprint stands whatever the printer does. Only PHYSICAL batches; 503 PRINTER_NOT_CONFIGURED first on a server with no printer. Requires execute:CreateVoucherBatchCommand AND execute:RevokeVoucherCommand.
Arguments
| Argument | Type | Description | |
|---|---|---|---|
idpath | string (uuid) | required | Inventory batch id. |
bodyJSON | object | required | The request body, as a JSON object. Its fields are listed below. |
Fields of body
| Field | Type | Description | |
|---|---|---|---|
confirm | object | required | The counts the confirmation stated, from the plan the operator saw. |
confirm.replaced | integer | required | |
confirm.voided | integer | required | |
reason | string | Why the batch is reprinted — recorded as reprintReason on every voucher taken. |
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": "post_vouchers_batches_by_id_reprint",
"arguments": {
"id": "11111111-1111-4111-8111-111111111111",
"body": {
"confirm": {
"replaced": 1,
"voided": 1
},
"reason": "string"
}
}
}
}Result
On success (HTTP 201) the tool returns one text item holding the API's JSON, pretty-printed.
Reprinted. print is what the printer did with the replacements.
{
"batchId": "11111111-1111-4111-8111-111111111111",
"poolCommitted": 1,
"print": {
"status": "SUBMITTED",
"code": "PRINTER_UNREACHABLE",
"error": "string",
"jobId": 1,
"vouchers": 1
},
"replaced": 1,
"reprints": [
{
"replacement": {},
"voucher": {}
}
],
"voided": 1
}Fields
| Field | Type | Description |
|---|---|---|
batchId | string (uuid) | |
poolCommitted | integer | CENTS the replaced VOIDED/EXPIRED vouchers re-committed from the voucher pool. 0 when none was dead. |
print | object | |
print.code | "PRINTER_UNREACHABLE" | "PRINTER_AUTH_REJECTED" | "PRINTER_TLS_UNVERIFIED" | "PRINTER_REJECTED_JOB" | "PRINTER_NOT_CONFIGURED" | "PRINT_FAILED" | … (7 values) | Machine-readable reason for error. |
print.error | string | Curated and safe to show. On FAILED and NOT_CONFIGURED; on SUBMITTED only when the job was accepted but could not be recorded — its vouchers were then neither marked as sent nor issued. |
print.jobId | integer | The printer's job id, on SUBMITTED. |
print.status | "SUBMITTED" | "FAILED" | "NOT_REQUESTED" | "NOT_CONFIGURED" | SUBMITTED: the printer ACCEPTED the job (accepted, not paper confirmed), and the vouchers it carried are ISSUED — unless code is PRINT_STATUS_NOT_RECORDED. FAILED: nothing was printed or issued. NOT_REQUESTED: no print was asked for, or the batch is DIGITAL. NOT_CONFIGURED: a print was asked for and this server has no printer. |
print.vouchers | integer | How many vouchers the print covered. Absent when none was attempted. |
replaced | integer | VOIDED or EXPIRED vouchers replaced (now VOIDED_REPRINTED). |
reprints | array of object | Every reprinted voucher and the voucher minted to take its place. |
reprints[].replacement | object | |
reprints[].replacement.code | string | |
reprints[].replacement.expiresAt | integer | Epoch MILLISECONDS. |
reprints[].replacement.id | string (uuid) | |
reprints[].voucher | object | |
reprints[].voucher.code | string | |
reprints[].voucher.id | string (uuid) | |
voided | integer | Live vouchers taken out of circulation (now VOIDED_REPRINTED). |
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": "post_vouchers_batches_by_id_reprint",
"description": "POST /api/vouchers/batches/{id}/reprint — Carries out the plan `GET /api/vouchers/batches/{id}/reprint` describes, in ONE DAL transaction — every voucher it takes becomes VOIDED_REPRINTED and gets a replacement, or nothing does — then prints every replacement in one job, and an accepted print issues them. `confirm` must carry the `voided` and `replaced` counts the operator was shown: if the batch has changed since, nothing is reprinted (409 `PLAN_CHANGED`, naming the new counts). 409 `NOTHING_TO_REPRINT` when the plan takes nothing. The same money and expiry rules as a single reprint (`POST /api/vouchers/{id}/reprint`): replacing dead vouchers re-commits their value from the pool (400 when it cannot), a replacement of an EXPIRED or lapsed voucher gets a fresh 180-day term, and the reprint stands whatever the printer does. Only PHYSICAL batches; 503 `PRINTER_NOT_CONFIGURED` first on a server with no printer. Requires `execute:CreateVoucherBatchCommand` AND `execute:RevokeVoucherCommand`.\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": "Inventory batch id."
},
"body": {
"type": "string",
"description": "The JSON request body: { confirm*: { replaced*: integer; voided*: integer } (The counts the confirmation stated, from the plan the operator saw.); reason: string (Why the batch is reprinted — recorded as `reprintReason` on every voucher taken.) }"
}
},
"required": [
"id",
"body"
]
},
"annotations": {
"readOnlyHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": false
}
}