0.8.0
What's Changed
unitPriceon a product — the price of one unit, besideamount, the line's gross total
Why
amount has always been the line's gross total, but a reader sees quantity: 2.0, amount: 120.00 and expects R$ 240,00. The API answered R$ 120,00, and the mistake only surfaced on an authorized document. There was no field that meant "what one unit costs", so the API derived it by dividing — in float, at the tenth decimal place the SEFAZ reads.
new Product(
description: 'Teclado',
quantity: 2.0,
unitPrice: 120.00,
unit: 'UN',
ncm: '84716052',
cfop: '5102',
);Send unitPrice or amount. Sending both asserts they agree: the API compares quantity x unit_price against amount and refuses the document before transmission if they differ, naming the line and both numbers.
Both now travel as strings on the wire, so a ten-place unit price reaches the API exactly as typed. amount became optional and unitPrice was added last in the constructor, so no positional or named argument moved.
amount keeps the meaning it always had and is not deprecated — nothing has to migrate.