Create credit note
Issue and stamp a credit note (CFDI de egreso) against one invoice.
MCP tool facturama_write → create_credit_note
write Confirm
Issues a CFDI de egreso related to the invoice you name, for a return, a discount or a bonus, and stamps it with the SAT. Returns its invoice_id, series, folio, UUID and totals. The credit is final once the call succeeds. It does not email the note: use email_invoice for that. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| invoice_id string required | string | The invoice the credit note corrects, from list_invoices. |
| items array required | array | Credited lines. Each has description, quantity, unit_price and tax_rate. |
| series string | string | Series of the credit note. Default: your default series. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "facturama_write",
"arguments": {
"operation": "create_credit_note",
"arguments": {
"invoice_id": "Y61TLX-Ls_ZJFqzjanPN1w2",
"items": [
{
"description": "Returned: design review hour",
"quantity": 1,
"unit_price": 500,
"tax_rate": 0.16
}
]
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"invoice_id": "Zq8RkV-aT2mNpLw4xYb7Hc1",
"series": "NC",
"folio": "12",
"uuid": "0b7d44e1-92af-4c36-8d10-5ea7c3f19b02",
"cfdi_type": "egreso",
"status": "issued",
"related_invoice_id": "Y61TLX-Ls_ZJFqzjanPN1w2",
"items": [
{
"description": "Returned: design review hour",
"quantity": 1,
"unit_price": 500,
"subtotal": 500,
"tax_rate": 0.16,
"tax": 80,
"total": 580
}
],
"subtotal": 500,
"tax_total": 80,
"total": 580,
"currency": "MXN"
},
"isError": false
}