API reference

Search

Find GL accounts, counterparties, transactions, journal entries and rules by name, description, code or number.

Guides: Work from the keyboard

Find records by name, description, code or number

GET/v1/search

client.search.query()

Find GL accounts, counterparties, transactions, journal entries and rules by name, description, code or number.

Each kind answers with at most limit matches: accounts by code, counterparties by name, transactions and journal entries newest first. To page through every match of one kind, list that kind with its own search filter instead.

Parameters

NameTypeDescription
qQuery · Requiredstring

What to look for: part of a name or description, a GL account's code, or a journal entry's number. Case is ignored.

kindQueryarray of string or null

Only these kinds. Repeat the parameter for several; omit it for all.

One of account, counterparty, transaction, journal_entry, rule
limitQueryinteger

How many matches of each kind, at most.

Default 5

Response

200SearchOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/search" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

SearchOut

NameTypeDescription
dataRequiredarray of SearchHit

The matches, grouped by kind: accounts, counterparties, transactions, journal entries, then rules.

SearchHit

NameTypeDescription
datestring (date) or null

When it happened, for a transaction or a journal entry.

idRequiredstring

Its id, for that kind's own endpoints.

kindRequiredstring

What kind of record matched.

One of account, counterparty, transaction, journal_entry, rule
logo_urlstring or null

A counterparty's logo, square PNG; null for none and for other kinds.

refstring or null

The short handle people say: a GL account's code, a journal entry's number.

titleRequiredstring

What the record is called: a name or a description.