Line item sections for projects, invoices, and bills
Line items can now be grouped into named sections — the same grouping you see on quotes and in the Coperniq UI — across project line items, invoices, and bills.
Sections on write
PUT /projects/{projectId}/line-items, POST/PATCH /invoices, and POST/PATCH /bills accept a sections array alongside (or instead of) lineItems:
lineItemsandsectionsmay be combined in one request: top-levellineItemsstay ungrouped,sectionscarry named groups.- A section’s
namemay be omitted ornullfor an unnamed group. - A
catalogItemIdmay appear at most once across the flattened set (lineItems+ every section’s items); duplicates are rejected with400.
Section name on read
Every line item in project, invoice, bill, and quote responses now includes sectionName — the name of the section the item belongs to, or null when the item is ungrouped. (sectionId is not returned; replacing all line items is the only update path, so the name is the grouping signal.)
Invoice creation: status and issueDate
statusis now optional and defaults toDRAFT;issueDateis now optional. Omit both to create a draft invoice.- A finalized status (
SENT,PARTIALLY_PAID,PAID) requires anissueDate. AnissueDatewithout a finalized status is ignored (the invoice is created as a draft). - Lifecycle statuses (
DECLINED,OVERDUE) cannot be set at creation and are rejected with400. descriptionis fully optional — invoice creation no longer fails when it is omitted.
Invoice updates: calculationMethod is fixed at creation
PATCH /invoices/{invoiceId} no longer accepts calculationMethod (matching bills, where this was already the case). Sending it returns 400. percentage cannot be combined with lineItems/sections in the same update.
Validation tightening
calculationMethod: PERCENTAGEinvoices and bills now rejectlineItems(previously they were silently ignored), in addition to the existingsectionsrejection.PUT /projects/{projectId}/line-itemsvalidation errors now surface the specific problem (e.g. the duplicate-catalog-item message) instead of a generic “Invalid input”.
Deprecation
Passing a bare top-level array of line items to PUT /projects/{projectId}/line-items is deprecated. It is still accepted for backwards compatibility but will not be supported in a future version — use the object form with lineItems and/or sections.
