Choose what you allow. Your choice applies on every tracken.ee address and you can change it any time with “Cookie settings” in the footer.

Remember your cookie choice, language and theme. Without them the site doesn't work the way you chose.

A cookie with your choice (6 months); language and theme in browser storage.


The services below learn that you visited this site, whether you came from their ad and whether you then created a Tracken account. That shows us which ads work, and these companies may show you Tracken ads later. They may link the data to your account with them. For Meta, Tracken ID's server reports the new account and also sends a hash of your e-mail address, your IP address and browser details.

ServiceCookiesKept for up to
Meta (Facebook, Instagram)_fbp, _fbc90 days

Tracken's own visit counter uses no cookies, stores no IP addresses and shares nothing with anyone. Privacy policy

Skip to content
Beta
BetaThe Tracken Accounts API is in beta: it may still change before v1, and every change is announced in the changelog.
Guide

Getting started

From nothing to your first API answer: a credential, a token, a call. Then the command line and an assistant in Claude Code on the same API.

Two ways in

A program

API credential

An integration, a script, a nightly sync. It uses an OAuth client of one organization, with the scopes you gave it. Steps 1 to 3 below are this path.

Why

No person signs in, and the credential's scopes are all it may do.

A person

Tracken ID sign-in

Works through the CLI or an MCP client, signed in to Tracken ID with their own account, and names the organization in every request (X-Organization-ID; the CLI does it for you).

Why

They act with their role in the organization, narrowed to the scopes they signed in with.

Before you start

  • A company in Tracken Accounts (https://accounts.tracken.ee). Build in a sandbox copy; a demo company has no API access.
  • The owner or administrator role in that company: only they can create an API credential.
  • For the CLI only: Node.js 22 or later, then npm i -g @tracken/cli.
1

Create an API credential

  1. Sign in to Tracken Accounts (https://accounts.tracken.ee) and open the company the program will work in. Use a sandbox copy while you build.
  2. Go to Settings → API access and choose New API credential.
  3. Name it after the program (“Web shop”) and pick the scopes it needs.
  4. Copy the client ID and the client secret. The secret is shown once.
A demo company (from the “Try a demo company” door on tracken.ee) has no API access: use a sandbox copy of a real company.
Who can create one, expiry, and signing in without a secret

Only the company's owners and administrators can create one, and only with rights their own role has.

When you create it you can optionally set an expiry date and how long it may stay unused before it is disabled.

Keep the secret in your secret store, never in code. A credential can instead register a public key and sign in with private_key_jwt (RFC 7523), so no secret is shared at all.

Your secret store, never the code
TRACKEN_CLIENT_ID=…
TRACKEN_CLIENT_SECRET=…   # shown once
2

Get an access token

Exchange the credential for a 10-minute access token at Tracken ID, then send it as Authorization: Bearer <token>. When it expires, ask for a new one the same way.

The CLI and the SDK do this exchange for you and renew the token as it nears expiry.

How the exchange works

OAuth 2.0 client credentials, the client authenticating with HTTP Basic. resource names the integration audience of the environment; scope asks for some or all of the credential's scopes, and leaving it out asks for all of them.

There is no refresh token for a credential.

POSTTracken ID token
curl https://id.tracken.ee/token \
  -u "$TRACKEN_CLIENT_ID:$TRACKEN_CLIENT_SECRET" \
  -d grant_type=client_credentials \
  -d resource=https://accounts-api.tracken.ee/integration \
  -d scope="invoices:read contacts:read"
200Response
{
  "access_token": "eyJhbGciOi…",
  "token_type": "Bearer",
  "expires_in": 600,
  "scope": "invoices:read contacts:read"
}
3

Make a call

List the last five sales invoices. A machine token belongs to one organization, so it sends no X-Organization-ID.

That invoice comes to 1 240,00 EUR with VAT, dated 12.10.2026. On the wire money is a decimal string ("1240.00") and a date is YYYY-MM-DD.

Read the conventions next: they hold for every operation.

GET/v1/sales-invoices
curl "https://accounts-api.tracken.ee/v1/sales-invoices?limit=5" \
  -H "Authorization: Bearer $TOKEN"
200Response
{
  "data": [
    {
      "id": "0b8f0c2e-5f3c-4a52-9d7e-1c2b3a4d5e6f",
      "number": "2026-0142",
      "date": "2026-10-12",
      "currency": "EUR",
      "net_total": "1000.00",
      "tax_total": "240.00",
      "total": "1240.00"
    }
  ],
  "meta": { "pagination": { "limit": 5, "next_cursor": "c2VxOjQy…", "has_more": true } }
}

Next

Scopes

A scope admits a group of operations; each operation in the reference lists the scopes it needs. A call outside the token's scopes answers 403 with INSUFFICIENT_SCOPE, and WWW-Authenticate names the missing scope.

All 29 scopes
ScopeAdmits
readRead everything the credential's organization holds (shorthand for all *:read scopes).
organizations:readOrganization, fiscal years, periods.
ledger:readChart of accounts, tax codes, dimensions, transactions.
ledger:writePost and change manual transactions; manage accounts and dimensions.
contacts:readContacts.
contacts:writeCreate and change contacts.
items:readItems.
items:writeCreate and change items.
invoices:readSales invoices, quotes, purchase invoices.
invoices:writeCreate, change, issue, void and send invoices and quotes.
payments:readPayments and their allocations.
payments:writeRecord and remove payments.
bank:readBank accounts, statements and lines.
bank:writeImport statements; reconcile lines; manage bank accounts. Reconciling a line as: posting books it to any of the organization's accounts without ledger:write, as the app's own post to the ledger from a bank line does.
documents:readDocument vault, downloads, extractions.
documents:writeUpload, link, digitize and delete documents.
assets:readFixed assets and depreciation.
assets:writeManage and dispose of fixed assets.
reports:readRun reports; read report definitions.
reports:writeCreate, change and delete custom report definitions; open a month's VAT return as a draft (filing stays in the app).
vat:readVAT returns and their files.
audit:readAudit log.
exports:writeCreate and download full data exports (after v1). after v1
webhooks:manageManage webhook endpoints (after v1). after v1
billing:readBilling plans, runs and the formula catalog.
billing:writeCreate, change, approve and archive billing plans; start billing runs (issuing their invoices also needs invoices:write).
objects:readObject types, objects, meter types, meters and readings.
objects:writeCreate and change object types, objects, meter types and meters.
readings:writeRecord, correct and delete meter readings.

A sandbox company

Build against a copy, not the real books. In Tracken Accounts add the company you already have once more (the same registry code): Accounts offers to make a copy. Create the credential in the copy; it belongs to that company only.

What a copy does, and why to use one on development too

Accounts asks why (“Trying a different setup” fits) and copies either the setup and master data, or everything with its history. A copy is a sandbox: it sends no e-mail to anyone outside the company, gets no deadline reminders and runs no VIES checks, so an integration can issue and send invoices without reaching a real customer.

On the development environment every company is test data, shared with other testers; still, issuing or sending from a real-looking company e-mails the addresses on it, so use a copy there too.

The command line: tracken

Every v1 operation is a command, generated from the same API document: tracken <resource> <verb>, for example tracken sales-invoices issue <id> or tracken reports run balance-sheet.

Install it from npm: npm i -g @tracken/cli (0.2.0, MIT, beta; Node.js 22 or later).

Install, sign-in and sessions

Install it with npm i -g @tracken/cli (tracken --version names the API document it was built for), then sign in with your own Tracken ID.

tracken login uses the OAuth device flow: it prints a link and a code such as BCDF-GHJK; confirm it in any browser. A read-only session stays signed in 7 days unused (30 days at most); one with --write or any write scope 24 hours unused (7 days at most). Tokens live in the operating system's keychain.

Every POST carries an automatic Idempotency-Key, --all follows the cursor, --dry-run asks the API to check a write without storing it, and table output shows money and dates as 1 234,50 and 12.10.2026.

The CLI also runs as a program, with an API credential instead of a person: set TRACKEN_CLIENT_ID and TRACKEN_CLIENT_SECRET (see step 2, CLI tab).

Terminal
tracken login           # read-only; add --write to change data
tracken org list        # * marks the organization commands act in
tracken org use <organization-id>
tracken sales-invoices list --since 7d -o table

An assistant in Claude Code (MCP)

tracken mcp is a local Model Context Protocol server: Claude Code (or Claude Desktop, Cursor, VS Code) works in Tracken Accounts as you, through the same public API, sign-in and organization as the CLI. It runs on your computer and stores nothing.

  • Its tools are the operations marked for assistants, named like the operation in snake_case (list_sales_invoices, create_purchase_invoice, run_report); the reference shows each one's tool name.
  • Read-only by default. With a plain tracken login a tool that changes data answers “run tracken login --write” without calling the API.
  • Every write tool takes dry_run, and its description asks the model to show you the result and get your confirmation before it writes for real.
  • tracken org use in a terminal switches the organization for the next tool call, with no restart.
Why read-only by default

Give an assistant a write session only while you need it, and tracken logout when done.

Add it to Claude Code
tracken login
claude mcp add tracken -- tracken mcp

# or save its configuration in a project:
tracken mcp --print-config claude  # prints the .mcp.json