Skip to main content
Skip table of contents

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.

  1. In you Infobip portal, navigate to Moments / Communications.

  2. Click Create Flow button

  3. Choose + Start from Scratch.

  4. Choose Trigger as the way your audience will enter your flow.

  5. 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.

  6. Define your conditions for the entry point trigger then click Close.

    Exampe of an Infobip People Real-Time Event of Mobile App Installed.

  7. Click the → right arrow to add an element.

  8. Select the Call API element.

  9. 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>

    This image is only a sample of the Request URL, it does not work.

  10. Enable escaping of URL parameters (by default this is checked).

  11. Choose the Method as Post.

  12. Choose the Body / Data Format as JSON.

  13. Enter the JSON code in the input field…

    1. 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
              }
          ]
      }
    2. 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
                      }
                  ]
              }
          ]
      }
  14. 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.

  15. Search msisdn and select the attribute.

  16. The {msisdn} will change from a regular to bold font style. Click Close.

  17. Name your Flow at the bottom of your screen.

  18. Click Flow Settings at bottom right of screen.

  19. Add Condition to the Entry Limitations.

  20. Enter your Entry Limitation Condition.

    Example: A person can enter this Flow 1 times in a lifetime.

  21. Within Flow Settings, click on Scheduling.

  22. (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.

  23. Click the Validate button.

  24. 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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.