Create Credit Note
create_credit_noteGenerate a credit note to reverse an existing invoice: creates VeriFactu-compliant rectificativas for Spain or standard credit notes with negative amounts for other markets.
Instructions
Create a credit note (factura rectificativa) for an existing invoice. This reverses all or part of an invoice for compliance. Spanish market: generates VeriFactu-compliant R1-R5 rectificativa. Other markets: standard credit note with negative amounts. / Crea una factura rectificativa para una factura existente. Mercado espanol: genera rectificativa R1-R5 conforme a VeriFactu. Otros mercados: nota de credito estandar con importes negativos.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoiceId | Yes | ID of the original invoice to credit / ID de la factura original a rectificar | |
| reason | Yes | Reason for the credit note. Maps to Spanish R-types: error→R1 (art. 80.1), refund/discount/cancellation/other→R4 / Motivo de la rectificacion. error→R1, resto→R4 | |
| reasonDescription | No | Optional free-text description of the reason / Descripcion libre del motivo | |
| fullCredit | No | true = full credit (tipo S, sustitucion), false = partial (tipo I, diferencias). Default: true / true = abono total (tipo S), false = parcial (tipo I). Por defecto: true | |
| issueDate | No | ISO date for the credit note (YYYY-MM-DD). Defaults to today. / Fecha de emision (YYYY-MM-DD). Por defecto hoy. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| clientName | Yes | ||
| items | Yes | ||
| issueDate | No | ||
| dueDate | No | ||
| status | No | ||
| notes | No | ||
| taxRate | No | ||
| total | No | ||
| createdAt | No | ||
| updatedAt | No |