Recently, one partner asked for our technical expertise with a very interesting use case involving automating a loyalty system with different point currencies, multiple tiers, and client communication.
Our solution involved connecting Open Loyalty, the API-first loyalty management system, to Bloomreach, a suite of e-commerce personalization tools. Thanks to the API-first model and ease of integration, it took under 30 minutes to implement a developer–friendly business case. And thanks to the MACH approach adopted by both platforms, the ease of integration is at highest level
The result was successful and is applicable in many similar cases – which inspired us to share details in this blog.
Reading this article
This article has two parts: first a high-level overview of the subject, including a discussion of why integrate marketing automation and loyalty engines at all.
If you are a developer or have some technical knowledge about APIs and webhooks, feel free to head straight to the second part, where we focus on the implementation of our use case.
Marketing automation typically includes a loyalty component that is basic and focused on marketing campaigns rather than realizing sophisticated loyalty programs. This all-in-one approach is initially suitable for startups and ideation, but as businesses expand and requirements evolve, it becomes necessary to transition to specialized and flexible solutions.
Integration becomes crucial at this stage, requiring solutions that offer seamless integration without constraining business operations or agility. Opting for MACH vendors and API-first platforms emerges as a favorable option in this regard.
Some benefits of integrating specialized software:
A proper integration can provide operational benefits from day 1. Better yet, you can continuously iterate the connection to make sure it allows the best implementations for your program. This iterative process becomes much easier when using flexible platforms (and that’s why we love the API-first approach so much at Open Loyalty).
But operational efficiency is not the end goal. The next step is leveraging the loyalty engine/marketing automation integration to drive business results and foster a more personalized and rewarding experience for customers:
Let’s think about some common use cases made possible by a high-quality integration.
With that out of the way, let’s get technical.
A simplified summary of what our partner required:
Setup
Member activities
Communication
Example of message combining setup, activities and communication:
Hey John,
You're about to lose a 20% discount coming from Gold Tiers as your points will expire in 7 days. To prevent from losing a discount and Gold status, here are some things you can do:
This example demonstrates the initial stages of designing an integration layer using AWS services, focusing on the connection between Open Loyalty and Bloomreach.
The emphasis here is on simplicity, with performance, security, and reliability presented as overarching considerations for future iterations.
Our use case demands high responsiveness. Relying on traditional API request mechanisms would not be efficient, and webhooks emerge as a solution to address this need, embodying the "don't call us, we call you" pattern.
In contrast to traditional APIs, where data updates necessitate frequent polling, webhooks provide a more efficient alternative. The conventional approach of polling is effective when the timing of data retrieval is known in advance. However, it becomes cumbersome and expensive when searching for real-time updates. Frequent data requests, comparisons, and asynchronous processing can introduce operational complexities and financial overheads that may significantly impact business operations.
Webhooks, in an event-driven setup, enable almost real-time communication communication. The external system notifies your components when an important business event happens, eliminating constant polling. This proactive system enhances efficiency and responsiveness, informing your system about business events in real-time for seamless synchronization. This event-driven model streamlines communication and promotes a cost-effective integration of components in your business architecture.
For a quick start, the AWS console allows users to build the integration within a browser, bypassing the need for advanced Terraform or Terragrunt knowledge. While NodeJS is showcased for AWS Lambda, the service supports various languages.
This basic example serves as a starting point, with room for refinement and consideration of performance and security complexities in subsequent integration phases.
Open Loyalty is an active system here. As an event-driven engine, Open Loyalty detects an important business event, “Tier upgrade”.
Payload
Open Loyalty uses a webhook subscription pattern. With this pattern, you define the event and destination for that event. Additionally, you should add authorization headers to protect yourself from potential fraudulent calls.
AWS Lambda is one of the examples of a destination. It can be literally anything as long as it has a URL and accepts JSON payload over HTTPS (recommended) protocol. Here we used AWS API Gateway to create a URL and pointed it to the AWS Lambda function written in NodeJS that accepts Open Loyalty’s webhook and transforms it to an API call to Bloomreach to trigger configured actions based on this call.
Here are some of the crucial parts to consider, like performance, throttling, and security. Using AWS can solve some of them if you want to quickly integrate two systems and leverage existing cloud providers. However, you can use anything like Mule, Zapier or even your own on-premise solutions.
Security is crucial here: you need to check if the webhook is coming from trusted sources like Open Loyalty by checking authorization headers. The same goes for communication to Bloomreach. Ideally, the code should not contain credentials but should be checked against a secure storage like AWS Secret Manager.
AWS Lambda sends secure API calls to Bloomreach along with API User and API Secret and correct payload
Payload
Finally, Bloomreach does the job based on the event. It can be anything from adding to a Segment to sending a notification to the end user, whether a push notification, SMS or just an e-mail congratulating for gaining a higher tier in the loyalty program.
It’s important to recognize this achievement and maintain a loyal relationship with your customers.
Remember that this is a simple example of how to integrate two systems in under 30 minutes and achieve business goals.
While we can’t go into further technical details about our real-life implementation, here are our recommended next steps:
Being able to help our partner achieve their business goals was very rewarding, and we couldn’t pass up the opportunity to share such an interesting use case.
As mentioned, the implementation shown here is only the start – the reality includes many additional steps, from security checks to specific implementations. However, the basis really did take only 30 minutes to code. Thanks to technical expertise and the flexibility of API-first platforms.
Get a weekly dose of actionable tips on how to acquire, engage, and retain your customers