Soliddeploy

The AFAS API: how to connect AFAS Profit to your webshop

With the AFAS API, your webshop, marketplace integration or dashboard can exchange data with AFAS Profit: orders go in, items and debtors come out. Here you can read how that works technically, where the limits are and what needs to change before 31 August 2027.

Written by Founder of SolidDeploy ·

In short
  • The AFAS API consists of connectors: a GetConnector retrieves data from AFAS Profit and an UpdateConnector puts data into it. An app connector determines which connectors an integration may use.
  • Does your integration use a classic token? Then that token will get an end date. After 31 August 2027 you can no longer use your own app connectors with a classic token, and you must have switched to OAuth.
  • Always retrieve data in batches (skip/take), with a filter and a sort order. If you don't, you only get 100 rows by default or you run into the time-out of about 15 minutes.

What exactly is the AFAS API?

The AFAS API is how other software exchanges data with AFAS Profit. To call it, you always need an environment ID and a token [1].

AFAS itself doesn't talk about "endpoints" but about connectors. There are two main types:

  • GetConnectors retrieve data. These are dynamic endpoints: you decide which dataset comes out [1]. The response comes as JSON, XML or CSV [3].
  • UpdateConnectors add, change or delete data in AFAS [3]. One example is FbSales, which you use to add sales orders [9].

A simple example: your webshop wants to show the items from AFAS. To do that, you build a GetConnector in AFAS with the fields the webshop needs, such as item code, description and price. When an order comes in, it goes the other way, via an UpdateConnector.

New to APIs? Then first read what an API is, with examples from your own webshop.

What can a webshop or wholesaler connect with the AFAS API?

Everything that is in AFAS Profit and fits into a GetConnector or UpdateConnector. For a webshop or wholesaler, it usually comes down to three flows: orders from the webshop to AFAS, item and customer data from AFAS to the webshop, and figures from AFAS to a dashboard.

In practice, those flows look like this:

  • Orders to AFAS. An order from your webshop or a marketplace becomes a sales order in Profit via an UpdateConnector [9]. You no longer have to retype it.
  • Data from AFAS. A GetConnector delivers exactly the fields you need, such as items, prices or debtors. That's because you put the dataset together yourself [1].
  • Reporting. A dashboard retrieves revenue, outstanding items or order status every night or every hour.

Our view. For webshops, the order flow is usually the integration that pays off fastest: nothing has to be retyped by hand any more and fewer orders go wrong. Syncing stock across multiple channels is harder, because timing is critical there. In preventing overselling with one stock across multiple channels you can read where that goes wrong.

How do you call the AFAS API?

You send a request to your own AFAS environment, with your token in the header. The value in that header is the Base64 string of the token, including the XML tags [1]. Start with a metainfo call: it lets you check that the header and token are correct [1].

You can tell which environment you are calling from its name. If your environment is called O12345AA, for example, then 12345 is the participant number [2]. The first letter indicates the type of environment:

Name starts withType of environment
OProduction
TTest
AAcceptance

Source: AFAS, Calling a connector via Profit Rest Service [2]. As of November 2026.

The token must always be sent Base64-encoded [1]. That is the most common mistake on a first call: someone pastes the token into the header as is, without encoding it first, or leaves out the XML tags. If the metainfo call works, you know this part is right and you can move on to the real connectors.

Also note:

  • Every request must go over TLS 1.2 [1]. Two-way SSL is not possible with an AFAS integration [10].
  • An API call can be no more than 75 MB in total [1].
  • You cannot include more than two elements in one address [1].

For testing, you can use the test tool on connect.afas.nl. There you put filters, sorting and skip/take directly in the URL [2]. That way you see what a GetConnector returns before a single line of code has been written.

How do you get a token for the AFAS API?

A token belongs to an app connector in AFAS Profit. That app connector specifies which Get and Update connectors the token may use [3]. A token applies to one combination of environment, app connector, user and device [5].

Three things to know before you start:

  • Use a separate app connector for each integration. That is AFAS’s own advice [11]. If you connect the webshop, the dashboard and the marketplace integration separately, you can switch one off without the others stopping.
  • Copy the token straight away. With a classic token, you can no longer view the token in Profit once the wizard is finished [6]. So store it immediately in a safe place, such as a password vault.
  • An idle integration gets blocked. App connectors that have not been used for 6 months or longer are blocked [11]. Keep this in mind for seasonal integrations, such as one that only runs around the holidays.

If a user or tool needs to obtain a token itself, that is possible with an activation code: by applying that code, the user receives a token [5].

What changes with OAuth and when do you need to switch?

AFAS is phasing out classic tokens for your own app connectors. From September 2026, existing classic tokens have an end date of 1 May 2027 [8]. Your own app connector must be on OAuth by 31 August 2027 at the latest, because after that you can no longer use your own app connectors with a classic token [8].

DateWhat happensWhat you do
September 2026Existing classic tokens get an end date: 1 May 2027Map out which integrations use a classic token
1 May 2027End date of the existing classic tokensMake sure your integration has switched over before that date
31 August 2027Deadline for moving your own app connectors to OAuthEvery integration of your own runs on OAuth
After thatYour own app connectors with a classic token can no longer be usedNothing, if you switched over in time

Source: AFAS, Switching from classic tokens to OAuth [8]. As of November 2026.

With OAuth, an integration no longer works with one fixed token. An access token is only valid for 1 hour [7]. With the client credentials flow, a refresh token is not needed [7]: the integration simply requests a new access token when the old one has expired. Note: once you have created the app connector, you can no longer change the authentication type [7]. So choose OAuth right away when you create it.

For the code of your integration, this is a real change. An integration that currently reads a token from a configuration file and keeps using it for years will have to track when the access token expires and fetch a new one in time.

Watch out. Your integration does not stop because something changes in your webshop. It stops because the token expires. An integration that has been passing orders through flawlessly for years can therefore grind to a halt around 1 May 2027. Often the party that originally built it is no longer involved by then. Check now who manages the code of your integration, and whether that code can handle a 1-hour access token.

How do you retrieve large amounts of data with the AFAS API without getting stuck?

Retrieve data in batches with skip and take, always with sorting and preferably with a filter. Without skip/take you only get the first 100 rows back [1]. Retrieve too much at once and you run into the time-out.

This is how it works. You request, for example, ?skip=0&take=500, then ?skip=500&take=500, and so on. Each batch is a separate call, and you only stop when a batch comes back with no records [4]. With 1,800 items, you get four batches with data and a fifth that is empty. AFAS explicitly adds: always use sorting when working with skip/take [4]. Without a fixed order, you can receive rows twice or miss them entirely.

AFAS also recommends always filtering on a GetConnector, because it improves speed [4]. A filter on item group, branch or date makes the response smaller and the call faster.

LimitValueConsequence
Rows without skip/take100You silently miss data
Time-outabout 15 minutesThe call is aborted
URL length (including filters)2,048 charactersLong filters do not fit
Size of a single call75 MBLarge files or batches do not fit
Number of callsfair-use policy, no figure givenExcessive use may be restricted

Source: AFAS, REST API for developers [1]. As of November 2026.

Our view. For an integration that runs every hour or every night, it is better to fetch only what has changed. So add a modified date to your GetConnector and filter on it. Each run then fetches a handful of rows instead of your entire product file, and you stay well within the time-out and the fair-use policy.

How do you put a webshop order into AFAS Profit via the AFAS API?

With UpdateConnector FbSales. You send the order details and the order lines, and AFAS Profit turns them into a sales order [9]. An order without lines and without a quotation number is rejected [9].

Three things that need attention with a webshop order:

  • The delivery address. For the delivery address, you first look up the internal ID in Profit [9]. If a customer ships to a new address, you need an extra step before the order can go in.
  • The order proposal. An order via the UpdateConnector takes the order proposal into account [9]. Lines of type Rest (a stock shortage on the order line) and Altijd (always) end up in the order proposal [9]. Your buyer sees right away what needs to be ordered.
  • The lines. Have your integration check that an order actually has lines before sending it. An empty order will be rejected anyway [9], so it is better to catch and report the error yourself.

What often goes wrong with an AFAS API integration?

Most problems have nothing to do with the code, but with the setup: a token that is not Base64-encoded, a connector that is not in the app connector, or a fetch run without sorting. These are the errors we see most often, with the fix:

  1. No call works at all. The token was not sent as Base64, or the XML tags are missing [1]. Test with a metainfo call first.
  2. A new GetConnector does not work. You can only call GetConnectors that are activated in the app connector [1]. So a new GetConnector must also be switched on in the app connector.
  3. Exactly 100 products in the webshop. Skip/take is not in the call, so AFAS only returns the first 100 rows [1].
  4. Duplicate or missing rows. You are using skip/take without sorting [4].
  5. Integration stops after a quiet period. The app connector has not been used for 6 months or more and has been blocked as a result [11].
  6. Integration stops in 2027. The classic token has reached its end date [8].

A general lesson that applies to every integration: log every failed call and send an alert as soon as an order has not arrived in AFAS. An order that silently disappears is something you only notice when the customer calls.

Build an AFAS API integration yourself or have it built?

That depends on what you want to connect and who maintains the integration afterwards. If you only want to read data from AFAS for an overview, the test tool on connect.afas.nl [2] and a few GetConnectors will get you a long way on your own. If you sync orders, customers and stock in both directions, you need error handling, logging and maintenance.

SituationWhat usually fitsWhy
Figures from AFAS in an overview or spreadsheetDo it yourself with a GetConnectorYou only read, so little can break
Your webshop platform has a ready-made AFAS integration that fitsUse thatSomeone else maintains it
Orders from multiple channels, custom pricing agreements or custom fields in AFASHave a custom integration builtStandard integrations rarely account for your setup
Existing integration with a classic tokenHave it checked nowIt must run on OAuth by 31 August 2027 at the latest [8]

Our view. With AFAS, the work rarely lies in the API call itself. It lies in deciding which data is the source of truth: which system sets the price, which system holds the stock, and what happens if an order fails halfway. Discuss that with your AFAS administrator first, before a single line of code is written. What else to sort out before anyone builds an integration for you is covered in having an API integration built.

SolidDeploy is a dedicated tech team for e-commerce, retail and wholesale. We build integrations and dashboards on the systems you already use, including AFAS. After a free consultation, we start within 2 weeks. The packages are on the pricing page. Using Exact Online instead of AFAS? Read Exact Online integration: how the API works.

Frequently asked questions

Is the AFAS API free?

The AFAS documentation we read does not mention a separate price per call. AFAS Online does apply a fair-use policy to retrieving data [1]. Check exactly what your licence covers with AFAS or your AFAS partner.

Where can I find the AFAS API documentation?

The documentation is in the AFAS Help Center, under "REST API voor ontwikkelaars" [1]. You can test with the test tool on connect.afas.nl [2].

What is the difference between a GetConnector and an UpdateConnector?

A GetConnector retrieves data from AFAS Profit. An UpdateConnector adds, changes or deletes data in AFAS [3]. So a webshop reads products with a GetConnector and places orders in AFAS with an UpdateConnector, such as FbSales [9].

I have lost my token. Can I view it again?

Not with a classic token: once you complete the wizard, you can no longer view the token in Profit [6]. You will need a new token. Since classic tokens are being given an end date anyway [8], this is a good moment to plan the move to OAuth.

How long is an OAuth access token valid?

An OAuth access token is valid for 1 hour [7]. After that, your integration has to request a new access token. With client credentials, you do not need a refresh token for this [7].

Does my AFAS integration have to move to OAuth?

Yes, if it is a custom app connector with a classic token. Existing classic tokens have an end date of 1 May 2027. The app connector must be on OAuth by 31 August 2027 at the latest, because after that you can no longer use custom app connectors with a classic token [8].

What would this do for you?

Describe in the Idea scan what you want to improve. You get a few targeted questions, your idea is then laid out clearly and we prepare a free consultation.

Take the check

Sources

  1. AFAS Software, REST API voor ontwikkelaars, Help Center Nederland, accessed 23 November 2026
  2. AFAS Software, Connector aanroepen via Profit Rest Service, Help Center Nederland, accessed 23 November 2026
  3. AFAS Software, Connector: externe software koppelen met Profit (API), Help Center Nederland, accessed 23 November 2026
  4. AFAS Software, GetConnector (REST/JSON), Help Center Nederland, accessed 23 November 2026
  5. AFAS Software, Token genereren voor de Profit Rest Services, Help Center Nederland, accessed 23 November 2026
  6. AFAS Software, Eigen app connector inrichten in vogelvlucht (Classic token), Help Center Nederland, accessed 23 November 2026
  7. AFAS Software, Eigen app connector inrichten o.b.v. OAuth-token (t/m Profit 8), Help Center Nederland, accessed 23 November 2026
  8. AFAS Software, Overstappen van classic tokens op OAuth, Help Center Nederland, accessed 23 November 2026
  9. AFAS Software, Orders toevoegen, wijzigen of verwijderen (UpdateConnector FbSales), Help Center Nederland, accessed 23 November 2026
  10. AFAS Software, Endpoints van Profit Connectoren (SOAP/XML en REST/JSON), Help Center Nederland, accessed 23 November 2026
  11. AFAS Software, Eigen app connector toevoegen, Help Center Nederland, accessed 23 November 2026
Further reading

What is the first thing we should tackle?

Tell us about a process that takes too long, an agent you have in mind or an opportunity you have not got round to yet. We show you what it delivers and how it fits your business.