Settle Bill With Vendor Credits
POST/api/ledger/entries/:entry/sync-and-settle
Settle a bill (a purchase-invoice entry) using the vendor credits allocated against it so the connected accounting provider marks the bill PAID — the missing half of two-way sync when the allocations exist here but were never pushed. Dispatches a tracked background job that (1) syncs the bill so its remote document exists, (2) for each applied vendor credit generates its accounting transactions if missing, syncs its credit note, then pushes the allocation (Xero credit-note allocation / QuickBooks zero-dollar bill payment), and (3) re-reads the bill so its link re-grades to Synced, Locked (paid). Idempotent — re-running skips work already done, so a partial failure is safe to retry.
Authentication: Requires Bearer token + accounting.sync permission (403 without it).
Request body: none.
Response: 200 with data.tracked_job_log_id (poll for progress) and data.settlement (the pre-run snapshot, same shape as Preview Bill Settlement). When the bill is already settled by its credits, returns 200 with just data.settlement and no job. Returns 422 when the entry is not a bill with vendor credits allocated. Returns 404 when the entry does not exist.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 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.
Unprocessable Entity
Response Headers
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.