Mutate worksheet line items in a batch
Adds, updates, removes, and reorders the worksheet's line items in a single atomic diff, then returns the full worksheet with recomputed totals and the updated line_items array. The top-level worksheet PATCH is metadata-only; all line-item mutation flows through this endpoint.
Operations (all arrays optional; empty body is a no-op): add creates new lines, update replaces an existing line's fields by id, remove deletes lines by id, reorder sets the position of existing untouched lines. An id may appear in at most one of remove/update/reorder.
Update is remove+add internally so article inventory stock reconciles through the normal path; an updated line therefore receives a NEW id in the response — re-read ids from the returned line_items rather than assuming stability.
tax_rate is server-resolved from each line's vat_code; clients never send rates or totals.
Frozen worksheets — blocked when the worksheet's linked invoice has been issued (mutating lines would desync invoice totals). Returns 409 conflict.
Request
- Base URL: https://api.officina.it
- URL: https://api.officina.it/v1/worksheets/{id}/line-items/batch
- Auth: HTTP bearer
Request body
Response
Batch applied. Returns the updated worksheet (with line_items).
Example response
{
"id": "a5d21e64-8f37-4b90-ae12-3c7d6b048f95"
}Changes
No recorded changes to this operation across all 1 revision of this API.