Create ledgers (general ledger accounts)

Creates up to 100 ledgers, i.e. general ledger (GL) accounts, in the organization's live chart of accounts. Each ledger needs a name, type, subType, debitCredit (natural balance), and sortCode (account number), and may name a parentId to nest it under an existing ledger of the same Books instance that is not read-only. Teal validates each ledger against the chart-of-accounts rules: subType must belong to type (see the type and subType fields of a ledger, as returned by getBooksLedgers), a child ledger has the same type and sub-type as its parent, and names and sort codes must be unique. The response has exactly one result per requested ledger, in request order: the created ledger, in the same shape as getBooksLedgers returns, or an error with a stable code and a message explaining how to fix it. A failed ledger does not fail the request or the other ledgers, so the status is 200 whatever the item outcomes. The response's failedCount is 0 exactly when every ledger succeeded, and succeededCount plus failedCount equals the number of results; when failedCount is above 0, check each result's error. Problems with the request as a whole, such as a missing scope, a parent ledger outside the Books instance or read-only (linked to a Mercury account), an empty list, or more than 100 ledgers, are reported with an HTTP error status and create nothing.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
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 create general ledgers.

ledgers
array of objects
required
length ≥ 1

The ledgers to create, from 1 to 100 ('maxBooksAPILedgerWrites').

ledgers*

A general ledger to create.

string
enum
required

Whether the ledger has a debit or credit nature

Allowed:
string
required

The ledger name

string | null

Optional parent ledger, to create this ledger as a child ledger

string
required

Numeric sort code used to order the ledger in the chart of accounts

string
enum
required

The ledger sub-type

string
enum
required

The ledger type

Allowed:
Responses

400

Invalid body or booksId

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