AFAS customer synchronisation: field direction and inbound sync
Customer synchronisation between i-Reserve and AFAS is direction-controlled per field. The integration's Parameters show one row per active customer/company field with the direction, the AFAS connector and the AFAS field name. This lets you decide per field who owns the data.
1. Direction per field
| Direction | Outbound (i-Reserve → AFAS) | Inbound (AFAS → i-Reserve) |
|---|---|---|
| i-Reserve leading (default) | Field is pushed to AFAS | Incoming value is ignored |
| AFAS leading | Field is not sent | Incoming value overwrites i-Reserve |
| No sync | — | — |
AFAS leading takes a GetConnector + field name (where the value comes from); i-Reserve leading takes an UpdateConnector object such as KnOrganisation, KnPerson, KnBasicAddressAdr or KnContact (where the value is written to).
2. When is the debtor created in AFAS?
A customer registration in i-Reserve does not push to AFAS automatically. The debtor is created the first time it is needed:
- On invoicing — when an invoice is finalised, the integration looks up the debtor; if it does not exist, it is created.
- Manually — via the AFAS action button on the customer card.
On creation, only fields with direction i-Reserve leading are written to AFAS. The returned debtor code is stored in the customer's external-id field, so later synchronisations find the right debtor immediately. This prevents half-filled debtors and unnecessary write actions on every registration.
3. Manually from the customer card
- Send to AFAS — creates or updates the debtor according to the field directions.
- Fetch from AFAS — pulls the AFAS-leading fields on demand.
- Debtor and invoice details — shows the current AFAS data next to the i-Reserve values, including the synchronisation status per invoice.
4. Inbound sync (AFAS → i-Reserve, optional)
With inbound sync, a background task periodically pulls changed debtors from AFAS (interval configurable, default every 30 minutes). The task filters on debtors changed since the previous successful run; this requires a modification-date field in the debtor GetConnector — without it, the full list is pulled every time.
For each pulled debtor:
- Match, in order: external id → debtor number → e-mail address. An existing, not-yet-linked customer with the same debtor number or e-mail address is linked instead of duplicated.
- No match → optionally a new customer is created (configurable).
- Fields → only fields with direction AFAS leading are updated. Optionally the contact person data from the contact GetConnector is merged in as well.
- Company mode → when a company link field is configured, the AFAS debtor maps to a company (created if missing) and contact persons become customers under that company.
5. Conflicts, audit and loop prevention
- If a user changes a field in i-Reserve that is set to AFAS leading, the next inbound run overwrites that value again — AFAS wins on its own fields. The conflict is logged explicitly.
- Every incoming change produces an audit record with both the old and the new value, so changes are always traceable.
- During an inbound run, loop prevention is active: saving the customer does not trigger a push back to AFAS.
- The synchronisation timestamp is only advanced after an error-free run; after a failure the run can safely be repeated.
The setup of connectors and rights is described in Setting up AFAS Profit.





