Purpose of the Document
This document provides comprehensive guidelines and step-by-step instructions to the client or site admin to configure the Annex Cloud (AC) Customer Loyalty and Refer a Friend module on an e-commerce website.
Defaults
- Client Name: XXX
- Site ID: XXX (Annex Cloud will provide)
- Access Token: XXX (Annex Cloud will provide)
Installation of Annex Cloud Modules at Magento Extension
For Magento sites, we provide Magento extensions. Follow the steps below for Magento installation:
- Copy Annexcloud folder to /app/code/ on the server. (Create a code folder if it is not available.)
- Open the file “app/etc/config.php” and add the following at the end of the array:
'Annexcloud_Loyalty' => 1, 'Annexcloud_Referafriend' => 1, 'Annexcloud_Saadmin' => 1
- Open the Command line user interface (CMD).
- Go to the magento2 root folder.
- Run the command “php bin/magento setup:upgrade” into CMD.
- Log in to the Magento site admin section.
- Navigate to Stores > Configuration.
- Click on the General link under the Annex Cloud tab.
- Set the following attributes.
- Site ID: Enter the Site ID provided by Annex Cloud in the default section.
- Dashboard Page ID: Enter "5".
- Access Token: XXX (Annex Cloud will provide).
- API End Point URL: Enter "https://s15.socialannex.net/api/3.0".
- Create Account Action ID: Enter "101".
- Subscribe to Newsletter Action ID: Enter "102".
- Consumer Name: Enter "Dev".
- Unique Identifier – Select "Email/Customer ID".
- Landing Page ID: Enter "11".
- Coupon Code/Unlock Page ID: Enter "12".
- Product Page ID: Enter "2".
Note: For production, all parameters/information will be provided by Annex Cloud.
Display the Loyalty Dashboard
There is no need to make any changes from the client-side to display the Loyalty dashboard and “My Rewards” link on the user options dropdown list and in the user’s My Account left navigation panel. Annex Cloud has managed those requirements in the provided Magento extension.
Display the My Rewards link:
Add the My Rewards link in the user options dropdown list and in the user’s My Account left navigation panel. Use the href "http://{{your domain}}/loyalty".

Loyalty APIs
Award Create an Account and Signup for Newsletter Loyalty Action Points
There is no need to make any changes from the client-side. Annex Cloud has managed these requirements in the provided Magento extension.
Earn Points on PDP
- To display earned points on PDP, the client must add the following code.
$loyaltyHelper = $this->helper('Annexcloud\Loyalty\Helper\Data');
echo $loyaltyHelper->getEligiblePoints($productId, $productPrice, $quantity); |
OR
- Annex Cloud can manage earned points display on PDP using extensions without the client's adding the code.
Get User Point Details API
For the User Points Details API, the client must add the following code.
$loyaltyHelper = $this->helper('Annexcloud\Loyalty\Helper\Data');
echo $loyaltyHelper->userPointsDetails($emailId);Response
{"siteId":"57583680","id":"annex.test29@test.com","availablePoints":65,
"usedPoints":10,"expiredPoints":0,"lifetimePoints":75,"holdPoints":0,
"usedPointsOnReward":10,"pointsToExpire":65,"pointsToNextTier":0,
"spendToNextTier":0,"pointsToExpireDate":"2021-11-27 12:48:28",
"totalSpent":0,"creditsToCurrencyRatio":"1","creditsToCurrencyValue":65,
"availableRedemptionPoints":0,"usedRedemptionPoints":"10.00"}Redeem Points API
For the Redeem Points API, the client must add the following code.
$loyaltyHelper = $this->helper('Annexcloud\Loyalty\Helper\Data');
echo $loyaltyHelper-> redeemPoints($customerId, $orderId, $points);Response
{"siteId":"57583680","id":"annexsc.sa.ecom.int31@test.com",
"actionId":"107","orderId":"000000019","activity":"DEBIT",
"debit":25,"pointsDeducted":25,"reason":"Used for purchase",
"updatedAvailablePoints":100,"updatedLifetimePoints":165,
"previousTier":"","updatedUserTier":""}Purchase API
There is no need to make any changes from the client-side, Annex Cloud has managed these requirements in the provided Magento extension.
Return API
There is no need to make any changes from the client-side, Annex Cloud has managed these requirements in the provided Magento extension.
Cancel API
There is no need to make any changes from the client-side, Annex Cloud has managed these requirements in the provided Magento extension.
Installation of Refer A Friend Module
Show Refer A Friend Landing Page:
There is no need to make any changes from the client-side, Annex Cloud has managed to create a page in the provided Magento extension.
- The landing page URL follows this format: http://{{your domain}}/referafriend
Show Refer A Friend on PDP
- To display Refer A Friend on PDP, the client must add the following code.
$rafHelper = $this->helper('Annexcloud\Referafriend\Helper\Data');
echo $rafHelper->loadSaProductReferfriend();Show the Coupon Code/Unlock Landing Page
- When the user’s friend executes the shared bitly (that is, clicks on the shared information), they are redirected to the Coupon Code/Unlock landing page. To configure this page, follow the steps below.
- Navigate to the Page Information setting section under Contents > Pages.
- Click Add new page highlighted in blue below.
- You are redirected to the New Page window.
- Fill in the content below in the page information section.
- Enable Page: Yes
- Page Title: Enter “unlock”.
- Click the Content tab.
- Add the code below in the editor, as shown above.
{{block class="Annexcloud\Referafriend\Block\Referafriend" name="raf_unlock" template="Annexcloud_Referafriend::rafunlock.phtml"}}- After adding this code, click Save Page in the right corner.
OR
- If the client doesn’t have the CMS page (in Magento admin) for the coupon code landing page, add the following code on the specific page, where the client wants to display the coupon code/unlock landing page.
<?php $rafHelper = $this->helper('Annexcloud\Referafriend\Helper\Data'); echo $rafHelper->loadSaRafUnlockPage(); ?>Add Sale Tracking Script
There is no need to make any changes from the client-side, Annex Cloud has managed these requirements in the provided Magento extension.