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
- 200
- 401
- 403
- 404
- 429
OK
Response Headers
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.