Create credit note

Issue and stamp a credit note (CFDI de egreso) against one invoice.

POST https://cotlet.dev/api/v1/facturama/invoices/{invoice_id}/credit-notes

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

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

Request

cURL
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}]}'
Python
result = client.call("facturama", "create_credit_note", {"invoice_id":"Y61TLX-Ls_ZJFqzjanPN1w2","items":[{"description":"Returned: design review hour","quantity":1,"unit_price":500,"tax_rate":0.16}]})
Node.js
const result = await cotlet.call('facturama', 'create_credit_note', {"invoice_id":"Y61TLX-Ls_ZJFqzjanPN1w2","items":[{"description":"Returned: design review hour","quantity":1,"unit_price":500,"tax_rate":0.16}]});
CLI
cotlet call facturama create_credit_note --data '{"invoice_id":"Y61TLX-Ls_ZJFqzjanPN1w2","items":[{"description":"Returned: design review hour","quantity":1,"unit_price":500,"tax_rate":0.16}]}'

Example response

JSON

{
  "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"
}

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.