elnora-merit-aktiva

Do your Merit Aktiva accounting from the command line — or let Claude Code do it for you.
Merit Aktiva is Estonia's cloud accounting platform. This repo gives you two ways to drive its API:
elnora-merit — a CLI that covers the entire Merit Aktiva API (invoices, payments, VAT/KMD, ledger, reports, and more) plus Merit Palk payroll. JSON in, JSON out.
- A Claude Code plugin that wraps the CLI in skills, agents, and slash commands, so you can ask in plain English ("book this purchase invoice", "file my KMD") and Claude runs the right commands the right way.
Everything is universal — nothing about any one company is hardcoded. Point it at your own Merit credentials and it works.
Requires a Merit Aktiva Pro or Premium license — the API is not available on lower tiers.
Install
As a CLI
npm install -g @elnora-ai/merit-aktiva
This puts the elnora-merit command on your PATH. Node.js ≥ 20 required.
As a Claude Code plugin
Paste these two slash commands into Claude Code one at a time — wait for the first to finish before the second:
/plugin marketplace add Elnora-AI/elnora-merit-aktiva
/plugin install merit-aktiva-workspace@elnora-merit-aktiva
The plugin uses the elnora-merit CLI under the hood, so install that first.
Make the write agents actually fire
The plugin ships three agents that wrap the CLI with guardrails — resolve the customer, build per-rate VAT totals, preview the payload, gate on your approval:
| When you ask to… | Agent |
|---|
| create / bill a sales invoice | merit-aktiva-workspace:merit-invoice-creator |
| record a payment, enter a purchase invoice, reconcile open items | merit-aktiva-workspace:merit-bookkeeper |
| look up a company (legal name / VAT / address / e-invoice capability) | merit-aktiva-workspace:merit-company-lookup |
A host that only loads the merit-* skills gets a recipe and then hand-runs the CLI itself — skipping those guardrails. To make the agents fire at the right time, add one routing rule to your host's own instructions (Claude Code CLAUDE.md, AGENTS.md, .cursorrules, or persistent agent memory), e.g.:
For Merit write/lookup work (create invoice, record payment, enter purchase, reconcile, company lookup) dispatch the merit-aktiva-workspace agent above — do not hand-run the elnora-merit CLI. Read/report/VAT work (KMD, reports, Stripe/LHV import, reverse charge, payroll) has no agent — use the merit-* skills directly.
That write-vs-read split is the whole rule: agent-first only where an agent exists.
Authenticate
Generate an API ID and API Key in Merit Aktiva:
Settings → Company data → API settings → "Koosta võti" (Generate key).
The CLI reads them from environment variables. On first run it also prompts and saves them to ~/.config/elnora-merit/.env (mode 0600):
export MERIT_API_ID=your-api-id
export MERIT_API_KEY=your-api-key
Or copy .env.template to .env and fill it in (.env is gitignored — never commit it).
| Variable | Required | Notes |
|---|
MERIT_API_ID | yes | GUID from API settings |
MERIT_API_KEY | yes | base64 secret; the HMAC signing key |
MERIT_API_VERSION | no | v1 (default) or v2 for dual-version endpoints |
MERIT_PALK_API_ID | for palk | Merit Palk API ID (separate payroll product) |
MERIT_PALK_API_KEY | for palk | Merit Palk API key (base64 secret) |
MERIT_REFERENCES_DIR | no | Base dir for config + reference files (stripe map, ledger, overrides, company-profile.json). Default ~/.config/elnora-merit. |
Company profile (optional)
Snapshot your account's own chart of accounts, banks, VAT codes, and financial years so
an agent (or you) can look up the real codes without transcribing them by hand:
elnora-merit profile sync # → company-profile.json (in MERIT_REFERENCES_DIR)
elnora-merit profile show --section taxes # the VAT TaxId guids, etc.
company-profile.json holds no secrets but is company-specific, so it is gitignored.
Re-run profile sync whenever the chart of accounts changes.
Estonian Business Register lookups (optional)