e-conomic REST API: a practical guide
What you need to know to read data from e-conomic: two tokens, pages of at most 1,000, filters in the query string and entries that live under the accounting year. Every example works on e-conomic's public demo agreement — copy and run.
Contents
Authentication: two tokens on every request
The base URL is https://restapi.e-conomic.com. Every request sends X-AppSecretToken (identifies your app — secret) and X-AgreementGrantToken (the customer's permission for their agreement) plus Content-Type: application/json.
For testing, e-conomic offers a public demo agreement: both tokens are simply "demo".
curl https://restapi.e-conomic.com/customers?pagesize=5 \
-H "X-AppSecretToken: demo" \
-H "X-AgreementGrantToken: demo" \
-H "Content-Type: application/json"
How a customer grants your app access
Your app has a public token (appPublicToken). The customer opens e-conomic's access page with it and your redirectUrl, signs in and approves. e-conomic sends the browser back with ?token=… — that is the customer's X-AgreementGrantToken. Store it encrypted; it is valid until the customer removes the app.
https://secure.e-conomic.com/secure/api1/requestaccess.aspx
?appPublicToken=<APP_PUBLIC_TOKEN>
&redirectUrl=https://example.com/e-conomic/callback
→ https://example.com/e-conomic/callback?token=<AGREEMENT_GRANT_TOKEN>
Paging: skippages and pagesize
Collections return 20 items by default and at most 1,000 with pagesize. skippages skips whole pages. The response has a pagination object with results, firstPage, nextPage and lastPage — follow nextPage until it is missing.
import requests
H = {"X-AppSecretToken": "demo", "X-AgreementGrantToken": "demo"}
url = "https://restapi.e-conomic.com/invoices/booked?pagesize=1000"
invoices = []
while url:
page = requests.get(url, headers=H, timeout=30).json()
invoices += page["collection"]
url = page["pagination"].get("nextPage") # absent on the last page
Filters and sorting
Filter with ?filter=property$operator:value. Operators: $eq, $ne, $gt, $gte, $lt, $lte, $like (supports *), $in and $nin (numbers only, e.g. customerNumber$in:[2,5,7]). Chain conditions with $and: and $or:, use parentheses for precedence, and always URL-encode the filter.
Sort with ?sort=name, descending with ?sort=-name. Only properties marked filterable/sortable in the schema can be used — otherwise the API answers 400.
Only changes since last time: filter=lastUpdated$gt:<timestamp> on e.g. /customers.
Entries live under the accounting year
There is no global /entries list to read by period: fetch /accounting-years, pick the years that overlap your period and read /accounting-years/{year}/entries with a date filter. The example returns 138 entries on the demo agreement.
curl -G https://restapi.e-conomic.com/accounting-years/2022/entries \
--data-urlencode 'filter=date$gte:2022-01-01$and:date$lte:2022-06-30' \
--data-urlencode 'pagesize=1000' \
-H "X-AppSecretToken: demo" -H "X-AgreementGrantToken: demo"
Pitfalls we hit ourselves
- Boolean fields are omitted when false — a missing barred means active.
- Amounts are kroner with decimals; convert to øre (integers) before you add them up.
- An entry in a foreign currency has amount in its own currency. Use amountInBaseCurrency — otherwise your profit and loss won't match e-conomic's own totals.
- Fair use is about 50,000 calls per 24 hours per agreement. Cache data and fetch only changes.
- Idempotency-Key applies to write calls only, not GET.
Or let JaKonto do it
JaKonto handles tokens, paging, accounting years, currency and fair use and gives you invoices, entries, accounts and contacts in the same shape as from Billy and Dinero — plus VAT, profit and loss and CSV. Try it free on e-conomic's demo company:
curl -X POST https://jakonto.dk/api/v1/connections/economic-demo \
-H "X-API-Key: jk_live_…"
curl https://jakonto.dk/api/v1/connections/$ID/invoices \
-H "X-API-Key: jk_live_…"
Questions
Where is the official e-conomic API documentation?
At restdocs.e-conomic.com. Every collection has a JSON schema that shows which fields can be filtered and sorted.
Can I test the e-conomic API without a subscription?
Yes. Set both X-AppSecretToken and X-AgreementGrantToken to "demo" and call e.g. /customers.
How many items can I fetch per page?
At most 1,000 (pagesize=1000). The default is 20.
Does JaKonto write to e-conomic?
No. JaKonto only reads.
e-conomic API integration · Billy API integration · Dinero API integration · MCP server