How to integrate
Once Ingrid and Engage are configured, the integration goes like this.
Posting an order
Orders are posted by Ingrid to the v2 endpoint:
POST api/v2/orders
You can see in the example below the orderStatus from Ingrid in the payload, along with other useful information in extraData such as TrackingLinkHTML and TrackingNumber.
{ "contact": { "matchKey": "person@test.com", "matchKeyType": "email" }, "orderStatus": "Ingrid - Submitted To Carrier", "orderNumber": "8000612", "createdDate": "2024-08-26T07:42:49Z", "paymentStatus": "PAID", "shippingDate": "0001-01-01T00:00:00Z", "currency": "EUR", "language": "en-GB", "totalGrossPrice": 4000, "freightFee": { "value": 500, "tax": 0 }, "extraData": { "BillingAddress_City": "Amsterdam", "BillingAddress_Country": "NL", "BillingAddress_Email": "ustomer@test.com", "BillingAddress_FirstName": "Test Customer", "CarrierName": "DHL Express", "DeliverySenderName": "SE warehouse", "DeliveryType": "UNKNOWN", "DestinationAddress_City": "Amsterdam", "DestinationAddress_Country": "NL", "EstimatedDeliveryDate": "2024-08-28T00:00:00+02:00", "ParcelsCount": "1", "PaymentMethod": "", "TrackingLinkHTML": "https://tracking-stage.ingrid.com/en-GB/cmVzb3VyY2VfdG9rZW46ZDI0NTkxNTI1MzBkNGYxZThjMDA0MWM5NzViZWViMmM", "TrackingNumber": "3SHM00008734785", "TrackingStatus_Step": "STEP_SUBMITTED_TO_CARRIER", "TrackingStatus_Time": "2024-08-26T11:03:59Z" ...
This order data can then be used to trigger an automation.
Creating a contact
It can happen that an order is posted to the Engage API but the contact doesn't exist in Engage. A 404 response is then returned. If this happens, Ingrid will create the contact in Engage using this endpoint:
POST /api/v2/contacts
And with this sort of payload:
{ "email": "john.fellow@example.com", "mobilePhone": "+48519157444", "firstName": "John", "lastName": "Fellow", "contactType": "Member" }
After this, the order will be posted again to the /orders endpoint.
Note
The default contactType is "Member" but this can be changed to whatever the merchant wants.
Building the automation
There needs to be an automation workflow in place to handle incoming orders. This automation will handle the various orderStatus values from Ingrid. To do this, you can have a value split in the automation to branch off the different order status values to send different emails, based on a contact's current order status.
Building email templates
Create a specific email template for each order status you are going to handle. Use existing templates or design new ones with all relevant information and consistent branding and visuals.
Use [[order.ExtraData.TrackingLinkHTML]] in your email module to embed the TrackingLinkHTML page code provided by Ingrid in the order. This will embed HTML showing the package's location.
The [[order.ExtraData.TrackingLink]] value, if it exists in the order data, can also added to the email as a link to take the customer to Ingrid's own tracking page for the item.