Match a transaction to bills or invoices

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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

unique id for a line entry; emitted as base-58, but a base-16 UUID is also accepted

Query Params
uuid

The Books instance to act on. Must be the token organization's own instance, which it defaults to.

Body Params

Request to match a line entry to bills or to invoices.

adjustments
array of objects | null

Adjustments on the line entry itself rather than on a bill or invoice, such as closing out an overpayment, at most 100.

adjustments
applications
array of objects
required
length ≥ 1

The bills, or the invoices, the line entry pays, from 1 to 100, each at most once.

applications*

The part of the line entry's amount applied to one bill or invoice.

adjustments
array of objects | null

Adjustments booked against this bill or invoice, at most 100.

adjustments
double
required

The positive amount applied to the bill or invoice: a number of dollars with at most two decimal places.

string | null

The bill to pay. Give exactly one of billId and invoiceId, and the same one in every application.

string | null

The invoice paid. Give exactly one of billId and invoiceId, and the same one in every application.

Responses

400

Invalid body or booksId

404

lineEntryId not found

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json