Records that a transaction's line entry, a bank withdrawal, paid one or more payroll runs, i.e. matches the payment to them. Payroll runs come from the organization's connected payroll provider; each is one pay period's payroll, which Books records as an accrual awaiting payment. Use the transaction's own lineEntryId from getBooksTransactions or getBooksTransaction, and payroll run IDs from getBooksPayrollRuns. Before matching, read each run's amountOutstanding with getBooksPayrollRun. Each item of applications gives a payrollRunId and the positive amount of the payment applied to that run, as a JSON number of dollars with at most two decimal places. A run may take a partial amount, less than its amountOutstanding, but never more. An application may carry adjustments, which write off part of that run's remaining balance; a run's amount plus its adjustments can't exceed its amountOutstanding. The request's own adjustments are closing adjustments on the line entry, for any part of the payment no run accounts for, such as a bank fee. Each adjustment is a ledgerId (an editable ledger, i.e. general ledger (GL) account, of the instance, from getBooksLedgers) and a positive amount in dollars with at most two decimal places; each adjustments list may have at most 100 items, and all adjustments together may name at most 100 different ledgers. List every run the payment covers in one request, from 1 to 100 runs, each at most once: a line entry is matched at most once, and the applied amounts plus the closing adjustments must add up to the transaction's amount (a run's own adjustments don't count toward it). The transaction's other lines are replaced by lines for the matched runs and adjustments, so an existing split is removed and the transaction's category can change. 400, and nothing changes, when an ID isn't a payroll run of the Books instance (a bill or invoice ID included) or the request is malformed. 403, and nothing changes, when an adjustment ledger is read-only or in another Books instance; a ledger Books can't otherwise post to is refused with 400. 409, and nothing changes, when the line entry is already matched differently. A 503 response means Books couldn't match the line entry or confirm the match right now; retry the same request. Retrying the same request is always safe: a retried request whose match already landed succeeds without matching again. Returns 204 with no body on success; to see the result, read the runs back with getBooksPayrollRun, whose amountPaid and matchingStatus reflect the match. To undo a payroll match, unmatch the line entry with deleteBooksPaymentApplications.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
204 400Invalid body or booksId

