FE with discounts
Discounts are applied per line, not as a total for the whole document. Each line declares the montoDescuento (in the document’s currency) and the naturalezaDescuento, which is the text Hacienda (Costa Rica’s tax authority) requires to justify it.
{
"tipo": "FacturaElectronica",
"idUsuario": 7,
"cliente": { "idCliente": 42 },
"condicionVenta": "01",
"medioPago": "01",
"moneda": "CRC",
"lineas": [
{
"idProducto": 100,
"cantidad": 10,
"precioUnitario": 5000.00,
"montoDescuento": 5000.00,
"naturalezaDescuento": "Descuento por volumen 10%"
},
{
"idProducto": 101,
"cantidad": 1,
"precioUnitario": 15000.00,
"montoDescuento": 1500.00,
"naturalezaDescuento": "Cliente frecuente"
}
]
}The
montoDescuentois an absolute value, not a percentage. To apply a 10% discount onprecioUnitario × cantidad, the calculation must be done on the integrator’s side and the result sent.