Synchronising AFAS stock with WooCommerce without overselling

Reliably synchronising AFAS stock with WooCommerce takes more than regularly copying a number. First decide which stock is sellable, which warehouses supply it and how quickly changes must appear. Then clear item mapping, incremental processing and a recovery route are needed to minimise overselling.

No synchronisation can provide an absolute guarantee when several sales channels use the same stock simultaneously. You can, however, substantially reduce the risk of incorrect availability and make it visible when the online store falls behind.

Define sellable stock

Physical stock is not automatically the quantity available for online sale. Reservations, damaged items, incoming goods, safety margins and different warehouses may all affect it. Agree which AFAS value goes to WooCommerce as a business rule.

Answer at least these questions:

  • Which warehouses count towards online store stock?
  • Are outstanding orders or reservations already processed in AFAS?
  • Can the online store receive zero, a negative quantity or only available/unavailable?
  • Is safety stock needed?
  • How are composite products or bundles calculated?
  • What happens if an item temporarily cannot be read from AFAS?

Document the calculation as a business rule. Otherwise, a difference between AFAS and WooCommerce is too quickly treated as a technical fault when the systems may simply display different definitions of stock.

Make item mapping unambiguous

The integration must know which AFAS item belongs to which WooCommerce product or variation. A visible product name is unsuitable: names change and are not always unique. Use a stable item code or SKU and validate duplicate or missing values before publishing stock.

Variable products need extra attention. Stock may be tracked per variation while the parent product handles presentation only. For bundles, the sellable quantity may depend on the component with the lowest availability. Include these relationships in the mapping rather than leaving them as separate manual corrections in the online store.

Choose deliberately between intervals and events

Stock can be updated at fixed intervals or after a relevant change. An interval is easier to monitor and can process changed items in batches. Event-driven processing responds faster, but requires reliable events, filtering and handling for missing messages.

A practical combination is often appropriate: process changes selectively and periodically check that both systems still match. The periodic check then acts as a safety net for missed or stalled events, rather than replacing real-time processing.

Make processing incremental and traceable

Repeatedly publishing the entire catalogue places unnecessary load on systems and makes errors harder to trace. Where possible, process only items whose stock or relevant composition has changed. Retain enough context for each operation to identify the item, source value and online store result.

Distinguish three outcomes:

  1. Updated: WooCommerce has confirmed the new value.
  2. Skipped: no change was deliberately required, or the item was outside scope.
  3. Failed: mapping, source data or destination processing requires recovery.

A technically “successful run” means little if hundreds of items were silently skipped. Report counts and reasons for each outcome.

Prevent recovery from creating new errors

A temporarily unreachable online store must not cause stock changes to disappear. Persist the pending change and retry recoverable errors in a controlled way. A permanent error, such as an unknown SKU, should not be retried endlessly. Turn it into a specific administration task.

Watch the order of updates too. A delayed old stock value must not overwrite a newer one. Use a source version, modification time or another reliable ordering rule. After an uncertain outcome, check the current online store value if necessary before writing again.

Checkout also determines overselling

Even fast stock updates cannot resolve all concurrency. Two customers may check out the last item almost simultaneously. WooCommerce must therefore reserve stock and process an order atomically itself. Products that also consume delivery capacity or a time slot need a temporary capacity reservation as well.

Treat item stock and logistical capacity as separate constraints. A product can be in stock while no delivery option is available, or vice versa. In our guide to a reliable online store–ERP integration we explain why these process boundaries must be explicit.

Go-live checklist

  • AFAS is demonstrably authoritative for the agreed stock value.
  • Warehouses, safety margins and reservations are documented.
  • Every active SKU has exactly one valid mapping.
  • Variations and compositions have been tested.
  • Older updates cannot reverse newer data.
  • A checking process detects missed events.
  • Administrators can see failed items and items waiting too long.
  • A bulk recovery procedure exists without blindly overwriting everything.

Yindle Connect is designed to validate, translate, monitor and recover these data flows. Its combination with order processing is explained more concretely on WooCommerce–AFAS integration.

Frequently asked questions about stock delays

How often should stock be updated?

That depends on sales velocity, scarcity and operational risk. A generic “as often as possible” ignores limits and may create bottlenecks. Agree an acceptable delay for each product range, measure the actual age of published stock data and increase frequency only where it demonstrably adds value.

What does the customer see if AFAS is temporarily unavailable?

Choose deliberately between last known stock, temporarily unavailable ordering or a limited safety stock. Do not present false certainty. Flag internally when the source check is outdated and show administrators how long it has been since a confirmed update arrived.

How do you check a full migration?

Before switching over, compare a fixed set of simple products, variations, bundles, missing mappings and items from different warehouses. Then run a full comparison without writing immediately. Publish only once discrepancies are explained, and keep a fallback procedure ready for the first production cycle.

Make stock discrepancies investigable

For each change, retain at least the source value, warehouse rule used, calculated sellable value, destination system and confirmed outcome. Staff can then trace a discrepancy without manually copying product data from several screens. Limit history to what is needed for administration and accountability.

Want to establish which stock your online store should actually show and how to keep the workflow recoverable? Work through your stock chain with Yindle.

Previous insight
Next insight

Start with your question

Where does your team get stuck?

Your first enquiry does not need to be a technical brief. Tell us which systems you use and where work gets stuck. Together we discuss what is possible and which step you can take next.

Discuss my project