Books

Retrieve a transaction

Changed on

Returns a single transaction of a source account (a bank account, credit card, or other feed) by its transaction ID, with the same fields as an item of GET /books/transactions (getBooksTransactions): its amount, datetime, description, reviewStatus, postedStatus, and categorizationMethod, and once posted its journalEntryId, its own lineEntryId on the source account's ledgerId, and categorizationLines, the other lines of its journal entry with their lineEntryId, ledgerId, ledgerName, amount, and debitCredit. Use it to read a transaction's current categorization and its journalEntryId before recategorizing it with POST /books/transactions/categorize (categorizeBooksTransactions). sourceAccountId is required and must be the transaction's own source account (its sourceAccountId). Pass enrich=true to add Mercury banking details where available. To find transactions, use GET /books/transactions (getBooksTransactions).

get/books/transaction/{transactionId}

Request

Path parameters

transactionIdstring required

unique id for a transaction

Query parameters

sourceAccountIdstring base58 (max length 22) required

unique id for a source account

Example:7JRNsKwy2Lw66caxVU7WGC

The source account the transaction belongs to: the transaction's sourceAccountId. It must belong to the Books instance.

booksIdstring uuid

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

enrichboolean

Whether to add Mercury banking details, such as the note, counterparty, and attachments, to the transaction. Defaults to false.

Response

Example response

{
  "transaction": {
    "categorizationLines": [
      {
        "ledgerId": "7JRNsKwy2Lw66caxVU7WGC",
        "lineEntryId": "7JRNsKwy2Lw66caxVU7WGC"
      }
    ],
    "datetime": "2016-07-22T00:00:00Z",
    "journalEntryId": "7JRNsKwy2Lw66caxVU7WGC",
    "ledgerId": "7JRNsKwy2Lw66caxVU7WGC",
    "lineEntryId": "7JRNsKwy2Lw66caxVU7WGC",
    "sourceAccountId": "7JRNsKwy2Lw66caxVU7WGC"
  }
}

Changes