Mynto Ledger API
The Ledger API from Mynto — 3 operation(s) for ledger.
The Ledger API from Mynto — 3 operation(s) for ledger.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/mynto-no:mynto-no-ledger-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Mynto Ledger API
version: '1'
description: 'The Mynto API lets you read and write a Norwegian company''s accounting data:
receipts, bank transactions, the ledger, invoices and customers. ## Authentication
Every request carries a bearer token:
Authorization: Bearer mynto_sk_…
There are two kinds of credential:
- **Personal API key** (`mynto_sk_…`) — for connecting your own system. Created
in Mynto under Settings → API, locked to one company. This is the fastest way
to get started, and you do not need to build an app. - **OAuth 2.1 access token** (`mynto_at_…`) — for an app used by *other*
companies. The user approves your app in a consent screen and picks which
company it may act on. See the OAuth guide. ## Scopes
A credential may only do what it was granted. Scopes are `resource:action`, e.g. `faktura:les` (read invoices) or `regnskap:skriv` (post to the ledger). A request
without the required scope is refused with `permission_denied`. Scopes never *widen* what the underlying user may do — they only narrow it. An app
granted `faktura:skriv` on behalf of a read-only user still cannot write. Scopes that move money or file with the government (`betaling:skriv`,
`lonn:kjor`, `mva:innsend`, …) are **sensitive**: they cannot be granted to a
personal API key at all, and an app needs review to request them. The live catalogue is at `GET /platform/scopes`. ## Money
All amounts are integers in **minor units** (øre). `12500` is 125,00 kr. There
are no floats in this API — a rounding error in an accounting system is not a bug
you find later, it is a bug an auditor finds later. ## VAT (MVA)
**A company outside the Norwegian VAT register always gets 0 VAT, whatever
`vatRate` you send.** This is not your bug and it is not us ignoring you: a
company that is not VAT-registered may not charge VAT, and an invoice that did
would be illegal. We refuse to produce one, so an integration cannot make a
customer break the law by accident. If you send `vatRate: 25` and get `vatMinor: 0` back, check whether the company
is VAT-registered. It becomes registered automatically once it passes the
threshold, and invoices issued after that carry VAT normally. For a registered company, `vatRate` is the MVA percentage: 0, 12, 15 or 25. Omit
it to default to 25. ## Pagination
List endpoints take `?limit` (max 200) and `?offset`, and return a `total`. Check `total` before concluding something does not exist. ## Webhooks
Subscribe an HTTPS endpoint and we POST events to it as they happen, so you do not
have to poll. Requires the `webhook:abonner` scope. **Verify the signature.** Every delivery carries:
Mynto-Event: invoice.sent
Mynto-Event-Id: evt_9f2c…
Mynto-Signature: t=1752490000,v1=6b3a…
`v1` is HMAC-SHA256 of `"{t}.{raw_body}"`, keyed with the subscription secret we
returned once at creation. Verify against the **raw body**, before any JSON
parsing — re-serialising the JSON will change the bytes and the signature will
not match. The timestamp is inside the signed material, so a captured delivery cannot be
replayed later. Reject anything older than your tolerance (5 minutes is typical). ```python
expected = hmac.new(secret, f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, v1):
return 401
```
**Delivery is at-least-once.** You *will* eventually receive the same event twice —
a retry after a timeout you actually processed, for example. Deduplicate on
`Mynto-Event-Id`. An integration that assumes exactly-once will double-book
something; this is not hypothetical. **Respond 2xx quickly.** Anything else is a failure. We retry with exponential
backoff (~1m, 2m, 4m, 8m, 16m) and then dead-letter the event. An endpoint that
fails persistently is auto-disabled — check `disabledReason` on the subscription. Do your real work asynchronously and acknowledge immediately. Inspect what we actually sent, and why it failed, at
`GET /v1/companies/{companyID}/webhooks/{subID}/deliveries`.'
servers:
- url: https://production-mynto-ukmi.encr.app
description: Production — real accounting data
security:
- bearerAuth: []
tags:
- name: Ledger
paths:
/v1/companies/{companyID}/accounts:
get:
operationId: GET:publicapi.ListAccounts
parameters:
- allowEmptyValue: true
explode: false
in: path
name: companyID
required: true
schema:
format: int64
type: integer
style: simple
responses:
'200':
content:
application/json:
schema:
properties:
accounts:
items:
$ref: '#/components/schemas/publicapi.Account'
type: array
required:
- accounts
type: object
description: Success response
default:
$ref: '#/components/responses/APIError'
summary: ListAccounts returns the chart of accounts
tags:
- Ledger
/v1/companies/{companyID}/journal:
get:
description: (limit max 200). Check \`total\` before concluding something is absent.
operationId: GET:publicapi.ListJournal
parameters:
- allowEmptyValue: true
explode: false
in: path
name: companyID
required: true
schema:
format: int64
type: integer
style: simple
- allowEmptyValue: true
explode: true
in: query
name: limit
required: true
schema:
format: int64
type: integer
style: form
- allowEmptyValue: true
explode: true
in: query
name: offset
required: true
schema:
format: int64
type: integer
style: form
responses:
'200':
content:
application/json:
schema:
properties:
entries:
items:
$ref: '#/components/schemas/publicapi.JournalEntry'
type: array
total:
format: int64
type: integer
required:
- entries
- total
type: object
description: Success response
default:
$ref: '#/components/responses/APIError'
summary: 'ListJournal returns the bilagsjournal, newest first. Paginated: ?limit&offset'
tags:
- Ledger
/v1/companies/{companyID}/trial-balance:
get:
operationId: GET:publicapi.GetTrialBalance
parameters:
- allowEmptyValue: true
explode: false
in: path
name: companyID
required: true
schema:
format: int64
type: integer
style: simple
- allowEmptyValue: true
description: 'inclusive YYYY-MM-DD
'
explode: true
in: query
name: from
required: true
schema:
type: string
style: form
- allowEmptyValue: true
description: 'inclusive YYYY-MM-DD
'
explode: true
in: query
name: to
required: true
schema:
type: string
style: form
responses:
'200':
content:
application/json:
schema:
properties:
from:
type: string
rows:
items:
$ref: '#/components/schemas/publicapi.TrialBalanceRow'
type: array
to:
type: string
required:
- from
- to
- rows
type: object
description: Success response
default:
$ref: '#/components/responses/APIError'
summary: 'GetTrialBalance returns the saldobalanse for a period: ?from=YYYY-MM-DD&to=…'
tags:
- Ledger
components:
schemas:
publicapi.JournalLine:
description: 'and creditMinor is non-zero, and an entry''s debits always equal its credits.
'
properties:
accountCode:
format: int64
title: 'AccountCode is an NS 4102 account, e.g. 3000 (salgsinntekt) or 1920 (bank).
'
type: integer
creditMinor:
format: int64
type: integer
debitMinor:
format: int64
type: integer
required:
- accountCode
- debitMinor
- creditMinor
title: 'JournalLine is one side of a double-entry posting. Exactly one of debitMinor
'
type: object
publicapi.JournalEntry:
description: 'Amounts are always in minor units (øre). There is no float anywhere in this API — a rounding error in an accounting system is not a bug you find later, it is a bug an auditor finds later.
'
properties:
description:
type: string
docNumber:
description: 'the entry is still a draft.
'
format: int64
title: 'DocNumber is the sequential bilagsnummer, assigned on posting. Null while
'
type: integer
entryDate:
title: 'YYYY-MM-DD
'
type: string
id:
format: int64
type: integer
lines:
items:
$ref: '#/components/schemas/publicapi.JournalLine'
type: array
needsDoc:
title: 'NeedsDoc is true when the entry is still missing its receipt (bilag).
'
type: boolean
sourceTransactionId:
description: 'from; empty when the entry was not bank-driven.
'
title: 'SourceTransactionID links the entry to the bank transaction it was booked
'
type: string
status:
title: 'Status: draft | posted.
'
type: string
required:
- id
- docNumber
- entryDate
- description
- status
- needsDoc
- sourceTransactionId
- lines
title: 'JournalEntry is a bilag: a posted (or draft) accounting entry.
'
type: object
publicapi.TrialBalanceRow:
properties:
closingMinor:
format: int64
type: integer
code:
format: int64
type: integer
creditMinor:
format: int64
type: integer
debitMinor:
format: int64
type: integer
name:
type: string
openingMinor:
format: int64
type: integer
type:
type: string
required:
- code
- name
- type
- openingMinor
- debitMinor
- creditMinor
- closingMinor
type: object
publicapi.Account:
properties:
code:
format: int64
type: integer
name:
type: string
type:
title: 'Type is one of: asset, liability, equity, income, expense.
'
type: string
required:
- code
- name
- type
title: 'Account is a Norwegian standard chart-of-accounts (NS 4102) account.
'
type: object
responses:
APIError:
content:
application/json:
schema:
externalDocs:
url: https://pkg.go.dev/encore.dev/beta/errs#Error
properties:
code:
description: Error code
example: not_found
externalDocs:
url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
type: string
details:
description: Error details
type: object
message:
description: Error message
type: string
title: APIError
type: object
description: Error response
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: A personal API key (mynto_sk_…) or an OAuth 2.1 access token (mynto_at_…).