Overview
Bill endpoints mounted at /bills.
Quantities and units
quantity on a line item accepts fractional values, and a line can carry a unit. What is accepted depends on whether the line is tied to an inventory item through sku.
Selling units are EACH, G, KG, OZ, LB, ML, L, FL_OZ, CM, M, IN, FT and YD. A sku that matches no inventory item is rejected with 404.
Billing in a different unit
When a vendor bills in a unit other than the one you stock, send that unit with unit_factor, the number of stock units one billed unit holds. rate is the price of one billed unit, and quantity multiplied by unit_factor is the stock quantity the line represents. unit_factor is treated as 1 when omitted.
This line bills 2 cartons at 6,000.00 each and represents 24 units of stock.
Line items in responses
Each line item in a bill response returns quantity as a number, unit and unit_factor when the line has them, and the sku of the inventory item the line is tied to. sku is empty for lines created without one.
Money values come back as decimal strings: rate, amount and vat on line items, and value and amount on adjustments. Requests send them as numbers.
Payment terms
A bill falls due either on a fixed due_date or on a payment term. Send payment_term_id on create or update to apply a term from /configs/payment-terms.
When a term is applied, the response carries payment_schedule with each instalment’s due date and amount and any early-payment discount, and due_date is the final due date.
On PATCH /bills/{id}, payment_term_id rebuilds the schedule from that term. A due_date different from the current one replaces the term with that fixed date and clears payment_schedule. Changing the bill date or the total recalculates the schedule from the term already on the bill.

