Introduction
Annex Cloud provides an integrated customer loyalty platform, designed to tackle complex challenges related to customer acquisition, retention, and advocacy. The platform utilizes advanced solutions and a dedicated team of customer success managers to help businesses develop customer loyalty and generate impactful user-generated content. The platform can be used both individually and as a part of a broader suite to create authentic relationships with customers.
Purpose
This document serves as a guide to facilitate the integration of CRM data so that customer representatives can easily access information to answer client queries. It outlines instructions for CRM data push and provides a set of instructions to follow for integrating loyalty program data.
High-Level Design
The integration is designed to seamlessly connect the loyalty program with CRM systems, enabling customer service teams to access and manage loyalty-related data effectively.

Revision History
| Version | Date | Name | Description |
|---|---|---|---|
| 1.0 | 12-12-2024 | Harika | Described the integration with Zoho CRM |
Prerequisites for Installation
- Client Name: Zoho CRM
- Site ID: XXXXXX (Annex Cloud will provide)
- Access Token: XXXXXXX (Annex Cloud will provide)
Steps to Create Annex Cloud Loyalty Access Token
- Create a JSON array with the loyalty token and site ID:
{"site_id": "XXXXXX” (Annex Cloud will provide), "loyaltyToken": "XXXXXXX” (Annex Cloud will provide)} - Encode the JSON using the base64_encode() function.
Loyalty Program Version
Annex Cloud - Loyalty V3 API 3.0.0
| HTTP Codes | Code | Status |
|---|---|---|
| 200 - Ok | Successful operation | |
| 201 - Ok | Successful operation | |
| 404 Not Found | AC1001 | Oops! Something went wrong |
| 401 Unauthorized | AC1002 | Request not authorized |
| 400 Bad Request | AC1004 | Missing parameters |
|
404 Not Found or 400 Bad Request |
AC1005 | No data found |
| 409 Conflict | AC1006 | Data already exists |
|
400 Bad Request or 422 Unprocessable Entity |
AC1007 | Invalid parameters |
| 403 Forbidden | AC1009 | Opt out user |
| 404 Not Found | AC1012 | User not found |
| 400 Bad Request | AC1016 | Some of products are fraud |
| 400 Bad Request | AC1019 | Invalid status |
| 400 Bad Request | AC1025 | Unable to redeem points |
| 422 Invalid Parameters | AC1033 | Invalid parameter value passed |
| 401 Unauthorized | AC2007 | API key not found in JWT |
| 404 Not Found | AC2013 | Group not exist |
| 400 Bad Request | AC2018 | Number of activities requested has exceeded limit. Maximum is 100 activities per page. |
| 400 Bad Request | AC2019 | Activities not found |
-
Sign in to the Sigma Account:
Log in to the provided sigma account for Zoho integration.- URL: https://sigma.Zoho.com
- Username: XXXXXXXX (Provided by the client for their sandbox environment)
-
Password: XXXXXXXX (Provided by the client for their sandbox environment)
- Create a new extension for Zoho CRM contacts.
- Click on the New Extension button and select the extension type for the Zoho CRM contact module.
- Fill in extension details.
- Once the extension is created, click Save as Draft to store the extension setup.
- Now we can see the created extension for Zoho CRM.
Edit Extension for Loyalty Information:
- Click Edit Extension to modify the extension for displaying loyalty program details.
- After clicking on the Edit Extension button, a new tab opens for Zoho Developer.
Create a Button for Loyalty Information:
- Under the Components tab, create a button to show loyalty information on Zoho CRM contact pages.
- Click on the Links and Buttons tab and click on Create New Button.
- Fill in the button info for Contact module and click on Save button.

Using Dynamic Variables in URL for Button
To create a URL for the button, use Dynamic Variables, which can be found in the Fields drop-down box. Follow these steps:
- Select the variable you need.
- Click on the option to insert it into the URL.
Example URL:
https://api.socialannexuat.com/zoho/v3/getUserAcHistory.php?token=XXXXXXXXXXXXXXXXX&externalID=${Contacts. Email}&pageid=1&firstName=${Contacts. First Name}&lastName=${Contacts. Last Name}
As mentioned above, refer to #access token to create an access token.

- Once this is done, the button for the contact page will be created.
Publish the Changes:
- Click the Publish button, located in the left sidebar at the bottom

- Once published, check the changes in the components. For example, write a comment and click the Confirm button to confirm your changes.
- A pop-up will appear with a URL. Copy the URL and click OK.
-
Test the URL:
- Paste the copied URL into a new browser tab and press Enter.
- You should see a screen with checkboxes. Select the checkboxes and click the Continue to Upgrade button.
- Select the radio button, Install for all users, and click the Confirm button.
- After this, you’ll see a confirmation screen.
-
Verify the Contact Page:
- Click the Main Contact Tab.
- Click the Main Contact Tab.
- Open any contact’s page.
- Click the AC Loyalty Info button to see the loyalty iFrame in a new tab, which will display the Annex Cloud loyalty info dashboard.

Steps for Creating an Authorization Code
To generate an authorization code, follow these steps:
- Use the URL provided below to create an authorization code.
https://www.Zoho.com/crm/developer/docs/api/v2.1/scopes.html
- This URL is linked to the web-based client type in the Annex Cloud account.
https://api-console.Zoho.com/client/1000.CV2ZVA76I5MPMVV3ZTGWNQ0J7U93XG

- The following details will be available after setup:
- Client ID
- Client Secret Key
- Ensure to select all Multi DC settings.
- Authorization Code URL:
Add the required parameters below to the above URL.
- Response_type
- Client_id
- Scope
- Redirect_uri
- Access_type
- Paste the URL into a new browser tab and select the Production Annex Cloud radio button. Click Submit.

- After submitting, you will see a new screen. Click the Accept button.
- Get the Authorization Code:
Copy the authorization code from the URL.

Generating Access and Refresh Tokens Using Postman

-
Generate Access Token and Refresh Token:
Use the authorization code and other details in Postman to generate the access token and refresh token. - Use the Access Token in the Contact Add API:
- Test the acess token by using it in the contact add API and check the response.
Use Cases for the Loyalty Program Integration with Zoho CRM
Enroll a Customer in the Loyalty Program
- Support agents can enroll a customer in the loyalty program directly from Zoho CRM.
- A customer account must exist in Zoho CRM.
- The customer should not already be enrolled in theloyalty program.
Check if a Customer is Enrolled in the Loyalty Program
A support agent can check if a customer is part of the loyalty program by reviewing the Annex Cloud Loyalty Section within Zoho CRM.

- A customer account must exist in Zoho CRM.
- Annex Cloud loyalty must be integrated with Zoho CRM.
Award Loyalty Points Upon Opting-in a Customer to the Loyalty Program
- Upon enrolling a customer into the loyalty program, the system automatically awards loyalty points based on predefined criteria or actions.
View Customer’s Loyalty Membership Details

- Support agents can view the customer’s loyalty membership details, including the loyalty user and membership information, in the loyalty dashboard’s information tab. The dashboard displays:
- Loyalty Membership Info
- Earn Tab
- Claimed Rewards
- Loyalty Activity
Manage Loyalty Points

Support agents can manage the loyalty points of enrolled customers. This includes adjusting point balances, awarding points for specific actions, and reviewing point redemption activity.
Integration Flow
The integration flow diagram, High level design mentioned at the beginning of this document, will depict how Annex Cloud communicates with Zoho CRM, facilitating data exchange and providing the necessary functionality for the customer service representatives to manage loyalty program data effectively.
Installation Steps at the Platform
- Staging Path: The platform's staging environment is used for testing the integration before moving to production.
- Production Path: After successful testing, the integration is moved to the production environment
Installation of Loyalty Program
List of APIs/Data Push/Trigger Setup
API Methods:
Several methods are used to push data from Annex Cloud to Zoho CRM, such as:
Installation of Loyalty Program
List of APIs/Data Push/Trigger Setup
API Methods:
Several methods are used to push data from Annex Cloud to Zoho CRM, such as:
|
Class Name = ZohocrmAuth{} $Objects = new ZohocrmAuth($accessParams); Create a array for $accessParams= $accessParams = array( 'zohocrmApi' => "https://www.zohoapis.com/crm/v2.1/Contacts/upsert", 'zohocrmGetApi' => "https://www.zohoapis.com/crm/v2.1/Contacts", 'refreshTokenApi' => "https://accounts.Zoho.com/oauth/v2/token", 'authorizationKey' => "XXXXXXXX", 'clientId' => "XXXXXXXX", 'clientSecret' => "XXXXXXXX", 'refreshToken' => "XXXXXXXX", ); |
Add or Update Contact($dataArray):
This method updates or adds customer contact details.
{
"data": [
{
"Company": "Zylker",
"Last_Name": "Daly",
"First_Name": "Paul",
"Email": "p.daly4@zylker.com",
"State": "Texas"
},
{
"Company": "Villa Margarita",
"Last_Name": "Dolan",
"First_Name": "Brian",
"Email": "brian4@villa.com",
"State": "Texas"
}
],
"duplicate_check_fields": [
"Email"
],
"trigger":[ "workflow"]
} This API setup helps ensure the data is correctly pushed from Annex Cloud into the Zoho CRM, keeping the CRM data updated with loyalty program information.
Get Lists($dataArray)
Retrieves a list of contacts.
$dataArray = [
"getList" => "Yes"
];
Delete Contact($dataArray)
$dataArray = [
"userDetails" => [
"data" => [
[
"id" => "5134112000000627003"
]
]
]
]; Below is the list of APIs which are used to push data AC to Zoho CRM:
Add or Update Contact
API Endpoint:
https://www.zohoapis.com/crm/v2.1/Contacts/upsert
Method: POST
Content-Type: application/json
Authorization:
Zoho OAuth Token:
Zoho-oauthtoken1000.e1b3c6b28e930222958e8d969088d0ea.3b99d934893b3e779a203f6cbea4445f
(Note: The authorization key is refreshed each time the API is used.)
Request Body :
{
"data": [
{
"Company": "Zylker",
"Last_Name": "Daly",
"First_Name": "Paul",
"Email": "p.daly4@zylker.com",
"State": "Texas"
},
{
"Company": "Villa Margarita",
"Last_Name": "Dolan",
"First_Name": "Brian",
"Email": "brian4@villa.com",
"State": "Texas"
}
],
"duplicate_check_fields": [
"Email"
],
"trigger":[ "workflow"]
}Response:
"data": [
{
"code": "SUCCESS",
"duplicate_field": "Email",
"action": "update",
"details": {
"Modified_Time": "2022-03-17T12:34:52+05:30",
"Modified_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
},
"Created_Time": "2022-02-23T14:32:01+05:30",
"id": "5134112000000596010",
"Created_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
}
},
"message": "record updated",
"status": "success"
},
{
"code": "SUCCESS",
"duplicate_field": "Email",
"action": "update",
"details": {
"Modified_Time": "2022-03-17T12:34:52+05:30",
"Modified_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
},
"Created_Time": "2022-02-23T14:32:01+05:30",
"id": "5134112000000596011",
"Created_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
}
},
"message": "record updated",
"status": "success"
}
]
} Get Contact Lists
-
API Endpoint:
https://www.zohoapis.com/crm/v2.1/Contacts - Method: GET
-
Authorization:
Zoho OAuth Token:
Zoho-oauthtoken1000.e1b3c6b28e930222958e8d969088d0ea.3b99d934893b3e779a203f6cbea4445f
(Note: The authorization key is refreshed each time the API is used.)
Response:
{
"data": [
{
"code": "SUCCESS",
"duplicate_field": "Email",
"action": "update",
"details": {
"Modified_Time": "2022-03-17T12:34:52+05:30",
"Modified_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
},
"Created_Time": "2022-02-23T14:32:01+05:30",
"id": "5134112000000596010",
"Created_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
}
},
"message": "record updated",
"status": "success"
},
{
"code": "SUCCESS",
"duplicate_field": "Email",
"action": "update",
"details": {
"Modified_Time": "2022-03-17T12:34:52+05:30",
"Modified_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
},
"Created_Time": "2022-02-23T14:32:01+05:30",
"id": "5134112000000596011",
"Created_By": {
"name": "Dhananjay D Waghchaure ",
"id": "5134112000000348001"
}
},
"message": "record updated",
"status": "success"
}
]
}Delete Contact
-
API Endpoint:
https://www.zohoapis.com/crm/v2.1/Contacts?ids=5134112000000611001 - Method: POST
- Content-Type: application/json
-
Authorization:
Zoho OAuth Token:
Zoho-oauthtoken1000.e1b3c6b28e930222958e8d969088d0ea.3b99d934893b3e779a203f6cbea4445f
(Note: The authorization key is refreshed each time the API is used.)
Response:
{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "5134112000000716001"
},
"message": "record deleted",
"status": "success"
}
]
}APIs for iFrame Operations
Join Loyalty Program (Button)
-
API Endpoint:
https://s15.socialannex.net/api/3.0/users - Method: POST
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
-
Input Parameters:
- Customer: Email or User ID
- AnnexCloudModel: Site details
- Status: YES or NO
This API will create a member and opt them into the loyalty program. It will display member details such as the name, opt-in status, phone number, birthdate, anniversary date, and so on.
Request:
| Method | URL |
|---|---|
| POST | /users |
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id (Mandatory) | Enter the member’s unique ID. | string |
| Enter the member’s email address. | string | |
| firstName | Enter the member’s first name. | string |
| lastName | Enter the member’s last name. | string |
| optInStatus | Enter the opt-in status as YES for opt-in and NO for opt-out. By default, it will be YES. | string |
| status | Enter the member status as active (default) or inactive. | string |
| phone | Enter the member’s phone number. | string |
| birthdate | Enter the member’s birthdate. | date (yyyy-mm-dd) |
| createDate | Enter the create date of the member. | date (yyyy-mm-dd) |
| anniversaryDate | Enter the anniversary date, which can be either birthdate or loyalty program joining date. | date (yyyy-mm-dd) |
| userProfileImageUrl | Enter the member’s profile image URL. | string |
| extendedAttribute | Enter the attribute keys and their values apart from the ones mentioned above. | string |
Sample Request:
{
"id": "user@domain.com",
"email": "user@domain.com",
"firstName": "John",
"lastName": "Doe",
"zipCode": "90002",
"optInStatus": "YES",
"status": "ACTIVE",
"phone": ""123-123-4567",
"birthDate": "2018-04-01T00:00:00-0700",
"anniversaryDate": "2018-04-01T00:00:00-0700",
"userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png",
"createDate": "2018-04-01T00:00:00-0700",
"updateDate": "2018-04-01T00:00:00-0700",
"extendedAttribute": ["KEY1": "VALUE1", "KEY2": "VALUE2"]
} Response:
This will create a member and opt in that member for the loyalty program and will display the details which include member name, opt in status, phone, birthdate, anniversary date, and so on.
Output Fields:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id | Displays the unique ID. | string |
| Displays the email address of the member. | string | |
| firstName | Displays the first name of the member. | string |
| lastName | Displays the last name of the member. | string |
| optInStatus | Displays the opt-in status of the member. | string |
| status | Displays the status of the member if the member is active or inactive. By default, it will be active, and can be changed to inactive if the client requests. | string |
| phone | Displays the phone number of the member. | string |
| birthDate | Displays the birthdate of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| anniversaryDate | Displays the anniversary date of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| userProfileImageUrl | Displays the URL of the member’s profile image only if this parameter is passed while creating the member. | string |
| createDate | Displays the date & time in yyyy-MM-dd'T'HH:mm:ssZ format on which the member was created. | date (yyyy-mm-dd) |
| updateDate | Displays the date & time in yyyy-MM-dd'T'HH:mm:ssZ format on which the member was updated. | date (yyyy-mm-dd) |
| extendedAttribute | Displays the extra member attributes which are added as per the client’s request. | string |
| errorCode | Displays only when the API request fails, this will denote the type of error. | string |
| errorMessage | Displays the reason why the API request has failed. | string |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of a positive response is: { "id": "user@domain.com", "email": "user@domain.com", "firstName": "John", "lastName": "Doe", "zipCode": "90002", "optInStatus": "YES", "status": "ACTIVE", "phone": ""123-123-4567", "birthDate": "2018-04-01T00:00:00-0700", "anniversaryDate": "2018-04-01T00:00:00-0700", "userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png", "createDate": "2018-04-01T00:00:00-0700", "updateDate": "2018-04-01T00:00:00-0700", "extendedAttribute": ["KEY1": "VALUE1", "KEY2": "VALUE2"] } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1001", "errorMessage": "Oops! Something went wrong." } |
Info Tab (Fetch Member Details)
-
API Endpoint:
https://s15.socialannex.net/api/3.0/users/{id} - Method: GET
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
-
Input Parameter:
- Customer: Email or User ID
This API fetches details about the member.
- Customer: Email or User ID
| Method | URL |
|---|---|
| GET | /users/{id} |
Sample Request:
/users/user@domain.com
Response:
This will display all the details of the member.
Output Fields:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id | Displays unique identifier (in the SA system) used to identify the member. | string |
| Displays the email address of the member. | string | |
| firstName | Displays the first name of the member. | string |
| lastName | Displays the last name of the member. | string |
| zipCode | Displays the zip code of the member’s location. | string |
| status | Displays the status of the member (active or inactive). By default, it will be active, but can be changed to inactive if the client requests. | string |
| phone | Displays the phone number of the member. | string |
| birthDate | Displays the birthdate of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| anniversaryDate | Displays the anniversary date of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| userProfileImageUrl | Displays the URL of the member’s profile image. If not passed during creation, this field will be blank. | string |
| createDate | Displays the date on which the member was created in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| updateDate | Displays the date on which the member details were updated in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| totalSpendCurrency | Displays the total currency spent by the member. | string |
| extendedAttribute | Displays the extra member attributes, which will vary according to the client. | string |
| errorCode | Displays only when the API request fails, indicating the type of error. | string |
| errorMessage | Displays the reason why the API request has failed. | string |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of positive response is: { "id": "user@domain.com", "email": "user@domain.com", "firstName": "John", "lastName": "Doe", "zipCode": "90002", "optInStatus": "YES", "status": "ACTIVE", "phone": "123-123-4567", "birthDate": "2018-04-01T00:00:00-0700", "anniversaryDate": "2018-04-01T00:00:00-0700", "userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png", "createDate": "2018-04-01T00:00:00-0700", "updateDate": "2018-04-01T00:00:00-0700", "totalSpendCurrency": "150", "extendedAttribute": ["KEY1": "VALUE1", "KEY2": "VALUE2"] } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 / AC1005 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } If data is not found!! { "errorCode": "AC1005", "errorMessage": "No data found" } |
Subscribe to Newsletter
-
API Endpoint:
https://s15.socialannex.net/api/3.0/users/{id} - Method: PATCH
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
-
Input Parameter:
- Customer: Email or User ID.
This API updates the member's details to subscribe them to the newsletter.
- Customer: Email or User ID.
| Method | URL |
|---|---|
| PATCH | /users/{id} |
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| Enter the member’s email address. | string | |
| updateId | Enter the member’s new email address. | string |
| firstName | Enter the member’s first name. | string |
| lastName | Enter the member’s last name. | string |
| optInStatus | Enter the opt-in status as YES for opt-in and NO for opt-out. By default, it will be YES. | string |
| status | Enter the member status as active (default) or inactive. | string |
| phone | Enter the member’s phone number. | string |
| birthdate | Enter the member’s birthdate. | date (yyyy-mm-dd) |
| createDate | Enter the create date of the member. | date (yyyy-mm-dd) |
| anniversaryDate | Enter the anniversary date which can be either birthdate or loyalty program joining date. | date (yyyy-mm-dd) |
| userProfileImageUrl | Enter the member’s profile image URL. | string |
| extendedAttribute | Enter the attribute keys and their values apart from the ones mentioned above (according to client’s request). | string |
Sample Request:
{
"id": "user@domain.com",
"updateId": "user_1@domain.com"
"email": "user@domain.com",
"firstName": "John",
"lastName": "Doe",
"zipCode": "90002",
"optInStatus": "YES",
"status": "ACTIVE",
"phone": ""123-123-4567",
"birthDate": "2018-04-01T00:00:00-0700",
"anniversaryDate": "2018-04-01T00:00:00-0700",
"userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png",
"createDate": "2018-04-01T00:00:00-0700",
"updateDate": "2018-04-01T00:00:00-0700",
"extendedAttribute": ["NewsLetterOptIn
": "YES"]
}Response:
This will update the details of the member.
Output Fields:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id | Displays unique identifier (in the SA system) used to identify the member. | string |
| Displays the email address of the member. | string | |
| firstName | Displays the first name of the member. | string |
| lastName | Displays the last name of the member. | string |
| zipCode | Displays the zip code of the member’s location. | string |
| status | Displays the status of the member (active or inactive). By default, it will be active, and can be changed to inactive if the client requests. | string |
| phone | Displays the phone number of the member. | string |
| birthDate | Displays the birthdate of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| anniversaryDate | Displays the anniversary date of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| userProfileImageUrl | Displays the URL of the member’s profile image. | string |
| createDate | Displays the date on which the member was created in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| updateDate | Displays the date on which the member details were updated in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| extendedAttribute | Displays the extra member attributes which will vary according to the client. | string |
| errorCode | Displays only when the API request fails, this will denote the type of error. | string |
| errorMessage | Displays the reason why the API request has failed. | string |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of positive response is: { "id": "user_1@domain.com", "email": "user_1@domain.com", "firstName": "John", "lastName": "Doe", "zipCode": "90002", "optInStatus": "YES", "status": "ACTIVE", "phone": "123-123-4567", "birthDate": "2018-04-01T00:00:00-0700", "anniversaryDate": "2018-04-01T00:00:00-0700", "userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png", "createDate": "2018-04-01T00:00:00-0700", "updateDate": "2018-04-01T00:00:00-0700", "extendedAttribute": [["NewsLetterOptIn ": "YES"] } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } |
.
Manage User Tier
- Purpose: This API updates the member’s tier.
- API Endpoint: https://s15.socialannex.net/api/3.0/users/{id}
- Method: PATCH
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
| Method | URL |
|---|---|
| PATCH | /users/{id} |
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| Enter the member’s email address. | string | |
| updateId | Enter the member’s new email address. | string |
| firstName | Enter the member’s first name. | string |
| lastName | Enter the member’s last name. | string |
| optInStatus | Enter the opt-in status as YES for opt-in and NO for opt-out. By default, it will be YES. | string |
| status | Enter the member status as active (default) or inactive. | string |
| phone | Enter the member’s phone number. | string |
| birthdate | Enter the member’s birthdate. | date (yyyy-mm-dd) |
| createDate | Enter the create date of the member. | date (yyyy-mm-dd) |
| anniversaryDate | Enter the anniversary date which can be either birthdate or loyalty program joining date. | date (yyyy-mm-dd) |
| userProfileImageUrl | Enter the member’s profile image URL. | string |
| extendedAttribute | Enter the attribute keys and their values apart from the ones mentioned above. | string |
Sample Request:
{
"id": "user@domain.com",
"updateId": "user_1@domain.com"
"email": "user@domain.com",
"firstName": "John",
"lastName": "Doe",
"zipCode": "90002",
"optInStatus": "YES",
"status": "ACTIVE",
"phone": ""123-123-4567",
"birthDate": "2018-04-01T00:00:00-0700",
"anniversaryDate": "2018-04-01T00:00:00-0700",
"userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png",
"createDate": "2018-04-01T00:00:00-0700",
"updateDate": "2018-04-01T00:00:00-0700",
"extendedAttribute": ["UserTier
": "Platinum"]
} Response:
This will update the details of the member.
Output fields:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id | Displays unique identifier (in the SA system) used to identify the member. | string |
| Displays the email address of the member. | string | |
| firstName | Displays the first name of the member. | string |
| lastName | Displays the last name of the member. | string |
| zipCode | Displays the zip code of the member’s location. | string |
| status | Displays the status of the member (active or inactive). By default, it will be active, and can be changed to inactive if the client requests. | string |
| phone | Displays the phone number of the member. | string |
| birthDate | Displays the birthdate of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| anniversaryDate | Displays the anniversary date of the member in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| userProfileImageUrl | Displays the URL of the member’s profile image. | string |
| createDate | Displays the date on which the member was created in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| updateDate | Displays the date on which the member details were updated in yyyy-MM-dd'T'HH:mm:ssZ format. | date (yyyy-mm-dd) |
| extendedAttribute | Displays the extra member attributes which will vary according to the client. | string |
| errorCode | Displays only when the API request fails, this will denote the type of error. | string |
| errorMessage | Displays the reason why the API request has failed. | string |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of positive response is: { "id": "user_1@domain.com", "email": "user_1@domain.com", "firstName": "John", "lastName": "Doe", "zipCode": "90002", "optInStatus": "YES", "status": "ACTIVE", "phone": "123-123-4567", "birthDate": "2018-04-01T00:00:00-0700", "anniversaryDate": "2018-04-01T00:00:00-0700", "userProfileImageUrl": "https://www.socialannex.com/public/manageoptionsdesign16/images/product_landing/loyalty-hover.png", "createDate": "2018-04-01T00:00:00-0700", "updateDate": "2018-04-01T00:00:00-0700", "extendedAttribute": ["UserTier ": "Platinum"] } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } |
Freeze User Account
- Purpose: This method is used to block user IDs and domains, contributing to enhanced security and control measures.
- API Endpoint: https://s15.socialannex.net/api/3.0/blocklist
- Method: POST
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
| Method | URL |
|---|---|
| POST | /blocklist |
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| blockedBy | Enter the member email ID who is going to add members, domains, or both into blocklist. | string |
| blocklistDomains | Enter the list of domains to be added to the blocklist. | string |
| blocklistUsers | Enter the list of users to be added to the blocklist. | string |
Sample Request:
{
"blocklistDomains":
"
example.co.in, example.com,
example.in,
exampledomains.com
",
"blocklistUsers":"testUsr@lorem.com,
testUsr@lorema.com,
testUsr@loremb.com,covid@19.com,
amitdomain1.com,
user1234",
blockedBy":amit.wade@immply.com
} Response:
If no members or domain already exists.
Output Fields:
| Parameter | Parameter Description |
|---|---|
| userBlocklistedData | Displays the list of members who are requested and added into the blocklist. |
| newlyAddedUserIntoBlocklist | Displays the list of members who are newly added into the blocklist. |
| domainBlocklistedData | Displays the list of domains who are requested and added into the blocklist. |
| newlyAddedDomainIntoBlocklist | Displays the list of domains who are newly added into the blocklist. |
| inValidDomain | Displays invalid domains from the requested list. |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 201 |
An example of positive response is: { "userBlocklistedData": { "newlyAddedUserIntoBlocklist": [ "testUsr@lorem.com, testUsr@lorema.com, testUsr@loremb.com, covid@19.com, amitdomain1.com, user1234" ] }, "domainBlocklistedData": { "newlyAddedDomainIntoBlocklist": [ "
" ], "inValidDomain": [ "qwe, 1234" ] }, "blockedBy": "amit.wade@immply.com" } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1001 |
An example of error response is: { "errorCode": "AC1001", "errorMessage": "Oops! Something went wrong." } |
Response:
If members or domains already exist.
Output Fields:
| Parameter | Parameter Description |
|---|---|
| userBlocklistedData | Displays the list of members who are requested and added into the blocklist. |
| newlyAddedUserIntoBlocklist | Displays the list of members who are newly added into the blocklist. |
| domainBlocklistedData | Displays the list of domains who are requested and added into the blocklist. |
| newlyAddedDomainIntoBlocklist | Displays the list of domains who are newly added into the blocklist. |
| inValidDomain | Displays invalid domains from the requested list. |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 201 |
An example of positive response is: { "userBlocklistedData": "alreadyBlocklistedUser": [ "testUsr@lorem.com, testUsr@lorema.com, testUsr@loremb.com, covid@19.com, amitdomain1.com, user1234" ] }, "domainBlocklistedData": { "alreadyBlocklistedDomain": [ " " ], "inValidDomain": [ "qwe, 1234" ] }, "blockedBy": "amit.wade@immply.com" } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1001 |
An example of error response is: { "errorCode": "AC1001", "errorMessage": "Oops! Something went wrong." } |
Unfreeze User Account
- Purpose: This method is used for removing user IDs and domains from the Blocklist on the Annex Cloud site.
- API Endpoint: https://s15.socialannex.net/api/3.0/blocklistdelete
- Method: POST
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Param
| Method | URL |
|---|---|
| POST | /blocklistdelete |
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| deleteBlocklistDomains | Enter the list of domains to delete from the blocklist. | string |
| deleteBlocklistUsers | Enter the list of members to delete from the blocklist. | string |
Sample Request/payload: eter: Customer (Email or ID)
{
"deleteBlocklistDomains":
"
example.co.in, example.com,
example.in,
exampledomains.com
",
"blocklistUsers":"testUsr@lorem.com,
testUsr@lorema.com,
",
"deleteBlocklistUsers":
"testUsr@lorem.com,
testUsr@lorema.com,
testUsr@loremb.com,
covid@19.com,
amitdomain1.com"
} Response:
This will displays requested members or domains or both data for deleting from blocklist.
Output Fields:
| Parameter | Parameter Description |
|---|---|
| deletedUserData | Displays deleted member’s data from the blocklist which was requested by the member. |
| userNotExistedInBlocklist | Displays members which do not exist in the blocklist which was requested by the member. |
| deletedDomainData | Displays deleted domain data from the blocklist which was requested by the member. |
| domainNotExistedInBlocklist | Displays domains which do not exist in the blocklist which was requested by the user. |
Sample Positive Response:
| Status Code | Response | |
|---|---|---|
| 201 |
An example of positive response is: { "deletedUserData": { "deletedUserFromBlocklist": [ "testUsr@lorem.com, testUsr@lorema.com, testUsr@loremb.com, covid@19.com, amitdomain1.com" ] }, "deletedDomainData": { "deletedDomainFromBlocklist": [ "http://loremy.com , http://ak.com " ], "domainNotExistedInBlocklist": [ "
" ] } } |
Earn Tab
- Purpose: This API retrieves the status of all actions performed by a particular member.
- API Endpoint: https://s15.socialannex.net/api/3.0/actions
- Method: POST
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
| Method | URL |
|---|---|
| POST | /actions |
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id (mandatory) | Enter the member’s unique ID. | string |
Sample Request:
{
"id":"joyroy.sa@gmail.com",
} Response:
This will display the action-wise status of the member.
Output Fields:
| Field Name | Description |
|---|---|
| actionId | Displays the unique action id. |
| actionName | Displays the name of the action. |
| actionPoints | Displays the number of points that can be earned by performing this action. |
| maxPoints | Displays the number of maximum points that can be earned by performing this action. |
| period | Displays the period of the action. |
| ratio | Displays the ratio of the action. |
| status | Displays the status of the action whether it is active or not. |
| expireInDays | Displays the number of days after which the action will expire. |
| holdDays | Displays the number of days points would be on hold. |
| actionPerformStatus | Displays the status to be complete or incomplete of the action performed. |
| actionNameDisplay | Displays the display name of the action. |
| actionLimitDisplay | Displays the action limit. |
| requiredCount | Displays the required action count. |
| completedCount | Displays the completed action count. |
| pendingCount | Displays the pending action count. |
| actionLimitReachedFlag | Displays the updated status flag when the action limit is reached. |
| actionLimitReachedStatus | Displays the remaining time to earn points if the action limit is reached. |
| createDate | Displays the date on which the action is created. |
| updateDate | Displays the date on which the action is updated. |
| pages | Displays the total number of pages (for multiple action details). |
| currentPage | Displays the current page number (for multiple action details). |
| errorCode | Displays only when the API request fails, indicating the type of error. |
| errorMessage | Displays the reason why the API request has failed. |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 201 |
An example of positive response is: { "allActionDetails": [ { "actionId": "987", "actionName": "Test 1", "actionPoints": "20", "maxPoints": "40", "period": "70", "ratio": "30", "status": "ACTIVE", "expireInDays": "0", "holdDays": "50", "actionPerformStatus": "0", "actionNameDisplay": "10", "actionLimitDisplay": "188", "requiredCount": "2", "completedCount": "2", "pendingCount": "0", "actionLimitReachedFlag": "1", "actionLimitReachedStatus": "Limit reached. Points can be earned next in 20 days", "createDate": "2019-12-12T10:12:54+0000", "updateDate": "2019-12-12T10:15:16+0000" }, { "actionId": "114", "actionName": "Twitter Share", "actionPoints": "20", "maxPoints": "100", "period": "0", "ratio": "0", "status": "ACTIVE", "expireInDays": "0", "holdDays": "0", "actionPerformStatus": "0", "actionNameDisplay": "inner display", "actionLimitDisplay": "", "requiredCount": "5", "completedCount": "0", "pendingCount": "5", "actionLimitReachedFlag": "0", "actionLimitReachedStatus": "", "createDate": "2019-08-31T13:19:29+0000", "updateDate": "2020-01-25T09:42:51+0000" } } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } |
Manage Reward Tab
- Purpose: This API fetches the reward information for a member.
- API Endpoint: https://s15.socialannex.net/api/3.0/users/{id}/reward
- Method: GET
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
| Method | URL |
|---|---|
| GET | /users/{id}/reward |
Sample Request:
| /users/user@domain.com/reward |
Response:
This will display an array containing all the eligible rewards of the specific member.
Output Fields:
| Parameter | Parameter Description |
|---|---|
| creditsToCurrencyRatio | Displays the points to currency ratio. |
| creditsToCurrencyValue | Displays the converted value of credits to currency according to the ratio. |
| rewardDetails | Displays an array of all loyalty rewards, with the following parameters: |
| rewardId | Displays the specific reward ID. |
| rewardCategory | Displays the reward category. |
| displayText | Displays the reward display text. |
| creditRequired | Displays the credit (points) required to redeem that reward. |
| eligible | Displays 0 if the user is eligible to redeem the reward, else displays 1. |
| rewardUrl | Displays the reward URL. |
| rewardImageUrl | Displays the image URL of the reward. |
| productId | Displays the product ID. |
| errorCode | Displays only when the API request fails, this will denote the type of error. |
| errorMessage | Displays the reason why the API request has failed. |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of positive response is: { "creditsToCurrencyRatio":"0.05", "creditsToCurrencyValue":5, "rewardDetail": [ { "rewardId": "111", "rewardCategory": "", "displayText": "$5 off gift card", "creditRequired": "500", "eligible":"1", "rewardUrl": "www.example.com/reward", "rewardImageUrl": "www.example.com/example.png" }, { "rewardId": "112", "rewardCategory": "", "displayText": "XYZ product", "creditRequired": "1000", "eligible":"0", "rewardUrl": "www.example.com/reward", "rewardImageUrl": "www.example.com/example.png", "productId": "P1" } ] } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 / AC1005 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } If Data not found!! { "errorCode": "AC1005", "errorMessage": "No data found" } |
Claimed Reward
- Purpose: This API displays details of all rewards claimed by the member.
- API Endpoint: https://s15.socialannex.net/api/3.0/users/{id}/usedreward
- Method: GET
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
Request:
| Method | URL |
|---|---|
| GET | /users/{id}/usedreward |
Sample Request for All Actions Details:
| /users/user@domain.com/usedreward |
Response:
This will display the details of the rewards used by the customer.
Output Fields:
| Parameter | Parameter Description |
|---|---|
| rewardCode | Displays the reward code. |
| pointsUsed | Displays the points used to redeem that reward. |
| rewardName | Displays the name of the reward. |
| rewardStatus | Displays the status of the reward. |
| reason | Displays the reason. |
| createDate | Displays the date on which the reward is claimed. |
| pages | Displays the total number of pages. |
| currentPage | Displays the current page number. |
| errorCode | Displays only when the API request fails, this will denote the type of error. |
| errorMessage | Displays the reason why the API request has been failed. |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of positive response is: { "rewardDetail": [ { "rewardCode": "Code001", "pointsUsed": "100", "rewardName": "$5 coupon", "rewardStatus": "Claimed", "reason": "", "createDate": "2019-06-10T06:22:58+0000" }, { "rewardCode": "Code002", "pointsUsed": "200", "rewardName": "$10 Reward", "rewardStatus": "Claimed", "reason": "", "createDate": "2019-06-10T07:22:54+0000" } ], "pages": 1, "current_page": 1 } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } |
| HTTP Codes | Code | Status |
|---|---|---|
| 200 - Ok | Successful operation | |
| 201 - Ok | Successful operation | |
| 404 Not Found | AC1001 | Oops! Something went wrong |
| 401 Unauthorized | AC1002 | Request not authorized |
| 400 Bad Request | AC1004 | Missing parameters |
|
404 Not Found or 400 Bad Request |
AC1005 | No data found |
| 409 Conflict | AC1006 | Data already exists |
|
400 Bad Request or 422 Unprocessable Entity |
AC1007 | Invalid parameters |
| 403 Forbidden | AC1009 | Opt out user |
| 404 Not Found | AC1012 | User not found |
| 400 Bad Request | AC1016 | Some of products are fraud |
| 400 Bad Request | AC1019 | Invalid status |
| 400 Bad Request | AC1025 | Unable to redeem points |
| 422 Invalid Parameters | AC1033 | Invalid parameter value passed |
| 401 Unauthorized | AC2007 | API key not found in JWT |
| 404 Not Found | AC2013 | Group not exist |
| 400 Bad Request | AC2018 | Number of activities requested has exceeded limit. Maximum is 100 activities per page. |
| 400 Bad Request | AC2019 | Activities not found |
- Purpose: This API retrieves the details of all activities performed by the member, including points debited or credited to their account.
- API Endpoint: https://s15.socialannex.net/api/3.0/users/{id}/activity
- Method: GET
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
Request:
| Method | URL |
|---|---|
| GET | /users/{id}/activity |
Sample Request:
| /users/user@domain.com/activity |
Response:
This will display an array of all activities performed by the member. Which includes activity name, activity date, points balanced till that activity, order ID(will be displayed only for purchase activities) and redemption amount.
Output Fields:
| Parameter | Parameter Description |
|---|---|
| activityDetail | Displays an array of all activity details with the following fields. |
| actionId | Displays unique action identifier (in the SA system) used to identify member action or event. |
| rewardId | Displays unique reward identifier (in the SA system) used to identify the reward. |
| activity | Displays the name of the activity. |
| credit or debit | Displays the number of points credited or debited from the member's account. |
| displayText | Displays the display text of the activity. |
| createDate | Displays the date (yyyy-mm-dd) and time on which the points are awarded to the member. |
| expireDate | Displays the date (yyyy-mm-dd) and time on which the points will expire. |
| pointStatus | Displays the point status as Hold, Redeemed, Release, and so on. |
| holdPointReleaseDate | Displays the date on which hold points would be released (yyyy-mm-dd). |
| pages | Displays the number of pages present in the member activity response. |
| currentPage | Displays the current page number. |
| errorCode | Displays only when the API request fails, this will denote the type of error. |
| errorMessage | Displays the reason why the API request has been failed. |
Sample Positive Response:
| Status Code | Response |
|---|---|
| 200 |
An example of positive response is: { "activityDetail": [ { "actionId": "105", "activity": "CREDIT", "credit": "100", "displayText": "Join Rewards Program", "createDate": "2018-08-08T07:35:01+0000", "expireDate": "2019-08-08T23:59:59+0000" }, { "rewardId": "24", "activity": "DEBIT", "debit": "100", "displayText": "$5 coupon", "createDate": "2018-08-08T07:55:30+0000" }, { "actionId": "100", "activity": "CREDIT", "credit": "100", "pointStatus": "Released", "displayText": "Manual Credit/Debit", "createDate": "2019-04-23T12:14:29+0000", "expireDate": "2019-08-08T23:59:59+0000" }, { "actionId": "109", "activity": "CREDIT", "credit": "50", "pointStatus": "Released", "displayText": "Purchase", "orderId": "TESTORDER04", "createDate": "2018-08-13T05:48:46+0000", "expireDate": "2019-08-15T23:59:59+0000" }, { "actionId": "109", "activity": "CREDIT", "credit": "50", "pointStatus": "Hold", "Released, "Redeem" , "Displays", "Cancel", "Custom deduction "displayText": "Purchase", "orderId": "TESTORDER04", "createDate": "2018-08-13T05:48:46+0000", "expireDate": "2019-08-15T23:59:59+0000", "holdPointsReleaseDate": "2018-08-13T05:48:46+0000" } ], "pages": 1, "currentPage": 1 |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } |
Manage Points
- Purpose: This API allows you to give, redeem, or award loyalty points to the member.
- API Endpoint: https://s15.socialannex.net/api/3.0/points
- Method: POST
- Request Object: Not blank
- Function Location in Extension: ANNEXCLOUDV3SERVICE
- Input Parameter: Customer (Email or ID)
| Method | URL |
|---|---|
| POST | /points |
To give points:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id (Mandatory) | Enter the member’s unique ID. | string |
| actionId (Mandatory) | Enter the action ID (it is mandatory if the action ID is set at the site admin). | string |
| activity (Mandatory) | Enter the activity as CREDIT or DEBIT. | string |
| orderId (optional) | If the activity is DEBIT, pass the order ID. | string |
| reason | Enter the reason for adding or removing the points. (If the actionId is not passed, then the reason is mandatory). | string |
To redeem points:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id (Mandatory) | Enter the member’s unique ID. | string |
| rewardId (Mandatory) | Enter the reward ID (it is mandatory if the reward ID is set at the site admin). | string |
| activity (Mandatory) | Enter the activity as CREDIT or DEBIT. | string |
| orderId (optional) | If the activity is DEBIT, pass the order ID. | string |
| reason | Enter the reason for adding or removing the points (If the reward ID is not passed, then the reason is mandatory). | string |
| source (optional) | Enter the source as web or store. | string |
To redeem custom points:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id (Mandatory) | Enter the member’s unique ID. | string |
| activity (Mandatory) | Enter the activity as DEBIT. | string |
| orderId (optional) | If the activity is DEBIT, pass the order ID. | string |
| debit (Mandatory) | Enter the number of debited points. | string |
| reason (mandatory) | Enter the reason for adding or removing the points. | string |
| source (optional) | Enter the source as web or store. | string |
To award or deduct custom points:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id (Mandatory) | Enter the member’s unique ID. | string |
| actionId (Mandatory) | Enter the action ID. (It is mandatory if the action ID is set at the site admin) | string |
| activity (Mandatory) | Enter the activity as CREDIT or DEBIT. | string |
| orderId (optional) | If the activity is DEBIT, pass the order ID. | string |
| credit or debit (Mandatory) | Enter the number of credited or debited points. | string |
| reason | Enter the reason for adding or removing the points. (If the action ID is not passed then the reason is mandatory) | string |
Sample Request:
To give points:
{
"id": "user@domain.com",
"actionId": "100",
"activity": "CREDIT",
"reason": "aj Bonus"
"credit": "50"
} To redeem points:
{
"id": "user@domain.com",
"rewardId": "111",
"activity": "DEBIT",
"orderId": "OD001",
"reason":"claim"
"source":"web"
} To redeem custom points:
{
"id": "user@domain.com",
"activity": "DEBIT",
"orderId": "OD001",
"debit": "500",
"reason":"used for purchase"
"source":"web"
} To award custom points:
{
"id": "user@domain.com",
"actionId": "100",
"activity": "CREDIT",
"credit": "50",
"reason":"bonus"
}To deduct custom points:
{
"id": "user@domain.com",
"actionId": "100",
"activity": "DEBIT",
"orderId": "OD001",
"debit": "50",
"reason":"adjustment"
} Response:
This will display a success response with the details of the points that are added or redeemed from the member’s account.
Output Fields:
| Parameter | Parameter Description | Parameter Type |
|---|---|---|
| id | Displays the unique customer id. | string |
| actionId | Displays the particular action id. | string |
| activity | Displays the action as credit or debit. | string |
| credit | Displays the number of points credited in the member's account. | integer |
| pointsAwarded | Displays the number of points awarded. | integer |
| updatedUserTier | Displays the updated user tier after the points awarded or removed. | string |
| updatedAvailablePoints | Displays the number of updated available points. | integer |
| updatedLifetimePoints | Displays the number of updated lifetime points. | integer |
| releaseDate | Displays the release date in yyyy-mm-dd format on which the hold points will be released. | date (yyyy-mm-dd) |
| reason | Displays the reason for adding or removing the points. | string |
| errorCode | Displays only when the API request fails, this will denote the type of error. | string |
| errorMessage | Displays the reason why the API request has been failed. | string |
Sample Positive Response:
| Status Code | Response |
| 200 |
An example of a positive response is: Give points response: { "id": "johan28.sa@gmial.com", "actionId": 100, "activity": "CREDIT", "credit": 50, "pointsAwarded": 50, "reason": "aj Bonus", "updatedUserTier": "Gold", "updatedAvailablePoints": "7561", "updatedLifetimePoints": "7561" } Redeem points response: { "id": "user@domain.com", "rewardId": "111", "activity": "DEBIT", "orderId": "OD001", "debit": "500", "reason": "claim", "updatedUserTier": "Gold", "updatedAvailablePoints": "4545", "updatedLifetimePoints": "7860" } Redeem custom points response: { "id": "user@domain.com", "activity": "DEBIT", "orderId": "OD001", "debit": "500", "reason": "used for purchase", "updatedUserTier": "Gold", "updatedAvailablePoints": "4545", "updatedLifetimePoints": "7860" } Add custom points response: { "id": "user@domain.com", "actionId": "100", "activity": "CREDIT", "credit": "50", "reason": "bonus", "updatedUserTier": "Gold", "updatedAvailablePoints": "4545", "updatedLifetimePoints": "7860" } Deduct custom points response: { "id": "user@domain.com", "actionId": "100", "activity": "DEBIT", "orderId": "OD001", "debit": "50", "reason": "adjustment", "updatedUserTier": "Gold", "updatedAvailablePoints": "4545", "updatedLifetimePoints": "7860" } |
Sample Error Response:
| Status Code | Response |
|---|---|
| AC1002 |
An example of error response is: { "errorCode": "AC1002", "errorMessage": "Request Not Authorized" } |
Response Codes
| HTTP Codes | Code | Status |
|---|---|---|
| 200 - Ok | Successful operation | |
| 201 - Ok | Successful operation | |
| 404 Not Found | AC1001 | Oops! Something went wrong |
| 401 Unauthorized | AC1002 | Request not authorized |
| 400 Bad Request | AC1004 | Missing parameters |
|
404 Not Found or 400 Bad Request |
AC1005 | No data found |
| 409 Conflict | AC1006 | Data already exists |
|
400 Bad Request or 422 Unprocessable Entity |
AC1007 | Invalid parameters |
| 403 Forbidden | AC1009 | Opt out user |
| 404 Not Found | AC1012 | User not found |
| 400 Bad Request | AC1016 | Some of products are fraud |
| 400 Bad Request | AC1019 | Invalid status |
| 400 Bad Request | AC1025 | Unable to redeem points |
| 422 Invalid Parameters | AC1033 | Invalid parameter value passed |
| 401 Unauthorized | AC2007 | API key not found in JWT |
| 404 Not Found | AC2013 | Group not exist |
| 400 Bad Request | AC2018 | Number of activities requested has exceeded limit. Maximum is 100 activities per page. |
| 400 Bad Request | AC2019 | Activities not found |