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.
“Connecting WooCommerce to AFAS” sounds like one connection. In reality, it involves several data flows, each with its own direction, timing and failure scenarios. An order may need to reach AFAS immediately, while stock levels are updated periodically. A new customer may become a sales contact in AFAS, but not every guest order needs to create a new master record automatically.
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 is not a universal model. Some online stores manage their catalogue and content entirely in WooCommerce. In other organisations, AFAS is authoritative for items, prices and stock. The important rule is that each data item has one owner. If both systems can independently overwrite the same value, a conflict will arise sooner or later.
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 prices, composite products or other systems are part of the same order flow. An integration layer between WooCommerce and AFAS can receive events, translate data, monitor processing and later connect a WMS, carrier or service desk too.
For each approach, ask how exceptions are handled, how mappings are changed, which logs are available and who is responsible if the integration temporarily stops working.
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 part of AFAS emits events itself. Several outgoing flows therefore require periodic retrieval. A practical architecture often combines WooCommerce webhooks, a queue for controlled processing, AFAS connectors and a periodic check that detects 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
For each transaction, retain both the WooCommerce order ID and the resulting AFAS identifier. 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.
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.
A working integration is not a one-off project, but a managed part of your order process.
Frequently asked questions about WooCommerce and AFAS
Can a WooCommerce AFAS integration work in real time?
WooCommerce can report events immediately through webhooks. Data from AFAS often requires periodic retrieval, depending on the component. A hybrid approach usually provides a good balance between up-to-date information and manageable operation.
Can AFAS manage stock in WooCommerce?
Yes, if the right stock data is available through a GetConnector and it is clear which stock definition should be sent to WooCommerce. Account for reservations and sales that take place between synchronisations.
Does every WooCommerce customer automatically become an AFAS contact?
Not necessarily. Define rules for guests, existing contacts, business contacts and duplicate email addresses. Automatic processing is only sensible when matching is reliable.
What does a WooCommerce AFAS integration 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.
Build the integration around the order process
A good WooCommerce AFAS integration does more than deliver data. It prevents duplicate processing, makes errors recoverable and shows your team what has happened to an order.