Matches a transaction's line entry to bills (accounts payable) it paid, or to invoices (accounts receivable) it collected, i.e. records the payment against them. The transaction's other lines are replaced by lines for the matched bills or invoices and any adjustments, so an existing split is removed and the transaction's category can change. Use the transaction's own lineEntryId from GET /books/transactions (getBooksTransactions) or GET /books/transaction/{transactionId} (getBooksTransaction). Get bill IDs from GET /books/bills (getBooksBills) and invoice IDs from GET /books/invoices (getBooksInvoices). Each item of applications gives a billId or an invoiceId, never both, and the positive amount of the line entry applied to it, as a JSON number of dollars with at most two decimal places; one request matches bills only or invoices only, each at most once. An application may carry adjustments, each a ledgerId (a ledger, i.e. general ledger (GL) account, such as a bank fee or discount ledger, from getBooksLedgers) and a positive amount, booked against that bill or invoice; the request's own adjustments are booked on the line entry, such as to close out an overpayment. Send from 1 to 100 applications; each adjustments list may have at most 100 items, and all adjustments together may name at most 100 different ledgers. Every ID must be a bill, or every one an invoice, in the Books instance, and every adjustment ledger must be in the instance and editable; otherwise the request fails with 400 or 403 and nothing changes. A line entry already matched differently (to other bills or invoices, or with other amounts or adjustments) is refused with 409 and nothing changes; to change a match, unmatch it first with deleteBooksPaymentApplications. Retrying the same request is safe: a line entry is matched at most once, and a retried request whose match already landed returns 200 with the result. Matching an invoice sent with Mercury Invoicing also marks it paid there. Returns the same shape as deleteBooksPaymentApplications: lineEntry (its id, journalEntryId, transactionId, unsigned amount, amountApplied, and amountAdjusted, in dollars) and the matched bills or invoices, each with its id, amountPaid, amountAdjusted, amountOutstanding, status, and displayStatus. A 503 response means Books couldn't match the line entry, confirm the match, or return its result right now; retry the same request.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400Invalid body or booksId
404lineEntryId not found

