Add Points or Offers Over API
In this article, you will learn how to automate giving points or offers to your members using Spendgo’s Add Rewards API combined with Infobip Moments and Flows.
Things to Know
To add points or offers via Infobip, we require you to enable the Spendgo API and Infobip Flows in your account with your Customer Success Manager.
Please note, this is not the entire flow creation process, please use the Common Infobip Flows with Spendgo Add Points/Offers article for step-by-step guides on how to set up specific Add Points/Offers Flow objectives.
Create an Infobip Flow with Add Points or Offers
Before You Start
When adding an offer, you must have the Campaign Id for the offer you will be giving out. You can find the Campaign Id in the Campaigns / Manage section of the Spendgo Dashboard.
In you Infobip portal, navigate to Moments / Communications.
Click Create Flow button
Choose + Start from Scratch.
Choose Trigger as the way your audience will enter your flow.
Choose your Trigger
Your trigger selection is dependent on what your objective is, please see the Common Infobip Flows to Add Points/Offers for specific examples.Define your conditions for the entry point trigger then click Close.
Click the → right arrow to add an element.
Select the Call API element.
Enter in the Request URL input your url provided by Spendgo.
The URL will be formatted like (your exact URL is provided by Spendgo and must be kept secure and not be shared).
https://webservice.<env_name>.com/v2/loyalty/accounts/rewards?auth=<API_auth_key>Enable escaping of URL parameters (by default this is checked).
Choose the Method as Post.
Choose the Body / Data Format as JSON.
Enter the JSON code in the input field…
To add points, copy paste the following code:
IMPORTANT: please replace the 50 value in the below sample,"balance_quantity" : 50
with the point value you want to add to member’s accounts for entering the Flow.CODE{ "event_type": "add", "customers": [ { "phone": "+{msisdn}", "category": "Campaign", "source": "Infobp Flow", "details": "Infobip flow", "balance_quantity": 50 } ] }
To add offers, copy paste the following code:
IMPORTANT: please replace the 16774 value in the below sample,"campaign_id" : "16774"
with the Campaign Id you retrieved from the Spendgo Dashboard.CODE{ "event_type": "add", "customers": [ { "phone": "{msisdn}", "reason": "one-time", "category": "Campaign", "source": "Infobp Flow", "details": "Infobip Flow", "rewards": [ { "campaign_id": "16774", "type": "Offer", "quantity": 1 } ] } ] }
In the JSON code, highlight {msisdn} and click {} in the right corner to personalize with placeholders. Please note, the “+” prefix is required, do not remove.
Search msisdn and select the attribute.
The {msisdn} will change from a regular to bold font style. Click Close.
Name your Flow at the bottom of your screen.
Click Flow Settings at bottom right of screen.
Add Condition to the Entry Limitations.
Enter your Entry Limitation Condition.
Within Flow Settings, click on Scheduling.
(Optional) Check the option to Run this Flow indefinitely.
If you do not set your flow to run indefinitely, you can also set a start or date time. If no schedule is set, it will default end 90 days after its been launched.Click the Validate button.
Click the Launch Now button.
Once launched, when you click to view your Flow, you will not be able to edit its configuration without creating a new version. It will look like the following with the percetages of People who have interacted with the different elements of the Flow.