Cancel invoice

Cancel a stamped invoice or credit note with the SAT.

POST https://cotlet.dev/api/v1/facturama/invoices/{invoice_id}/cancel

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

Parameters: cancel_invoice
NameTypeDescription
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.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/facturama/invoices/invoice_8c41d2/cancel \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason":"reason"}'
Python
result = client.call("facturama", "cancel_invoice", {"invoice_id":"invoice_8c41d2","reason":"reason"})
Node.js
const result = await cotlet.call('facturama', 'cancel_invoice', {"invoice_id":"invoice_8c41d2","reason":"reason"});
CLI
cotlet call facturama cancel_invoice --data '{"invoice_id":"invoice_8c41d2","reason":"reason"}'

Example response

JSON

{
  "invoice_id": "Y61TLX-Ls_ZJFqzjanPN1w2",
  "series": "FAC",
  "folio": "99",
  "status": "cancel_requested"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.