List of supported third-party integrations
1 - Initital configuration
Some initial configuration is needed in Engage before you can start integrating your data and flows. Make sure that these basic steps are done before you continue.- Confirm that stores are created and configured in Engage. This is needed since contact data usually has a reference to the store where the contact signed up.
- Confirm that contact attributes are set up. This involves configuration of the contact identification key and the mandatory unique fields for contacts in Engage.
- You need an article register in your Engage environment, so you can segment contacts based on article data attributes like category and brand.
Engage's retry policy
2 - Contacts flow
Contacts are the backbone of the data stored in Engage. Each one represents an individual customer. Here is how to work with them.Contact creation
Creating a contact in Engage consists of these steps:Search for the customer
First, check if the contact already exists in Engage, using this endpoint:In the query string of this request you will send some identifier of the contact, such as their email or mobile phone number.If a contact exists, Engage returns their unique contactId value.If a contact doesn’t exist, you’ll get error code “404 contact not found” and must proceed to the next step, where you will create a contact for this customer.
Read more about identifying contacts here
Create the customer in Engage
Now you know the customer does not already exist as a contact in Engage, you can create them using:Engage returns HTTP Code 201 if the creation has been successful.In the response payload you’ll get a JSON with the contact’s full information.
Store the customer contact ID
In both of the steps above, the GUID of the created contact will be returned as the
id value in the response payload. Store this value for that contact in your own system and use it in the future for looking them up. This simplifies your flows and reduces unnecessary delays and API calls to Engage.Contact creation error handling
When no response is received from the Engage API, or when the response has errors, you’ll need a plan in place to ensure that no data is lost.- Validation errors: Here, something in the data you sent was wrong. You should follow the error instructions to ensure good data quality before you retry.
- No-response error: In the case of no answer, or when you get a 500 or 504 error, you should perform a retry.
Method 1 - FTP
Here you copy the XML file you created to your FTP folder, where it is then uploaded to Engage and all affected contacts are updated.Method 2 - Bulk API
You can send your saved contact changes to Engage using the bulk API:The bulk API
Updating contacts
When a customer changes some personal data (new address, new name, change in some consent) you’ll need to do an update to sync those changes to Engage. If the EngagecontactId has been saved in your system, as recommended above, you will not need to query Engage for it first and can just continue directly to the updating. However, if the contactId, for whatever reason, has not been saved, then a lookup to the Engage API must be done to fetch it, using the general lookup endpoint along with some identifying information:
contactId, the update is then done like this:
Contact update error handling
Like in the contact creation case, it’s important to have a fallback in place for when problems occur, such as when Engage is down, or does not respond, or return error code 500 is received. Again, if your first call is unsuccessful, perform a retry.Engage's retry policy
Fetching contact information
The need will arise to fetch a contact’s data, for example when presenting their personal information, their purchases or their active promotions on My Pages in your e-com. There are three endpoints used here:Fetch a contact's personal data
Fetch a contact's transaction history
Fetch a contact's active promotions
- Cache the response you get here and use that data if the page was to be reloaded. This is to avoid repeated API calls, which can lead to loading delays and a worse user experience.
- You should only fetch what you need. If you just want to view purchase history, then just use
/contacts/transactions. For personal data, use only the first endpoint of the three above. - All three endpoints use
contactIdto identify the contact. Now we’ll consider each one separately.
Fetch a contact’s personal data
To fetch the full contact data use the first endpoint:Fetch a contact’s purchase history
To fetch the contact’s purchase and returns history, along with article data, use the second endpoint:contactId is sent as a query string parameter.
This endpoint allows you some control in paginating the response.
Fetch a contact’s active promotions
To fetch all of the contact’s active promotions use the third endpoint:Upgrading a contact
Engage can handle multiple contact types. For example, you might want to separate your newsletter subscribers from account holders, so you will have a contact type for each. An account holder usually has contact type “Member”. Ideally,this is where you want all your contacts to be. Changing a contact from other type to “Member” is called upgrading. Upgrading contacts is done using the following endpoint:3 - Transactions flow
A transaction can be seen as the “receipt” showing what the contact has bought. A transaction can contain many items, those that were purchased as well as those being returned. Transaction are sent to Engage and saved there, usingcontactId to connect them to a specific contact.
The endpoint used to save them is:
Save transactions to Engage
Saving a transaction
- First check if the customer already exists as a contact in Engage.
- If they don’t exist, you’ll need to create them (and remember to save their
contactIdin your system for future use). - Now POST the purchase information to the
/receiptsendpoint shown above, with the payload data in the correct JSON format.
Sending purchase information
Saving a transaction error handling
You’ll need a plan in place to handle when no response is received from the Engage API, or if the response has error code 500. This is to ensure that no data is lost until the connection is restored. As always, there are two approaches here:- Retry: If your first call is unsuccessful, perform a retry.
- Local XML: If errors remain, or no response is received, you should be ready to save the transactions to local XML files in your system. Then, when the connection has been restored, these files can be transferred to Engage via the FTP server.
4 - Promotions flow
Promotions can be created and assigned to contacts in Engage, and then fetched for display in your e-com or POS. You will need to redeem (mark as used) any promotion that is applied to a purchase. Some things need to be done before a promotion can be used:- Set up the promotion in your own ECOM/POS/ERP using whatever discount rules might apply.
- Set up a matching promotion in Engage.
- In Engage, assign the promotion to one or several contacts.
Set up a promotion in Engage
Promotions endpoints
The relevant endpoints are:Assign a promotion
Displaying promotions
When working with promotions you’ll need to decide if they are to be shown in the POS or in the customer’s My Pages or both, and build the functionality for doing that yourself. These steps will just go through how promotions are fetched and redeemed, not how they are displayed.Redeeming promotions
Redeeming a promotion in Engage is vital to prevent is from being used again, and to also connect it to the purchase where it was used, for purposes of segmenting and reporting.Fetch promotions
Fetch a customer’s active promotions with this endpoint, using
contactId in the query string:Apply the promotion
You can now use your price logic to display and apply the promotion as a deduction at checkout.
Update customer information
If a customer has updated their information during the purchase, Engage needs that updated information. Use the usual endpoint for updating contact data:
Redeem the promotion
Now redeem the promotion with the This will set the promotion to “used” in Engage for that contact.
/redeem endpoint to stop it from being used again:Include promotion with transaction
The promotion identifier should also be included in the API call that is used to register the transaction, along with the rest of the transaction’s data, to allow Engage to match the receipt to the promotion.
Registering a purchase
Redeem promotions error handling
You’ll need a plan in place to handle when no response is received from the Engage API, or if the response has error code 500. This is to ensure that no data is lost until the connection is restored. As always, there are two approaches here:- Retry: If your first call is unsuccessful, perform a retry.
- Local XML: If errors remain, or no response is received, you should be ready to save the redeemed promotion to local XML files in your system. Then, when the connection has been restored, these files can be transferred to Engage via the FTP server.
Summary
The most important design considerations when connecting your client system to Engage from scratch are these:- The connection is usually synchronous, meaning you’ll need to wait for a response from Engage before proceeding in your flow. The average response time for the API endpoints is generally short, but longer response times can happen.
- Always have a retry policy in place, in case of network problems or the API slowing due to heavy traffic. Retry logic makes your solution more reliable.
- Build any redundancy and backup solutions on the client side. For example, a purchase should always be possible to complete even if you can’t get an answer from the Engage API in a reasonable time for your scenario.
- Implement error handling for extraordinary situations when the connection to Engage is down. Do not make your vital business processes depend on Engage always being reachable.
- Whenever possible asynchronous flows should be used for non-time-critical API calls, for example sending orders and transactions to Engage for storage of purchases and triggering automations.
- Ensure that your client application can handle heavy load and high data volumes without exceeding the API rate limits, for example, by implementing queues for non-time-critical messages.
- Any contact IDs returned from Engage should be saved in your local systems and used in following requests to avoid unnecessary traffic to Engage, to simplify and speed up look-ups, and to generally improve your customer’s experience.