A WooCommerce AFAS integration lets you exchange orders and other business data between your online store and AFAS Profit. That prevents duplicate data entry, but only if you first define which data to synchronise, which system is authoritative and what happens when an error occurs.
This guide focuses specifically on WooCommerce and AFAS Profit. AFAS SB is a different product with its own capabilities, so first check which AFAS environment you use. Looking for a broader technical framework? Read how to reliably integrate an online store and ERP.
Start with an overview of the data flows
Before the technical setup, define which system is the source for each data item. One possible arrangement is:
| Data | Possible source system | Usual direction |
|---|---|---|
| Items and SKUs | AFAS or PIM | To WooCommerce |
| Stock | AFAS or warehouse system | To WooCommerce |
| Online store prices | AFAS or WooCommerce | According to the commercial setup |
| Orders | WooCommerce | To AFAS |
| Payment status | Payment provider and WooCommerce | To AFAS |
| Sales contacts | AFAS | According to explicit matching rules |
| Delivery and invoice status | AFAS | To WooCommerce |
| Tracking information | AFAS, WMS or carrier | To WooCommerce |
This division is an example. Assign one owner to each piece of data to prevent conflicting updates.
Three ways to integrate WooCommerce with AFAS
1. A standard financial integration
An existing plugin or connector can be a good fit when you mainly want to transfer paid orders or financial entries. Check the scope carefully. A financial integration does not automatically handle products, stock, logistics status, returns or customer-specific prices.
2. A broader connector or integration platform
A connector or iPaaS solution can manage several data flows and often provides mapping, scheduling and error notifications. This is useful when your process fits within its supported capabilities and you do not want to maintain every component yourself.
3. A custom integration
Custom development becomes relevant when business-specific rules, multiple warehouses, B2B pricing, composite products or other systems form part of the same order flow.
How do the APIs work together?
WooCommerce uses the REST API v3 to provide access to orders, products and customers, among other data. With webhooks WooCommerce can notify an integration when, for example, an order, product or customer is created or updated.
AFAS Profit uses two types of connector, among others:
- GetConnectors for retrieving data from AFAS;
- UpdateConnectors for adding, updating or deleting data, where the relevant connector supports it.
An AFAS App Connector determines which specific GetConnectors and UpdateConnectors the integration can access. Authentication uses a token linked to that configuration and authorisation. The official AFAS API documentation describes the available endpoints and requirements.
Not every AFAS component sends events to external systems. Decide which data to retrieve periodically and check for missing or inconsistent records.
Define the main data flows separately
Products, prices and stock
Use a stable key to identify the same item in both systems, usually an SKU or item code. Define separately how variations, composite products, tiered prices and temporary offers are processed.
For stock, define what the displayed value means. Is it physical stock, available stock or saleable stock after reservations? A technically correct number can be commercially wrong if the two systems use different definitions.
Customers and sales contacts
Define when a WooCommerce customer becomes a sales contact in AFAS. Look beyond the email address. Business customers may have several contacts, delivery addresses or buyers. At the same time, you want to avoid every guest order creating a duplicate customer record.
Define matching rules for existing contacts and send uncertain matches to a review list. Automatically matching records using insufficiently reliable attributes can corrupt existing customer data.
Orders and payments
Explicitly map item codes, quantities, units, prices, discounts, VAT, addresses, shipping costs, payment method and payment status.
Also decide when an order goes to AFAS: immediately after checkout, only after successful payment, or after an additional check. The right moment depends on your sales and fulfilment process.
Delivery, invoicing and returns
An order does not end when it is created in AFAS. Define a separate status mapping for delivery, invoicing and tracking. An internal AFAS status may not correspond directly to a WooCommerce status that customers understand. Include partial deliveries, cancellations, credit notes and returns too.
Prevent duplicate orders and silent failures
Retain a fixed unique key, the WooCommerce order ID and the AFAS identifier for every transaction. After a timeout, first check whether AFAS has already created the sales order before writing it again. That prevents a temporary outage from becoming a duplicate order.
Make AFAS-specific problems recognisable, such as an unknown item code, a missing required field, an expired token or an inactive UpdateConnector. WooCommerce can disable webhooks after repeated delivery failures, so monitor both the processing queue and webhook status.
Also reconcile the systems periodically. For example, compare which paid WooCommerce orders have an AFAS identifier and which AFAS deliveries have not yet received a status update in WooCommerce. A more detailed framework for retries, error classification and recovery is available in Reliably connecting your online store and ERP.
Worked example: one order, two checks
The example below uses fictional references. It shows the evidence needed to complete a transfer. Receiving a webhook and processing an order in AFAS are two different events.
| Step | Example | What do you check? |
|---|---|---|
| Order received | WooCommerce order 1042 is paid. | Record the store, order ID and agreed trigger. A second notification for the same order is not a new order. |
| Validate the data | Order 1042 contains two units of item DEMO-20. | Check item mapping, quantities, addresses and amounts before writing. If the mapping is missing, correct the source or translation first. |
| Record the result | AFAS processes it as sales order 7801. | Keep the mapping 1042 → 7801 and check the connector response. A locally invented success status is not evidence. |
| Investigate a missing response | The connection drops before the response arrives. | Use the agreed reference to establish whether AFAS already processed the order. Write again only when it is clear that this will not create a second order. |
Check delivery as well. In WooCommerce, webhook settings are under WooCommerce → Settings → Advanced → Webhooks, and delivery logs are under WooCommerce → Status → Logs. An active webhook does not establish that every order was processed correctly in AFAS; compare orders on both sides too.
The WooCommerce documentation on webhooks and logs and the AFAS guidance on connectors and authorisation describe the technical foundations. The required fields and checks depend on your setup.
Want this flow implemented? The page Connect WooCommerce to AFAS describes the data flows, implementation approach and recovery arrangements. The data ownership matrix helps you prepare the source decisions.
Test more than the ideal order
Use a WooCommerce staging environment and an AFAS test or acceptance environment. Test at least:
- a normal consumer order;
- a business customer with a different delivery address;
- a guest order from an existing customer;
- discounts, shipping costs and a different VAT scenario;
- an unknown SKU and a duplicate webhook;
- temporary AFAS unavailability;
- a partial delivery;
- cancellation after payment;
- a return or credit;
- an order change after processing has started.
For each scenario, check both WooCommerce and AFAS, as well as what a team member and customer ultimately see.
Maintenance is part of the integration
WooCommerce, plugins, AFAS connectors and internal processes change. Define who receives error notifications, who may change mappings, how tokens are renewed, which checks run, how a failed order is reprocessed and which changes are tested on staging first.
What determines the cost?
The cost depends on the number of data flows, exceptions, order volume, available connectors and required monitoring. A one-way financial integration is less complex than two-way synchronisation of the catalogue, prices, stock, deliveries and returns.