List the live chart of accounts
Changed onLists the ledgers, i.e. general ledger (GL) accounts, in the organization's live chart of accounts, sorted by name. Each ledger has its id, name, sortCode (account number), type, subType, debitCredit (natural balance), financialAccountType (set when the ledger represents a bank or card account), and parentId (use it to reconstruct the hierarchy). Each ledger also says which changes the system allows before you write: isRequired and requiredLedgerPurpose mark required ledgers, which the accounting system needs and which can't be deleted; editable says whether line entries can be manually added to or removed from the ledger; deletable says whether it can be deleted now, and when it can't, deleteBlockedReason says why: required, hasActivity (it has line entries), linkedSource (it is linked to a bank or card account), or integrationMapped (an invoicing, commerce, or Plaid integration is mapped to it). Filter with type, subType, debitCredit, and ids; filters combine, so a ledger must match all of them. Results are paginated: pass a response's nextPageToken as pageToken to fetch the next page. To read one ledger by ID, use getBooksLedger.
Request
- Base URLhttps://api.mercury.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
The Books instance to act on. Must be the token organization's own instance, which it defaults to.
Only return ledgers of this type.
Only return ledgers of this sub-type.
Only return ledgers with this natural balance.
Comma-separated list of at most 100 distinct ledger IDs. Only return these ledgers. Every ID must belong to the Books instance.
[ "7JRNsKwy2Lw66caxVU7WGC" ]
token for pagination
The maximum number of accounts to return per page, from 1 to 1000.
Response
Example response
{
"ledgers": [
{
"id": "7JRNsKwy2Lw66caxVU7WGC",
"parentId": "7JRNsKwy2Lw66caxVU7WGC"
}
]
}Changes
- info
endpoint added
- info