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
slugon every request - A role that can manage accounts
Account fields
| Field | Type | Notes |
|---|---|---|
id | ID! | Stable identifier |
type | AccountType! | asset, liability, equity, revenue, expense, title, or sum |
code | Int! | Numeric account code (unique per organization) |
name | String! | Display name |
description | String! | Brief purpose of the account |
example | String | Optional usage hint |
remark | String | Additional context |
system | Boolean! | System-managed accounts cannot be edited or deleted |
sum | [AccountRange!] | Present on roll-up accounts that summarize code ranges |
vat | Vat | Linked VAT code, when configured |
openingAccount | Account | Opening balance account for the code |
metadata | JSONObject | Optional categorization (for example category, cashflowNegate) |
List accounts
Fetch the posting accounts for an organization (assets, liabilities, equity, revenue, and expenses).
query Accounts($slug: Slug!) {
organization(slug: $slug) {
accounts {
id
type
code
name
description
system
vat {
id
code
rate
}
}
}
}
Use coa instead of accounts if you want every entry in the chart, including section headers and roll-up (title / sum) rows.
Create an account
mutation CreateAccount($input: CreateAccountInput!) {
createAccount(input: $input) {
id
type
code
name
description
}
}
CreateAccountInput tips:
typemust align with the code range: revenue/expense accounts use1001–4999; asset/liability/equity accounts use5001–9999.- Codes must be unique within an organization.
sumaccounts are system-controlled; usetitleor the posting types above for new entries.openingAccountIdis optional; balance sheet accounts default to their own opening account, while revenue/expense accounts inherit the profit-and-loss brought-forward account automatically.vatIdlinks 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