Skip to main content

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

OK

Response Headers
    Content-Type