Skip to main content

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.

Required scope: purchase-orders:read

Grant 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_code
  • has_over_bills: true if any line has over-billed quantity
  • total_suggested_credit: sum of suggested_credit_amount across over-billed lines
  • lines[]: only includes lines with over-billed quantity. Each line has purchase_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​

OK