Cancel invoice
Cancel a stamped invoice or credit note with the SAT.
MCP tool facturama_write → cancel_invoice
write Confirm
Asks the SAT to cancel one stamped document and returns its new status. The cancellation reason is the code the SAT asks for. A cancellation cannot be undone from here. Fails with a not-found error when the ID does not exist. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| invoice_id string required | string | Invoice ID from list_invoices or create_invoice. |
| reason string required | string | The SAT cancellation reason code Facturama asks for. |
| replacement_uuid string | string | UUID of the invoice that replaces this one, when the reason needs one. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "facturama_write",
"arguments": {
"operation": "cancel_invoice",
"arguments": {
"invoice_id": "invoice_8c41d2",
"reason": "reason"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"invoice_id": "Y61TLX-Ls_ZJFqzjanPN1w2",
"series": "FAC",
"folio": "99",
"status": "cancel_requested"
},
"isError": false
}