Retrieve a transaction
Changed onReturns 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).
Request
- Base URLhttps://api.mercury.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
unique id for a transaction
Query parameters
unique id for a source account
The source account the transaction belongs to: the transaction's sourceAccountId. It must belong to the Books instance.
The Books instance to act on. Must be the token organization's own instance, which it defaults to.
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
- info
endpoint added
- info