# Automated Customer Loyalty Program  

With [Moments](https://www.infobip.com/docs/moments), the Infobip customer engagement platform, there are many ways to automate your customer loyalty program. For example, by sending welcome messages to new members, birthday coupons, special promos, and more to enhance your loyalty program. For this, you can use different communication channels such as [WhatsApp](https://www.infobip.com/docs/whatsapp), [Viber](https://www.infobip.com/docs/viber), [SMS](https://www.infobip.com/docs/sms), and other.
  
Additionally, you can send automated messages using call API when your customers want to check how many loyalty points they’ve earned so far.

## Process Workflow
  
IMPORTANT NOTE
Some features included in this use case are available within our Moments solution only. Please contact your dedicated Customer Success Manager to learn more.

## IMPLEMENTATION STEPS
  
### Steps over Web Interface [#steps-over-web-interface-implementation-steps]

1. [Log in](https://portal.infobip.com/login/) to the Infobip web interface and navigate to the **Communicate** module > **CREATE FLOW** > **Start from Scratch** > **Flow API**.
2. Name your campaign.
3. Add the **Send Viber message** element. Select the sender and enter the message content. Click **Show Advanced options** to add rich content (picture or button with a URL to loyalty program details). Set promotional label in advanced options. For example: *“Dear \{First Name\}, thank you for shopping at Lux Dynamic. Send the keyword POINTS to check your loyalty points or click on the button to see the loyalty program details.”* For a more personal approach use variables such as subscriber's first name.

    Click **CLOSE** when finished editing the message.

4. Add the **Evaluate inbound message** element and select **Viber** as your channel.
5. Choose the same sender as you used in the previous element and then set the conditions.
6. In this case, when you expect a specific answer, it should be set like this: **“IF… the keyword is POINTS”**
7. From the **Keyword is POINTS**, add the **Call API**element to send and receive data from your API management service over HTTP(S) requests.
8. Specify the URL on which the http(s) request will be sent. According to your API features, specify the http(s) method. If required by your system, enter key-value request header pair. Specify the key-value parameter in the request body.

9. Enable **Wait until response is received**check box and **Save to Variable from Response Body** check box.
10. Provide Variable details (name, data type, and navigation) to the value. Add them after the response is **received** condition.

10. From the **Response is Received**, add the **Send Viber message** element. Choose a sender and enter the message content. For example: *“You currently have \{Points\} points on your loyalty account.”*
11. Once finished, click **VALIDATE** and then **LAUNCH**. Here’s how the entire flow looks like:

PRO TIP
To add new people to the flow, use [People API](https://www.infobip.com/docs/api/customer-engagement/moments/add-flow-participants).