Facturama automation
Issue Facturama credit notes for returns and discounts
A client returns part of an order or you agree a discount after invoicing, and the original invoice stays as it is, so a credit note has to correct the amount.
Cotlet does it in your own Facturama account with get_invoice, create_credit_note and email_invoice, called by your AI agent, an n8n workflow or a script.
Hosted · nothing to install or maintain
Can Facturama do this on its own?
Facturama documents credit notes in its API, and issuing them there needs the API module and API folios (checked 14 Oct 2026). The API page does not list the fields, and Facturama has no MCP server to do it from an agent.
How you do it in Facturama today
- You sign in to Facturama in the browser and find the invoice the credit note belongs to.
- You issue a CFDI de egreso, the credit note, which Facturama describes as the document for returns, discounts and bonuses.
- You enter the amount to credit and Facturama stamps it like any other CFDI.
- You send the credit note to the client by email and download its PDF and XML.
- You check by eye that the credit fits the invoice it corrects.
How to issue Facturama credit notes for returns and discounts
Client Estudio Norte returned one hour of work on invoice FAC-101. Issue a credit note for 500 pesos plus IVA against that invoice and email it to them. - 01
Read the original invoice
get_invoice returns the stamped total, the lines and the UUID of the invoice you name. The agent stops if that invoice is cancelled or not found.
- 02
Compare the credit with the invoice
The agent checks that the amount you ask to credit, plus IVA, is not above the invoice total, and reports the maximum if it is.
- 03
Show the amounts before stamping
You see subtotal, IVA and total of the credit note before create_credit_note runs, because a stamped CFDI is a legal tax act.
- 04
Stamp and report
create_credit_note issues the CFDI de egreso related to the invoice and returns its series, folio and UUID.
- 05
Send it to the same client
email_invoice sends the credit note to the address on the original invoice unless you name another.
What you get back
Original: FAC-101, total 1,160.00 MXN
Credit note: NC-12, 500.00 + IVA 80.00 = 580.00 MXN
Remaining on FAC-101 after credit: 580.00 MXN
Emailed to: billing@estudionorte.example Other ways to ask
- Credit Estudio Norte 10 percent on invoice FAC-101 as a discount and show me the amounts first.
- List the credit notes I issued this month and the invoices they relate to.
- Issue credit notes for these three returns from my sheet, one per invoice, and email the clients.
What Facturama allows, and what to know first
- A CFDI de egreso, also called a credit note, covers returns, discounts and bonuses (Facturama).
- A credit note is tied to an Ingreso invoice and reduces the amount of the invoice it corrects.
- Issuing CFDI through the API needs the API module and prepaid API folios; the web app uses your invoicing folios.
- A credit note is stamped like an invoice, so it is a legal tax act and cannot be edited afterwards.
create_credit_note and email_invoice ask for your OK by default. To run it on a schedule without you, switch confirmation off for those tools in your dashboard.
Sources: Facturama: credit note API · Facturama: plans and prices · Facturama docs: first invoice
Call create_credit_note from a script
curl -X POST https://cotlet.dev/api/v1/facturama/invoices/Y61TLX-Ls_ZJFqzjanPN1w2/credit-notes \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"items":[{"description":"Returned: design review hour","quantity":1,"unit_price":500,"tax_rate":0.16}]}' {
"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"
} MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is facturama_write → create_credit_note. Example data.
Schedule it in n8n, Make, Zapier or cronFacturama tools this automation uses
| Tool | Parameters |
|---|---|
| get_invoice | invoice_id |
| create_credit_note | invoice_id, items, series |
| email_invoice | invoice_id, emails |
Frequently asked questions
Is it safe to connect Facturama to Cotlet?
Yes. You sign in to Facturama yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Facturama once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.
Give your agent access to Facturama.
Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Facturama.