Skip to main content

Chart of Accounts

The chart of accounts (COA) defines every balance sheet and P&L account your organization can post to. Use these queries and mutations to keep your ledger structure aligned with upstream systems.

Prerequisites​

  • A Naqood API secret or OAuth-issued secret scoped to the target organization
  • The organization slug on every request
  • A role that can manage accounts

Account fields​

FieldTypeNotes
idID!Stable identifier
typeAccountType!asset, liability, equity, revenue, expense, title, or sum
codeInt!Numeric account code (unique per organization)
nameString!Display name
descriptionString!Brief purpose of the account
exampleStringOptional usage hint
remarkStringAdditional context
systemBoolean!System-managed accounts cannot be edited or deleted
sum[AccountRange!]Present on roll-up accounts that summarize code ranges
vatVatLinked VAT code, when configured
openingAccountAccountOpening balance account for the code
metadataJSONObjectOptional categorization (for example category, cashflowNegate)

List accounts​

Fetch the full chart of accounts for an organization.

query Accounts($slug: Slug!) {
organization(slug: $slug) {
coa {
id
type
code
name
description
system
sum {
from
to
}
vat {
id
code
rate
}
}
}
}

Create an account​

mutation CreateAccount($input: CreateAccountInput!) {
createAccount(input: $input) {
id
type
code
name
description
}
}

CreateAccountInput tips:

  • type must align with the code range: revenue/expense accounts use 1001–4999; asset/liability/equity accounts use 5001–9999.
  • Codes must be unique within an organization.
  • sum accounts are system-controlled; use title or the posting types above for new entries.
  • openingAccountId is optional; balance sheet accounts default to their own opening account, while revenue/expense accounts inherit the profit-and-loss brought-forward account automatically.
  • vatId links the account to an existing VAT code within the organization.

Example variables:

{
"input": {
"slug": "acme-co",
"type": "expense",
"code": 2100,
"name": "Software subscriptions",
"description": "Recurring SaaS and tooling",
"vatId": "vat_123"
}
}

Update an account​

mutation UpdateAccount($input: UpdateAccountInput!) {
updateAccount(input: $input) {
id
name
description
example
remark
}
}

You can rename or adjust descriptions on non-system accounts. Codes and types remain unchanged after creation.

Update account categories​

Bulk-update account metadata (for example to map to reporting categories or cash flow presentation).

mutation UpdateAccountCategories($input: UpdateAccountCategoriesInput!) {
updateAccountCategories(input: $input) {
id
code
metadata
}
}

UpdateAccountCategoriesInput accepts an accounts array with id, category, and cashflowNegate flags. Only