askledgerDocs
REST-APIAdministrations
Documentatie

Get the profit and loss statement per month (by administration)

GET
/administrations/{administrationId}/profit-and-loss

The profit and loss statement (winst- en verliesrekening) per month (default the last 12 months): every profit and loss account's movement, grouped by RGS rubriek (e.g. WOmz netto-omzet, WKpr kostprijs, WPer personeelskosten) in the order of the Dutch P&L model, with totals per group and the result per month. Revenue is positive and costs negative, so result is the sum of the groups. Accounts without an RGS code are in unmapped-revenue / unmapped-expense. Amounts are in the ledger's base currency, debit positive and credit negative. Balances add up every synced line; when the package was synced from a certain date on (see firstTransactionDate) and that year has no opening balance entry, absolute balances miss what came before.

Same as the ledger endpoint, addressed by LedgerSuite administration id instead of ledgerId. Other LedgerSuite products call this with their own client_credentials token (audience urn:ledgersuite:askledger, scope askledger:read) for administrations that include them; company group API keys and OAuth tokens work too.

Requires the ledger:read scope (Lezen). Same operation as the MCP tool get-profit-and-loss.

Authorization

bearer
headerAuthorizationBearer <token>

A company group API key (al_live_…, created at /dashboard/api), an OAuth access token from the same authorization flow MCP clients use, or (other LedgerSuite products, /administrations routes only) a LedgerSuite client_credentials token.

Path Parameters

administrationId*string

LedgerSuite administration id; its linked ledger is used

Query Parameters

fromMonth?string

First month; default 11 months before toMonth (YYYY-MM, inclusive)

Match^\d{4}-(0[1-9]|1[0-2])$
toMonth?string

Last month; default the current month (YYYY-MM, inclusive)

Match^\d{4}-(0[1-9]|1[0-2])$

Response Body

OK

application/json
  1. response
currency*|

Base currency of the ledger

months*array<string>

The months covered (YYYY-MM)

firstTransactionDate*|

Date of the oldest synced line (YYYY-MM-DD)

groups*array<>

Rubrieken with at least one account

result*array<number>

Result per month (sum of the groups)

total*number

Result over the whole range

curl -X GET "https://example.com/administrations/string/profit-and-loss"
{  "currency": "string",  "months": [    "string"  ],  "firstTransactionDate": "string",  "groups": [    {      "code": "string",      "name": "string",      "accounts": [        {          "ledgerAccountId": "string",          "code": "string",          "name": "string",          "rgsCode": "string",          "amounts": [            0          ],          "total": 0        }      ],      "totals": [        0      ],      "total": 0    }  ],  "result": [    0  ],  "total": 0}