Skip to Content
v1.5Official documentation for the LX CloudPos API · stable in production

Issue an ND

Case: a customer has fallen behind on payment, and you need to charge interest on an already-accepted invoice. The Debit Note (ND) references the original FE and adds an extra charge.

For the ND to be valid, the product that charges the interest (in the example, idProducto: 999) must be registered in the catalog, ideally as “Late-payment interest” or equivalent.

{ "tipo": "NotaDebito", "idUsuario": 7, "cliente": { "idCliente": 42 }, "condicionVenta": "01", "medioPago": "01", "moneda": "CRC", "lineas": [ { "idProducto": 999, "cantidad": 1, "precioUnitario": 5000.00 } ], "referencias": [ { "tipoDocumento": "01", "numero": "<clave_factura_original>", "codigo": "10", "razon": "Cargo por interés moratorio 30 días" } ] }

The reason code

10 is financial debit note: the code for interest, late fees, and additional charges. 04 (reference to another document) is also valid as a generic link.

Don’t use 01 on an ND unless that’s exactly what you want: besides declaring that the note voids the referenced document, 01 is the only code with which a debit note deducts inventory.

The code goes in codigo or razon, either works. A reference with only free text in both fields is rejected with 400. See reference code.

Charge price

The example sends precioUnitario because the interest amount is calculated externally and doesn’t come from the catalog. This is the recommended approach for an ND.

If precioUnitario is omitted, the product’s list price is used — converted to the note’s currency if the catalog is written in a different one. See multi-currency.

Currency

The ND inherits the currency and exchange rate from the document it references, even if the request sends different ones. Hacienda requires them to match and rejects the document if they don’t (errors -510 and -511).

The product 999 from the example must already exist in the catalog. If it isn’t registered yet, create it before trying to issue the ND.