Introduction
LoyaltyLion is an e-commerce customer loyalty and engagement platform, that powers growth and retention through data-driven loyalty programs.
MoEngage <> LoyaltyLion
The MoEngage and LoyaltyLion integration enables you to track your customers' activities via MoEngage and reward them accordingly inside LoyaltyLion. Using the LoyaltyLion Rest APIs, you can forward purchases made on your app to LoyaltyLion and send out personalized campaigns to engage them post-purchase.
Integration
library_add_check |
Prerequisites
|
Forward purchases on MoEngage to LoyaltyLion
With MoEngage's Connector Campaigns, you can forward your Purchase events to LoyaltyLion 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 LoyaltyLion API
To send your Purchase event to LoyaltyLion, use the POST
method and configure the payload.
- Select the method as POST
- URL Parameters:
-
api_key
:<your_api_key>
-
- Headers
-
Authorization
: Use an online tool to create your basic auth withtoken
as a username and yoursecret
as a password:
In the above example, the value of this header would beBasic dG9rZW46c2VjcmV0
-
Content-Type
:application/json
-
- Add the endpoint as Webhook URL:
https://api.loyaltylion.com/v2/orders
- Body:
Type @ to personalize your payload.
{ "merchant_id": "6253e03b", "merchant_number": "1001", "customer_id": {{UserAttribute['customer_id']}}, "customer_email": "{{UserAttribute['Email (Standard)']}}", "total": "{{EventAttribute['price']}}", "total_shipping": "{{EventAttribute['price']}}", "payment_status": "paid", "date": "{{EventAttribute['event_time']}}", "discount_codes": [ { "code": "{{EventAttribute['coupon_code']}}", "amount": "{{EventAttribute['coupon_code_discount']}}" } ] }
- Refer to the LoyaltyLion 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 customer rewards in MoEngage Campaigns
Using MoEngage's Content APIs, you can dynamically pull customers' reward points 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 LoyaltyLion API to the endpoint URL. Depending on your use case, the endpoint will change.
To display your customers' rewards, use LoyaltyLion's Get Available Rewards API.
While setting up your content API, insert the following URL:
https://api.loyaltylion.com/v2/customers/{{UserAttribute['customer_id']}}/available_rewards
Under Headers, add the following:
-
Authorization
: Use an online tool to create your basic auth withtoken
as a username and yoursecret
as a password:
In the above example, the value of this header would beBasic dG9rZW46c2VjcmV0
-
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 customers' rewards 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 LoyaltyLion 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:
- Once you are satisfied with the results, you can publish your campaign.