Variance Resolution Preview
GET/api/purchase-invoices/:purchaseInvoice/variance-resolution-preview
Preview the over-billed quantities per purchase order line on a bill, to fill in a 'resolve with vendor credit' request.
purchase-orders:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
A PO line is over-billed when the quantity billed on it across all of its bills, less every quantity already credited against it, is more than its effective ordered quantity (the ordered quantity, or the short-closed quantity when the line was short-closed). The over-billed quantity reported for this bill is capped at what this bill still bills on the line (its lines for that PO line less credits already allocated to this bill), because a credit resolving this bill can only take back units this bill charged. For example, a line ordered at 40 and billed 16 + 30 on two bills is 6 over on either bill. When a bill carries several lines for the same PO line they are combined into one entry.
The suggested credit quantity is exactly the over-billed quantity. The suggested credit amount is over_billed_quantity * unit_price (invoice unit price, falling back to the PO line price).
Response fields:
invoice_id,purchase_order_id,supplier_id,currency_id,currency_codehas_over_bills: true if any line has over-billed quantitytotal_suggested_credit: sum ofsuggested_credit_amountacross over-billed lineslines[]: only includes lines with over-billed quantity. Each line haspurchase_invoice_line_id,purchase_order_line_id,product_id,sku,product_name,quantity_invoiced(billed on this bill),quantity_invoiced_on_purchase_order_line(billed on the PO line across all of its bills),effective_ordered_quantity,received_quantity,already_credited,over_billed_quantity,suggested_credit_quantity,unit_price,suggested_credit_amount.
Request
Responses
- 200
- 401
- 403
- 404
- 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.
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.