Chart of accounts
The chart of accounts lists your ledger accounts (code, name, type) so an entry to an account that does not exist is proven wrong; import it from CSV in the app or with the CLI.
An answer that invents an account, writes a code that is not yours, or names an account ambiguously is caught on the claim that states it.
What it is
A chart of accounts is the list of ledger accounts a company records transactions in: each has a code, a name and a type. For example:
| Code | Name | Type |
|---|---|---|
| 1000 | Cash | asset |
| 1200 | Inventory | asset |
| 1300 | Prepaid Expenses | asset |
| 1400 | VAT Input | asset |
| 2000 | Accounts Payable | liability |
| 2100 | Accrued Expenses | liability |
| 2200 | VAT Output | liability |
| 3000 | Retained Earnings | equity |
| 4000 | Sales Revenue | revenue |
| 6100 | Office Supplies Expense | expense |
It is used by the journal checks (the same ones as posting rules): every debit and credit account in an answer's entries must be on the chart, by name or by code, and posting rules are read through it. An entry that uses another account is proven wrong, with the reason Journal entry breaks a rule.
When it's not set. If a source the answer had lists "Chart of accounts:" or "Allowed accounts:", that list is used. Otherwise accounts are not checked.
How accounts are matched
An entry may name an account in any of these ways, compared without case or extra spaces: Inventory, 1200, 1200 Inventory, 1200 - Inventory, Inventory (1200), Inventory 1200. Nothing is guessed:
| The entry writes | Result |
|---|---|
1200 Inventory, 1200, Inventory (1200) | Inventory |
1299 Inventory | Proven wrong: "code 1299 is not in the project's chart of accounts (Inventory is 1200)" |
2000 Inventory | Proven wrong: "code 2000 is Accounts Payable in the project's chart of accounts, but Inventory is 1200" |
1299 | Proven wrong: "'1299' is not in the project's chart of accounts" |
Accounts Receivable (the chart has "Accounts Receivable - Trade" and "Accounts Receivable - Other") | Proven wrong: "it could be any of 1100 Accounts Receivable - Trade, 1110 Accounts Receivable - Other, so it is not guessed" |
Inventry | Proven wrong, naming the nearest account (Inventory), which is not assumed |
How to add it
In the app
- Open Evaluation policy › Advanced settings ▸ › Data definitions › Chart of accounts.
- Click Import CSV. Choose the file, or paste its rows into Rows.
- Click Check: the server reads the file and checks the policy with it in place of the chart. Every problem is listed: a line of the file ("Line 3. the account type "liabilities" is not one of asset, liability, equity, revenue, expense"), or a posting rule that names an account the file does not have. Nothing is stored.
- Click Import. The file replaces the draft's chart; a file with any problem imports nothing and lists every line.
- Publish: Publish vN… › Publish.
With the CLI
variably policy chart check chart.csv # check only, nothing stored
variably policy chart import chart.csv --note "FY2026 ledger" # check, then write it into the draft
variably policy publish --note "FY2026 ledger"
variably policy chart export -o chart.csv # the draft's chart (or --version N)
import always checks first and imports nothing when the file has a problem (exit 1, every problem printed with its line). Importing needs an API key with the scope policy.write; checking and exporting need any key of the project.
From the SDK
client.set_chart_of_accounts(experiment_id, "ledger/chart_of_accounts.csv", note="FY2026 ledger")
A list of {code, name, type}, or a .csv, .json or .yaml file. This publishes a policy version with only the chart changed (and the same change on the open draft); a project not scored by an evaluation policy is refused, because the chart is a policy setting. A bad CSV line is refused with every line's problem. [] removes the chart.
In YAML
evaluation_config:
chart_of_accounts:
- {code: "1000", name: Cash, type: asset}
- {code: "1200", name: Inventory, type: asset}
- {code: "2000", name: Accounts Payable, type: liability}
Quote numeric codes so they stay text.
The CSV format
code,name,type
1000,Cash,asset
1200,Inventory,asset
2000,Accounts Payable,liability
5100,"Office Supplies, Expense",expense
- The first line names the columns
code,nameandtype, in any order.account code,account number,account nameandaccount typeare read too. - One account per line after it. A name with a comma is quoted.
typeis asset, liability, equity, revenue or expense, in any case (stored in lower case).- A spreadsheet's byte-order mark is ignored. Up to 5,000 accounts and 2 MB.
Paste this into your coding agent
Paste this into Claude Code, Cursor, or whichever agent has your repository open. It writes the CSV from your ledger export and checks it with variably policy chart check.
Write the variA/Bly chart of accounts for this project from the ledger data in this repository. Every account a posting rule or a journal entry names is checked against it. Look first: 1. Find the chart of accounts: a ledger export, a seed file, an accounts table in the migrations, or the accounting system's configuration. Show me the file and how many accounts it has before you write anything. Then write a CSV file, chart-of-accounts.csv, with the header code,name,type and one account per line, type being asset, liability, equity, revenue or expense: code,name,type 1000,Cash,asset 2000,Accounts Payable,liability 5100,"Office Supplies, Expense",expense Take the type from the source data; if an account's type is not stated there, list it and ask me rather than guessing from its name. The format is described at https://www.variably.dev/docs/data-chart-of-accounts. How to check and save it: 1. The variably command comes with the SDK (pip install variably-sdk) and reads VARIABLY_API_KEY and VARIABLY_BASE_URL from the environment; never hard-code the key or write it into a file. 2. Verify: run `variably policy chart check chart-of-accounts.csv`. It checks the file against the policy and saves nothing; each problem is printed with its line. Fix every problem and run it again until it exits 0. 3. Do not import or publish. Tell me to run `variably policy chart import chart-of-accounts.csv --note "<why>"` (it writes the chart into the draft, with a key allowed to change the evaluation policy), or to import the file on Evaluation policy › Data definitions › Chart of accounts; then publish. When you are done, tell me the source of the chart and anything you left out.
Edge cases
| Situation | What happens |
|---|---|
| An entry uses the account's code only | Matched. |
| Sub-accounts (1200.10 Raw Materials) | Each is its own account: list it, with a code such as 1200.10. |
| The same name or code twice | Refused, naming the line where it was first used. |
| A posting rule names an account the new chart does not have | Check and the import refuse it, naming the rule and the closest account. |
An empty chart [] in YAML | Refused: "is empty: remove the key to have no chart of accounts". |
Type in capitals (Asset) | Read from CSV; refused in YAML: "write the type in lower case (asset)". |
Common mistakes
| Mistake | What happens | Fix |
|---|---|---|
| A CSV with extra or missing columns | Check refuses it, naming the line | Three columns: code,name,type |
Codes that lose leading zeros in a spreadsheet (0400 becomes 400) | Entries posted to 0400 look unknown | Format the code column as text before exporting |
An empty chart ([]) to "turn it off" | Refused | Remove the chart_of_accounts key instead |
| Importing into the draft and forgetting to publish | Entries are still checked with the old chart | Publish the draft |
Format reference
chart_of_accounts is a list of accounts.
| Field | Type | Required | Allowed values | Meaning |
|---|---|---|---|---|
code | text | yes | 1–32 letters, digits, ., -, _ or /, starting with a letter or digit; unique | The account number |
name | text | yes | 2–60 characters with a letter; unique | The account name entries use |
type | text | yes | asset, liability, equity, revenue, expense (lower case) | The account type |
Up to 5,000 accounts.
Validation messages
| Problem | Message |
|---|---|
| CSV: no header | line 1: column "1000" is not one of code, name, type |
| CSV: missing column | line 1: no type column: the first line names the columns code, name, type |
| CSV: wrong count | line 7: 4 values; the header has 3 columns |
| CSV: bad type | line 4: the account type "liabilities" is not one of asset, liability, equity, revenue, expense |
| CSV: duplicate | line 3: the account code 1000 is already used at line 2 |
| Not a list | evaluation_config.chart_of_accounts: must be a list of accounts ({code, name, type}) |
| Unknown field | evaluation_config.chart_of_accounts[3].number: unknown field (an account has code, name and type) |
| Bad code | …[3]: the account code "12 00" must be 1 to 32 letters, digits, '.', '-', '_' or '/', starting with a letter or digit |
| Duplicate | …[7]: the account code 1200 is already used at [1] |
Concepts on this page: Data definitions