Sync PO Prices Bulk
POST/api/purchase-invoices/:purchaseInvoice/sync-po-prices
Sync PO line prices from many invoice lines on a single invoice in one request, then re-evaluate the invoice's approval status once at the end.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Use this from the 3-Way Match view when several lines have confirmed price variances. Each invoice line is processed individually using the same logic as POST /api/purchase-invoices/:purchaseInvoice/lines/:purchaseInvoiceLine/sync-po-price, and the final results are returned keyed by purchase_invoice_line_id. Works on both open and closed POs.
Authentication: Requires Bearer token.
Request body fields:
- purchase_invoice_line_ids (integer[], required, min 1): IDs of invoice lines to sync. Each must belong to this purchase invoice (validated via Rule::exists with where purchase_invoice_id).
- notes (string, optional, max 1000): free-text justification stored on each activity log entry.
Per-line result statuses (same as single endpoint):
- updated: PO line amount changed; old_amount and new_amount are returned.
- unchanged: PO line amount already matched invoice line unit price.
- skipped: nothing was done; reason is one of 'invoice line not found on this invoice', 'invoice line not linked to a PO line', 'invoice line has no unit price'.
The top-level message summarises counts (e.g. 'Synced 2 line(s); 1 unchanged; 0 skipped.').
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.