Introduction
Open Loyalty provides a set of flexible building blocks for developing personalized loyalty programs. It’s a headless solution for global brands that want to achieve success when it comes to customer retention.
MoEngage <> Open Loyalty
With the MoEngage and Open Loyalty integration, you can dynamically display coupon codes inside MoEngage Campaigns. You can also forward events from MoEngage to Open Loyalty using Connector Campaigns. Use this to develop your loyalty programs across various channels on MoEngage.
Integration
library_add_check |
Prerequisites
|
Forward events on MoEngage to Open Loyalty
With MoEngage's Connector Campaigns, you can forward your events to Open Loyalty when they perform a purchase on your app or website.
To create a connector campaign on MoEngage,
- Navigate to Create Campaign >> Connectors >> Custom and choose the delivery type most suitable to your needs. For this example, we will select "Event Triggered" and select the event as "Purchased".
- On step 2 of the campaign:
Call the Open Loyalty API
To send your event to Open Loyalty, use the POST
method and configure the payload.
- Select the method as POST
- Headers
-
Authorization
: For this, you need to pass the token from Open Loyalty Authorization APIs like so:Bearer <your_token>
-
Content-Type
:application/json
-
- Add the endpoint as Webhook URL:
https://<openloyalty_host>/api/{storeCode}/customEvent
- enter your respective store code to track this event into. - Body:
Type @ to personalize your payload.
{ "event": { "type": "string", "customerData": { "customerId": "{{UserAttribute['ID']}}", "email": "{{UserAttribute['Email (Standard)']}}", "phone": "{{UserAttribute['Mobile Number (Standard)']}}", "loyaltyCardNumber": "{{UserAttribute['LoyaltyCardNumber']}}" }, "eventDate": "{{EventAttribute['current_time']}}", "body": { "event_attribute": "{{EventAttribute['my_attribute']}}" } } }
- Refer to the Open Loyalty API documentation for more information.
Preview your request
At this point, your campaign should be ready to test and send. You can also test your connector configuration using the Test functionality available in Step 2 of Create Connector Campaign.
You can go ahead and Publish the campaign.
Display dynamic coupon codes in MoEngage Campaigns
Using MoEngage's Content APIs, you can dynamically pull coupon codes inside MoEngage campaigns for a more personalized experience.
Step 1: Set up a MoEngage Content API
info |
Information We've revamped our dashboard settings UI. Content API is now available in Settings -> Advanced Settings -> Content API in the revamped UI. For more information, refer to Summary of Changes - Settings UI Revamp. |
-
Navigate to Settings -> Advanced Settings -> Content API. Click + Add content API at the top right corner of the Content API screen.
Navigate to Settings >> APIs >> Content API. Click Add.
- Add your Open Loyalty API to the endpoint URL. Depending on your use case, the endpoint will change.
To display your coupon code rewards, use Open Loyalty's Get Coupon List API.
While setting up your content API, insert the following URL:
https://<openloyalty_host>/api/{storeCode}/reward/{reward}/coupon
Under URL Parameters, add the following:
-
_itemsOnPage
:1
Under Headers, add the following:
-
Authorization
: For this, you need to pass the token from Open Loyalty Authorization APIs like so:Bearer <your_token>
-
Content-Type
:application/json
-
- Click on "Save" and then "Done" once you see a successful response.
- Note - You can also test your APIs. To test your APIs, from the Content API's action menu, click on "Test". You can your API response and validate it.
Step 2: Display your coupons inside MoEngage campaigns
To use this API in your MoEngage campaigns,
- On step 2 on your campaign creation, enter @.
- In the pop up, you can select the Open Loyalty Content API configured in Step 1.
- You can use MoEngage Templating Language to parse through the API response and use the content in your campaigns.
- You can click on the Preview tab to view your campaign in real-time personalization:
- You can go ahead and Publish the campaign.