maesn
Coming soon

The AFAS API, explained for teams building for the Netherlands

AFAS Profit is the ERP system of AFAS Software, a Dutch family business, and brings finance, HR, payroll, orders and projects into one solution. If your customers in the Netherlands work with it, here is how its API handles connectors for reading and writing, authentication, webhooks, operating rules and certification, as the vendor documents it. The maesn integration is coming soon.

YOUR PRODUCT+28
Trusted by winning software teams
HubSpotTipaltiPaywiseRallyQredNordhealthFindityFintoClockinHEROHolviLanes & PlanesAgicapHubSpotTipaltiPaywiseRallyQredNordhealthFindityFintoClockinHEROHolviLanes & PlanesAgicap
The system

What AFAS does for Dutch organisations

AFAS Profit handles all administrative processes of an organisation in one software solution with one database, so data is recorded once.

AFAS Software is a family business from the Netherlands, founded in 1996. It offers two products, each with an API of its own: Profit, an ERP solution for all business processes, and AFAS SB, the solution for entrepreneurs, startups and growing companies.

Function areas
  • Finance

    One financial basis for the whole organisation. Dashboards show directly where action is needed.

  • HRM

    Connects HR, payroll, recruitment, talent and self-service. Employees handle more themselves.

  • Payroll

    Brings HR, payroll, collective labour agreements and controls together in one solution.

  • Order management

    Connects sales, stock, purchasing, warehouse and finance in one ERP system.

  • Projects

    Brings customers, projects, hours, costs and invoicing together in one system. Employees book hours through the app.

  • CRM

    Brings business relations, interactions, sales opportunities and dossiers together in one CRM.

The Profit API

How the AFAS API is built

AFAS documents one API for Profit and a separate one for AFAS SB. The Profit API is reachable through REST with JSON and through SOAP with XML, and the vendor's developer documentation focuses on REST.

An integration exchanges data with Profit through connectors. A GetConnector is an endpoint that reads records from the Profit database, and an UpdateConnector adds, changes or deletes them. The app connector is the part of Profit through which an app is integrated: the customer's administrator sets it up, authorises the GetConnectors and UpdateConnectors in it and creates the credentials there.

What an app can reach in one AFAS environment
The customer's Profit environmentA customer usually works in one environment; several are possible.
App connectorSet up by the customer's administrator
GetConnectorsRead records
Profit_DebtorProfit_AccountsProfit_Transactions
UpdateConnectorsAdd, change or delete records
FiEntriesKnOrganisation
Credentials
Created here: the token for the classic method; for OAuth, a client_id and, where the client uses one, a client_secret.
In the environment, not linked to this app connectorProfit_CreditorFbSales

An app can call only the connectors linked to its app connector. An administrator can add any number of app connectors.

The address of the API carries the number of the customer's environment and its type. Profit has three types of environment: production, test and accept.

One address per environment type
Production
https://12345.rest.afas.online/ProfitRestServices/connectors/Profit_Employees?skip=0&take=1The live environment in which customers work.
Test
https://12345.resttest.afas.online/ProfitRestServices/connectors/Profit_Employees?skip=0&take=1Usually a copy of production with a snapshot of live data, meant for testing.
Accept
https://12345.restaccept.afas.online/ProfitRestServices/connectors/Profit_Employees?skip=0&take=1The first environment to receive a new Profit version, where customers test it.
Environment number
12345 in the vendor's example: the number of the customer's environment.
Service and type
rest for production, resttest for test and restaccept for accept.
Endpoint
The connector being called, here the GetConnector Profit_Employees.
Parameters
Here skip and take, which page through the records.
Coverage of the API

What the AFAS Profit API covers

For Profit 9, the vendor's OpenAPI specification, the machine-readable description of the API, covers 23 areas with 707 distinct operations. An operation is one HTTP method on one endpoint.

The specification describes the connectors that are delivered with Profit. Which GetConnectors a customer's environment holds is decided by its administrator, who can create new ones. Of these, an app reaches only the GetConnectors that its app connector includes.

In the Finance group, the specification lists UpdateConnectors that write financial entries, electronic purchase invoices and SEPA direct debits. GetConnectors read ledger accounts, VAT codes and the outstanding items of debtors and creditors.

Areas of the AFAS Profit API23 areas, grouped as in the vendor's API documentation
  • CRMOrganisations and persons · Dossiers, attachments and workflows
  • Human resourcesEmployee and contract · Leave and illness · Payroll administration · Recruitment and selection · Employer settings · Other
  • FinanceFinancial transactions · Budgets and assets · Financial setup
  • Projects, construction and flexProjects and post-calculation · Flex (temporary staffing) · Construction
  • Sales, purchasing and warehouseSales and orders · Purchasing · Articles · Warehouse · Course management
  • FiscalTax declarations for corporate income tax and personal income tax
  • Housing associationsReal estate and valuation
  • BakeriesItems and production
  • SetupOne area that the vendor's documentation lists under every group
Reading and writing

GetConnectors read, UpdateConnectors write

A GetConnector returns records in pages of 100 by default. An UpdateConnector takes one nested message for a record and its sub-objects.

A GetConnector is built from the fields of one data collection, which consists of one or more tables. It can contain a built-in filter, and each request can apply a filter of its own. A metainfo request returns a GetConnector's fields with type, label and length. Profit delivers standard GetConnectors, and AFAS advises always creating a new one, so that the fields in it are a deliberate choice.

Reading in pages with skip and takeFrom the vendor's GetConnector documentation
Records of a GetConnector, sorted
  1. skip=0take=100
  2. skip=100take=100
  3. skip=200take=100
  4. skip=100000Generally too slow from here on. AFAS advises splitting the data with a filter per request.
Default
Without parameters, skip is 0 and take is 100.
Sorting
AFAS requires sorting with orderbyfieldids whenever a request uses skip and take. Unsorted, records can go missing or appear twice.
Page size
The vendor's rule of thumb for one request: fields times records below 150.000.

The vendor's example of an UpdateConnector message is a journal entry with three lines on the accounts 10001, 8010 and 1510. Dutch charts of accounts have freely chosen account numbers. Which ledger accounts a customer's environment holds can be read with a GetConnector that the specification lists.

A journal entry as an UpdateConnector message
Message, abridged from the vendor's example
POST…/connectors/FiEntries
{
"FiEntryPar": {
"Element": {
"Fields": { "Year": "2026", "Peri": "1", "UnId": "1", "JoCo": "20" },
"Objects": {
"FiEntries": {
"Element": [
{ "Fields": { "VaAs": "2", "AcNr": "10001", "AmDe": "12100", "AmCr": "0" } },
{ "Fields": { "VaAs": "1", "AcNr": "8010", "AmDe": "0", "AmCr": "10000", "VaId": "1" } },
{ "Fields": { "VaAs": "1", "AcNr": "1510", "AmDe": "0", "AmCr": "2100", "VaId": "1" } }
]
}
}
}
}
}
What it books
AccountDebitCredit
Debtor 1000112.100
Ledger account 8010VAT code 110.000
Ledger account 1510VAT code 12.100
Total12.10012.100
FiEntryPar
The name of the main object. It can differ from the connector name in the address: here the connector is called FiEntries and the main object FiEntryPar. FiEntries is also the name of the sub-object that holds the lines.
Element
One record. An array carries several records of the same type.
Fields
The field values of the record, here financial year, period, administration number and journal.
Objects
The sub-objects below the record, here the three lines of the entry. In each line, VaAs marks the account as a ledger account (1) or a debtor (2).

Profit accepts a financial entry only when debit and credit are equal. Main record and lines are added in one request.

Which of POST, PUT and DELETE an UpdateConnector supports differs from one connector to the next. Before a POST creates a record, Profit validates the record: a financial entry has to balance and a postal address needs a country code. A request that fails the validation returns HTTP 500 with a short message.

With @Action in Fields, each record can name an action of its own, insert, update or delete, which takes precedence over the HTTP method for that record. Profit first validates the full body and then processes it as one transaction.

Access

OAuth and classic tokens in the AFAS API

The Profit API has two ways to authenticate. OAuth is the one AFAS recommends and the default for all new integrations. The classic token is being phased out and will stop working after 31 August 2027.

The vendor's timeline for classic tokens
  1. September 2026

    Existing classic tokens get an end date of 1 May 2027.

  2. 1 May 2027

    Existing classic tokens expire. New ones can still be created, with a limited validity.

  3. 31 August 2027

    The last day on which app connectors with a classic token work.

With a classic token, the app sends the same fixed key with every request, in the Authorization header with the prefix AfasToken. With OAuth, the app first requests a temporary access token and uses it for every request. AFAS bases its OAuth on the OAuth 2.1 Internet-Draft.

Three ways to get a tokenFrom the vendor's OAuth documentation
No user: an automatic integration between two systems
FlowClient credentials. The app requests the token itself and works as the user set in the app connector.
Client authenticationClient secret, or private key JWT from Profit 9 onwards
TokensAn access token, valid for the seconds in expires_in, 3600 in the vendor's example. No refresh token.
A user, in an app with its own backend
FlowAuthorization code with PKCE. The user signs in to Profit, and Profit checks whether the user is a member of the authorisation group linked to the app connector.
Client authenticationClient secret, or private key JWT from Profit 9 onwards
TokensAn access token and a refresh token. Each refresh token can be used once. Together the refresh tokens are valid for at most 30 days, counted from the first one; then the user signs in again.
A user, in a browser app, mobile app or desktop app
FlowAuthorization code with PKCE, as a public client, from Profit 9 onwards
Client authenticationNone: a public client has no secret. PKCE and DPoP are mandatory.
TokensAn access token of the type DPoP and a refresh token. DPoP binds the access token to a key that only the app holds, so a stolen token is useless.
New from Profit 9The version AFAS has been delivering to customers since mid-November 2026
Private key JWT
A confidential OAuth client authenticates with a client secret or, from Profit 9 onwards, with a private key JWT. A public client has no secret.
Client secrets expire
Every client secret has a validity period, 180 days by default. After it, Profit refuses token requests with that secret. A new secret is generated in the app connector.
Switching to OAuth
An existing app connector can be switched to OAuth or to Hybrid, a setting in which classic token and OAuth temporarily work side by side.
Changes

Webhooks and changed data in AFAS Profit

Profit offers webhooks on its dossier, which the vendor's documentation lists under CRM. A dossier item is a typed record that can carry attachments and reactions and run through a workflow. A notification goes out when a dossier item or a reaction to it is added, changed or deleted, and when a workflow enters a task or executes an action.

A notification says that something has changed, not what has changed, so the integration fetches the changed data with a GetConnector.

Webhooks are set up in Profit per app connector, and each webhook gets a URL and a password. Per type of dossier item and per workflow, the administrator then chooses which changes, tasks and actions send a notification. Profit signs every notification with the password and sends the signature in the header X-Profit-Signature-256.

From a change in Profit to the receiving endpoint
  1. A change in Profit

    Profit: The change is registered as an event and a batch job is scheduled. Nothing is sent at the moment of the change.

    Registered
  2. The batch job sends

    Profit: It posts the notification to the receiving HTTPS endpoint, with EventId, EnvironmentId and Timestamp.

    Pending
  3. The endpoint confirms

    Receiving endpoint: It answers with a 2xx within 2 seconds and processes the notification afterwards.

    Success
  4. The integration reads

    Receiving endpoint: The notification names the dossier item, called subject in the event types, not the change. A GetConnector returns the changed data.

Without a 2xx within 2 seconds, Profit sets the event to Retry and tries again, with a longer interval after each attempt. After too many failed attempts the event is Failed. A webhook whose endpoint cannot be reached for a longer period is blocked automatically. When identical events follow each other quickly, Profit sends a notification for the last one only and sets the others to EntityRateLimited.

Event types
  • subject.created
  • subject.updated
  • subject.deleted
  • subject.reaction.created
  • subject.reaction.updated
  • subject.reaction.deleted
  • workflow.task.entered
  • workflow.action.executed

For other data, the documentation describes polling. A GetConnector can be filtered on the field that holds the modification date, and then returns what was added or changed on or after a given date and time.

Operating rules

Fair use, timeouts and Profit releases

AFAS applies a fair use policy to its API. The documentation names no maximum number of requests per period.

The rules at a glanceFrom the vendor's documentation
Fair use
The ten heaviest users of each day receive a message to adjust their process.
Simultaneous requests
At most five at a time, according to the GetConnector page. The troubleshooting page names eight.
Timeout
900 seconds, then error code 500 with the message “Command timeout expired.” AFAS asks to wait 15 minutes before a retry.
Maintenance
A 503 can carry retry_after, 7200 in the vendor's example for scheduled maintenance.

In some cases AFAS blocks a GetConnector, because it is called so often that other users experience performance problems. The customer's administrator unblocks it once the problem is solved.

An error in the 5xx range returns a short message, an error number and a profitLogReference. With that reference, a Profit administrator finds the full error in the log of the environment.

A new Profit version can change connectors. The release notes for Profit 9 list breaking changes, for example to a GetConnector that now returns one row per period and to an UpdateConnector in which two fields have moved to another object of the message.

Two releases a year
  1. Jan
  2. Feb
  3. Mar
  4. Apr
  5. May
  6. Jun
  7. Jul
  8. Aug
  9. Sep
  10. Oct
  11. Nov
  12. Dec
  • A new Profit version, around June and around November
  • Migration of all customer environments, up to 3 months

Accept environments receive a new version first. Each customer is told the date on which its environments migrate.

Going live

From test environment to certified AFAS integration

AFAS offers test environments only within licences. A test environment filled with demo data comes in two ways: an AFAS customer provides a token or access, or the developer joins the AFAS Partner Programme, which involves costs. The programme certifies standard integrations and supports their development.

A token applies to one environment: one for a test environment does not work in production, and going live can require a new one. The developer tests and goes live in consultation with the customer's Profit administrator.

Three phases to a certified integration
  1. Phase 1

    Start the certification

    • A pentest, done or scheduled, or a Security Quickscan in its place
    • Contact persons in the AFAS customer portal
    • Support+, free to activate, which gives AFAS access to the partner's test environment when the partner sends a question
  2. Phase 2

    Build

    • A course by AFAS on calling the API, free for one colleague
    • The IntegrationId, the number of the integration, as a header in every request
    • A set of GetConnectors of its own
    • A check with the AppConnector Auditor
    • A data flow diagram of the integration
    • An implementation document for the customer's administrator
  3. Phase 3

    Deliver

    • A demo for AFAS
    • Publication on the partner portal
    • 5 or more joint customers, checked through the IntegrationId
What AFAS requires of a certified integrationFrom the vendor's documentation on certification
App connector
The customer creates the app connector.
Authentication
Authentication runs through OAuth. A classic token is allowed for testing.
GetConnectors
The integration brings its own set of GetConnectors, which the partner makes available to customers, for example as a download to import. Customers should need to deviate from the certified GetConnectors by 10% at most.
Check
The AppConnector Auditor shows whether an app connector meets the requirements.
With maesn

How the maesn Unified API will cover AFAS

You integrate once against the maesn Unified API and reach 30+ ERP and accounting systems.

Connect once and sync data the exact same way with every system you need to support: one integration, one data model, one authentication flow.

Once the AFAS integration is live, you reach it through the same Unified API as every other system.

The Unified API for connected systems
Trusted by

Fintechs already build their integrations on maesn

Companies including Tipalti, Agicap, Findity and Rally rely on maesn to connect their products to Europe's ERP and accounting landscape.

Maesn is built and hosted in Germany, is ISO 27001 certified and GDPR compliant and passes API calls between your system and the target platform in real time without storing customer data.

If your customers in the Netherlands work with AFAS, tell us which data your product needs.

AFAS FAQ

AFAS API questions

Is the AFAS integration available on maesn today?

The integration is coming soon. Until then there is no object coverage to show and no endpoint to call. This page follows the vendor's documentation. We update and extend it once the integration is live. If AFAS is on your roadmap, book a call.

What is AFAS?

AFAS is a software company from the Netherlands, a family business founded in 1996; the name stands for Applications For Administrative Solutions. Its ERP solution, Profit, handles all administrative processes in one solution with one database, and AFAS SB is its product for entrepreneurs. According to its website, more than 14.000 organisations rely on AFAS.

What is AFAS Connect?

AFAS Connect is, in the vendor's words, the online tool for building and testing connectors. AFAS also calls it its own test platform for developing and testing requests, available to anyone who creates an account. Connectors are how other applications exchange data with AFAS software: a GetConnector retrieves data and an UpdateConnector writes data.

How does authentication work in the AFAS API?

The AFAS API authenticates with OAuth or with a classic token. OAuth is recommended and the default for new integrations: the app requests a temporary access token and uses it for every request. Where no user signs in, AFAS names the client credentials flow; where a user signs in, the authorization code flow with PKCE.

When do AFAS classic tokens stop working?

AFAS classic tokens will stop working after 31 August 2027, the last day on which an app connector with a classic token works. Existing classic tokens will expire earlier, on 1 May 2027. New classic tokens can still be created then, with a limited validity. AFAS recommends OAuth, the default for all new integrations.

Does AFAS send webhooks?

Yes, Profit sends webhooks for dossier items, for reactions to them and for workflows. A notification says that something has changed, not what has changed, so the changed data is fetched with a GetConnector. Profit sends notifications from a batch job by HTTP POST, signs each one and retries after a failed delivery.

What are the rate limits of the AFAS API?

The documentation names no maximum number of requests per period. AFAS applies a fair use policy: each day the ten heaviest users receive a message to adjust their process, and AFAS can block a GetConnector that slows down other users. The GetConnector page names at most five simultaneous requests and the troubleshooting page eight; requests time out after 900 seconds.

How does an integration get certified by AFAS?

An integration is certified through the AFAS Partner Programme in three phases: start, build and deliver. AFAS requires a pentest or a Security Quickscan, OAuth, a dedicated set of GetConnectors, the IntegrationId in every request, a data flow diagram and an implementation document. After a demo, certification is complete with five or more joint customers.

Sources: afas.nl, docs.afas.help, help.afas.nl