RestJson Connector - Customer Update
This document describes the process of synchronizing customer data from a JSON-based REST API to the App4Sales platform. The process updates customers, addresses, contacts, and other related information.
Data Source Configuration
The connector fetches customer data from a RESTful API. The base URL for the API is configured in the connector settings.
Customers Endpoint:
/CustomersContacts Endpoint:
/ContactsAddresses Endpoint:
/AddressesNotes Endpoint:
/Notes
The connector retrieves customers in batches, sorted by Code. For each customer, it can conditionally fetch associated contacts and addresses from their respective endpoints if they are not included in the main customer payload.
Customer Core Fields
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
CustomerGuid | Id | Direct mapping from the source |
CustomerCode | Code | Direct mapping from the source |
CustomerName | Name, IsProspect, IsSuspect | The name is prefixed with "[P] " if |
Discount | Discount | Direct mapping of the customer's discount percentage. |
Website | Website | Direct mapping of the customer's website URL. |
VatLiable | VatLiable | Boolean flag indicating if the customer is liable for VAT. |
VatCode | VatCode | Direct mapping of the customer's VAT code. |
ChamberOfCommerceCode | ChamberOfCommerceCode | Direct mapping from the source |
CustomerEnabled | IsBlocked | The customer is enabled if |
CustomerManager | CustomerManager | Direct mapping of the account manager for the customer. |
LanguageCode | LanguageCode | Direct mapping of the customer's language code. |
Sysmodified | Modified | Mapped from the |
Created | Created | Mapped from the |
Phone | Phone | Direct mapping of the customer's main phone number. |
Direct mapping of the customer's main email address. | ||
Fax | Fax | Direct mapping of the customer's main fax number. |
UsesPriceField | PriceList, PriceListExternalId | The system tries to find a matching price list based on the |
PaymentConditionCode | PaymentCondition, PaymentConditionCode | The system looks up the payment condition by the |
DeliveryMethod | DeliveryMethodCode | Direct mapping of the delivery method code. |
CustomerClassification | CustomerClassification | Direct mapping of the customer classification. |
CustomerDashboard | DashboardUrl | The content of the URL specified in |
Addresses
Addresses are retrieved from the /Addresses endpoint if not provided in the customer payload. The mapping is as follows:
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
AddressId | Id | Mapped from the address |
ExternalId | Id | Mapped from the address |
AddressLine1 | AddressLine1 | Direct mapping. |
AddressLine2 | AddressLine2 | Direct mapping. |
AddressLine3 | AddressLine3 | Direct mapping. |
PostCode | PostalCode | Direct mapping. |
City | City | Direct mapping. |
Country | Country | Direct mapping. |
Iso2 | CountryCode | Mapped from the |
AddressType | Type | Direct mapping of the address type (e.g., 'vis' for visiting, 'del' for delivery). |
IsMainAddress | IsMainAddress | Boolean flag indicating if this is the main address. |
(from Customer) | Inherited from the main customer's | |
Phone | (from Customer) | Inherited from the main customer's |
Fax | (from Customer) | Inherited from the main customer's |
Contacts
Contact persons are retrieved from the /Contacts endpoint if not provided in the customer payload.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
ContactId | Id, ContactId | Uses |
FirstName | FirstName | Direct mapping. |
MiddleName | MiddleName | Direct mapping. |
LastName | LastName | Direct mapping. |
FullName | FirstName, MiddleName, LastName | Concatenation of first name, middle name, and last name. |
Direct mapping. | ||
Phonenumber | Phone | Direct mapping. |
MobileNumber | Mobile | Direct mapping. |
IsMainContactPerson | IsMainContact | Boolean flag indicating if this is the main contact. |
Language_iso2 | LanguageCode | Mapped from the |
Function | Function | Direct mapping. |
Gender | Gender | Direct mapping. |
Initials | Initials | Direct mapping. |
UserName | Username | Direct mapping. |
Extra Data & Free Fields
The connector supports custom fields through two mechanisms: Free Fields and Dynamic Free Fields.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
FreeFields | FreeFields | The list of key-value pairs in |
DynamicFreeFields | CustomCustomerFields | The list of key-value pairs in |
Notes
Customer notes are retrieved from the /Notes endpoint.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
(CustomerNote) | Notes | Customer notes are fetched and stored. If the setting |
Related Settings & Prerequisites
The following settings influence the customer update process:
UsePrefixForProspectsAndSuspects: If enabled, customer names are prefixed with [P] for prospects and [S] for suspects.
IfListIsEmptyUseLegacyEndpoint: If enabled, the connector will make separate calls to the
/Contactsand/Addressesendpoints if the respective lists are empty in the customer payload.DisableCustomerBatchUpdate: If enabled, the connector will only process one batch of customers. This is intended for debugging.
GetCustomerNotesFromBackoffice: If enabled, the connector will fetch customer notes from the
/Notesendpoint.PlaceNoteStateInSubject: If enabled, the state of a customer note will be prepended to its subject.