Overview
Invoice endpoints mounted at /invoices.
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.
Line items in invoice responses return quantity as a number, unit when the line has one, and the sku of the item the line is tied to.
Promotions and loyalty points
Send incentives on create or update to apply promotions and redeem loyalty points. You only name what to apply; every amount is calculated by the server.
Each promotion and the loyalty redemption come back as an entry in adjustments, marked by promotion_id, code_used or loyalty_points, and each line reports its share of the discount in discount.
Updating adjustments and incentives
On PATCH /invoices/{id} manual adjustments and incentives are replaced independently of each other.
Payment terms
An invoice 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. is_overdue follows the instalments: it is true once any instalment is past due and not fully covered by total_paid.
On PATCH /invoices/{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 invoice date or the total recalculates the schedule from the term already on the invoice.

