Skip to main content

Settle PO Line Billing (Final Invoice)

POST 

/api/purchase-order-lines/:purchase_order_line/settle-billing

Mark a PO line as billing-settled — the SAP EREKZ "final invoice" axis. A billing-settled line counts as fully invoiced for reconciliation regardless of any residual short-billed quantity; use it when the supplier confirms this is the final bill for the line even though it was under-billed.

Required scope: purchase-orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token. Requires the purchase_orders.update permission.

Request body fields:

  • reason (optional, nullable, string, max 500): free-text note recorded on the settlement and shown in the audit trail.

Stamps billing_settled_at, billing_settled_reason, and billing_settled_by (the acting user) on the line, then re-derives the parent purchase order's invoice_status.

Validation errors (422, DomainException): returned when the line cannot be settled — e.g. it is already billing-settled, or it is already fully invoiced through quantity/credit so settlement is unnecessary.

Returns the updated PurchaseOrderLine billing-settlement view (eager-loaded with billingSettledBy and purchaseOrder).

Request

Responses

Created