Skip to main content

Preview Bill Settlement With Vendor Credits

GET 

/api/ledger/entries/:entry/settlement-preview

Preview the plan to settle a bill (a purchase-invoice entry) using the vendor credits already allocated against it — the read side of the "sync & mark paid" flow. Reports whether the entry is a settleable bill, whether the bill itself is synced to the accounting provider, and the state of each applied vendor credit: missing_transaction (its accounting transaction has not been generated yet), unsynced (generated but not pushed to the provider), or synced (its credit note is pushed and its allocation applied). Use it to show exactly what will happen before committing.

Authentication: Requires Bearer token.

Request body: none.

Response: 200 with data.settlement: is_settleable_bill, bill_synced, already_settled, needs_action, credit_count, allocated_total, outstanding_balance, currency_code, and credits[] (each carries vendor_credit_id, allocation_id, vendor_credit_number, vendor_credit_route, allocation_amount, state, ledger_entry_id, ledger_entry_route). When the entry is not a bill with allocated vendor credits, is_settleable_bill is false and credits is empty. Returns 404 when the entry does not exist.

Request

Responses

OK

Response Headers
    Content-Type