All docs
Evaluation policyData definitionsChart of accountsdashboard

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.

What you'll have

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:

CodeNameType
1000Cashasset
1200Inventoryasset
1300Prepaid Expensesasset
1400VAT Inputasset
2000Accounts Payableliability
2100Accrued Expensesliability
2200VAT Outputliability
3000Retained Earningsequity
4000Sales Revenuerevenue
6100Office Supplies Expenseexpense

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 writesResult
1200 Inventory, 1200, Inventory (1200)Inventory
1299 InventoryProven wrong: "code 1299 is not in the project's chart of accounts (Inventory is 1200)"
2000 InventoryProven wrong: "code 2000 is Accounts Payable in the project's chart of accounts, but Inventory is 1200"
1299Proven 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"
InventryProven wrong, naming the nearest account (Inventory), which is not assumed

How to add it

In the app

  1. Open Evaluation policy › Advanced settings ▸ › Data definitions › Chart of accounts.
  2. Click Import CSV. Choose the file, or paste its rows into Rows.
  3. 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.
  4. Click Import. The file replaces the draft's chart; a file with any problem imports nothing and lists every line.
  5. 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, name and type, in any order. account code, account number, account name and account type are read too.
  • One account per line after it. A name with a comma is quoted.
  • type is 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.

Prompt for your coding agent
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

SituationWhat happens
An entry uses the account's code onlyMatched.
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 twiceRefused, naming the line where it was first used.
A posting rule names an account the new chart does not haveCheck and the import refuse it, naming the rule and the closest account.
An empty chart [] in YAMLRefused: "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

MistakeWhat happensFix
A CSV with extra or missing columnsCheck refuses it, naming the lineThree columns: code,name,type
Codes that lose leading zeros in a spreadsheet (0400 becomes 400)Entries posted to 0400 look unknownFormat the code column as text before exporting
An empty chart ([]) to "turn it off"RefusedRemove the chart_of_accounts key instead
Importing into the draft and forgetting to publishEntries are still checked with the old chartPublish the draft

Format reference

chart_of_accounts is a list of accounts.

FieldTypeRequiredAllowed valuesMeaning
codetextyes1–32 letters, digits, ., -, _ or /, starting with a letter or digit; uniqueThe account number
nametextyes2–60 characters with a letter; uniqueThe account name entries use
typetextyesasset, liability, equity, revenue, expense (lower case)The account type

Up to 5,000 accounts.

Validation messages

ProblemMessage
CSV: no headerline 1: column "1000" is not one of code, name, type
CSV: missing columnline 1: no type column: the first line names the columns code, name, type
CSV: wrong countline 7: 4 values; the header has 3 columns
CSV: bad typeline 4: the account type "liabilities" is not one of asset, liability, equity, revenue, expense
CSV: duplicateline 3: the account code 1000 is already used at line 2
Not a listevaluation_config.chart_of_accounts: must be a list of accounts ({code, name, type})
Unknown fieldevaluation_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