Engagement Hub API Documentation
ENGAGEMENT HUB API
Getting Started
Loyalty APIs
The application provides custom api
Customer APIs
Loyalty APIs
Voucher APIs
Customer OnBoarding
Description
this API gives you the possiblity to On-board a customer on the loyalty program.
URL
/services/apexrest/veloyalty/v1.0/customer/onboard
Method
POST
Request body
The Post method can have a request body as JSON format,and for Onboarding Api we need to fetch the contactId of the customer. You can pass a list of contactIds separated by commas.
Request body | Type | Description |
---|---|---|
contactIds | List[string] | conatctId of a customer |
Example:
{
“contactIds”:[“XXXXXXXXXXXXXXXXX”]
}
Success Response:
Code: 200
Content:
{
“statusMessage”: null,
“statusCode”: 200,
“profiles”: [
{
“totalPoints”: 0,
“tierRequiredPoints”: null,
“tierImg”: null,
“tier”: “default”,
“statusCode”: 201,
“startDate”: null,
“reservedPoints”: 0,
“redeemedPoints”: 0,
“nextTierRequiredPoints”: null,
“nextTierImg”: null,
“nextTier”: null,
“message”: null,
“id”: “XXXXXXXXXXXXXXXXX”,
“expiredPoints”: null,
“expirationDate”: null,
“customerProfession”: null,
“customerPhoto”: null,
“customerName”: null,
“customerId”: null,
“countryName”: null,
“contactId”: “XXXXXXXXXXXXXXXXX”,
“confirmedPoints”: 0,
“companyName”: null,
“code”: “CARD-XXXXXXX”,
“active”: null,
“accountId”: null
}
]
}
Error Responses:
statusCode | Message |
---|---|
406 | loyaltyIds list not provided |
406 | Empty request body |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://platform-nosoftware-5450.cs92.my.salesforce.com/services/apexrest/veloyalty/v1.0/voucher/create/ \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘[
{
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“expirationDate”:”2021-03-29″,
“amount” :10
}
]
‘
Notes:
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.
Customer OffBoarding
Description
This Api gives you the possiblity to Off-board customer on the loyalty program.
URL
/services/apexrest/veloyalty/v1.0/customer/offboard
Method
POST
Request body
The Post method can have a request body as JSON format,and for Offboarding Api we need to fetch the loyaltyId of the profile. You can pass a list of loyaltyIds separated by commas.
Request body | Type | Description |
---|---|---|
loyaltyIds | List[string] | loyaltyId of a profile |
Example:
{
“loyaltyIds”:[“XXXXXXXXXXXXXXXXX”]
}
Success Response:
Code: 200
Content:
{
“statusMessage”: “Ok”,
“statusCode”: 200,
“profiles”: [
{
“statusMessage”: “Customer removed from loyalty program”,
“statusCode”: 204,
“profileId”: “XXXXXXXXXXXXXXXXX”
}
]
}
Error Responses:
statusCode | Message |
---|---|
406 | contactIds list not provided |
406 | Empty request body |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://platform-nosoftware-5450.cs92.my.salesforce.com/services/apexrest/veloyalty/v1.0/customer/offboard \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘{
“loyaltyIds”:[“XXXXXXXXXXXXXXXXX”]
}’
Notes:
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.
Customer AssignPoints
Description
this API gives you the possiblity to assign points for a customer.
URL
/services/apexrest/veloyalty/v1.0/loyaltypoints/assign
Method
POST
Request body
You can assign multiple points for a customer or multiple customer .
Request body | Type | Description |
---|---|---|
loyaltyIds | String | loyaltyId of a profile |
issuedPoints | Number | Amount of points |
type | String | the type shows if the points are Incidental or Purchase |
expirationType | String | Shows if the expiration type is Hard expiration or Rolling expiration |
Example:
[
{
“issuedPoints”:30.0,
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“type”:”Purchase points”,
“expirationType”:”Rolling expiration”
}
]
Success Response:
Code: 200
Content:
{
{
“statusMessage”: “point assigned”,
“statusCode”: 200,
“points”: [
{
“usedPoints”: null,
“type”: “Incidental points”,
“statusCode”: 200,
“source”: “web”,
“recalculated”: false,
“reason”: null,
“order”: null,
“message”: “points assigned”,
“loyaltyId”: “XXXXXXXXXXXXXXXXX”,
“issuedPoints”: 20,
“expiredPoints”: null,
“expirationType”: “Rolling expiration”,
“expirationDate”: null,
“earnedPointsId”: null,
“confirmed”: true,
“amount”: null,
“activePoints”: null
}
]
}
Error Responses:
statusCode | Message |
---|---|
406 | data to insert not provided |
406 | Empty request body |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://platform-nosoftware-5450.cs92.my.salesforce.com/services/apexrest/veloyalty/v1.0/loyaltypoints/assign/ \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘[
{
“issuedPoints”:20,
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“type”:”Incidental points”,
“expirationType”:”Rolling expiration”
}
]
‘
Notes:
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.
Get Loyalty info
Description
this API gives you the possiblity to get all informations related to a customer include points , Benefits .
URL
/services/apexrest/veloyalty/v1.0/loyalty/info
Method
POST
Request body
The Post method can have a request body as JSON format,for this Api we need to pass the loyaltyId of the profile. You can pass a list of loyaltyIds separated by commas.
Request body | Type | Description |
---|---|---|
loyaltyIds | List[string] | loyaltyId of a profile |
Example:
{
“loyaltyIds”:[“XXXXXXXXXXXXXXXXX”]
}
Success Response:
Code: 200
Content:
{
“statusMessage”: “Ok”,
“statusCode”: 200,
“loyaltyProfiles”: [
{
“statusMessage”: “Ok”,
“statusCode”: 200,
“profileId”: “XXXXXXXXXXXXXXXXX”,
“info”: {
“totalPoints”: 0,
“tierRequiredPoints”: null,
“tierImg”: null,
“tier”: “default”,
“statusCode”: null,
“startDate”: null,
“reservedPoints”: 0,
“redeemedPoints”: 0,
“nextTierRequiredPoints”: null,
“nextTierImg”: null,
“nextTier”: null,
“message”: null,
“id”: “XXXXXXXXXXXXXXXXX”,
“expiredPoints”: null,
“expirationDate”: null,
“customerProfession”: null,
“customerPhoto”: null,
“customerName”: null,
“customerId”: null,
“countryName”: null,
“contactId”: “XXXXXXXXXXXXXXXXX”,
“confirmedPoints”: 0,
“companyName”: null,
“code”: “CARD-XXXXXXX”,
“active”: null,
“accountId”: null
},
“benefits”: {}
}
]
}
Error Responses:
statusCode | Message |
---|---|
406 | List of loyalty id is empty |
406 | the Body is empty |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://platform-nosoftware-5450.cs92.my.salesforce.com/services/apexrest/veloyalty/v1.0/loyalty/info/ \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘{
“loyaltyIds”:[“XXXXXXXXXXXXXXXXX”]
}’
Notes:
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.
Redeem benefits
Description
Redeem Benefits API will make sure that the redeemed benefit are tracked in realtime, so the customer cannot use them twice.
URL
/services/apexrest/veloyalty/v1.0/benefit/redeem
Method
POST
Request body
Request body | Type | Description |
---|---|---|
loyaltyIds | String | loyaltyId of a profile |
Benefits | list | list of benefits you want to redeem |
BenefitId | String | the tierBenefitId |
TransactionId | String | TransactionId of the redeemedBenfit |
Example:
{
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“Benefits”:[
{
“BenefitId”:”XXXXXXXXXXXXXXXXX”,
“TransactionId”:”orderTest”
}
]
}
Success Response:
Code: 200
Content:
{
“statusMessage”: “ok”,
“statusCode”: 200,
“loyaltyId”: “XXXXXXXXXXXXXXXXX”,
“benefits”: [
{
“transactionId”: “orderTest”,
“statusMessage”: “Ok”,
“statusCode”: 201,
“benefitId”: “XXXXXXXXXXXXXXXXX”
}
]
}
Error Responses:
statusCode | Message |
---|---|
406 | LoyaltyID not found |
406 | Empty request body |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://platform-nosoftware-5450.cs92.my.salesforce.com/services/apexrest/veloyalty/v1.0/benefit/redeem/ \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘{
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“Benefits”:[
{“BenefitId”:”XXXXXXXXXXXXXXXXX”,
“TransactionId”:”orderTest”
}
]
}’
Notes:
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.
Get Vouchers
Create Voucher
Description
Create Vouchers API will make sure that the create personal voucher using Loyalty total points and get back the created vouchers.
URL
/services/apexrest/veloyalty/v1.0/voucher/create
Method
POST
Request body
The Post method can have a request body as JSON format,and for this Api we need to pass the loyaltyId of the profile, expirationDate (when the voucher will expire) and Voucher's amount(how much points needed to create this voucher).
Request body | Type | Description |
---|---|---|
loyaltyId | loyaltyId of a customer | Table Data |
expirationDate | Date | expirationDate of the voucher created |
amount | Number | Voucher's Amount |
Example:
[
{
“loyaltyId”:”XXXXXXXXXXX XXXXXX”,
“expirationDate”:”2021-03-29″,
“amount” :10
}
]
Success Response:
Code: 200
Content:
{
“vouchers”: [
{
“voucherValue”: null,
“voucherNumber”: null,
“voucherId”: null,
“statusCode”: 406,
“status”: null,
“oneTimeUse”: null,
“monetaryValue”: null,
“message”: “no enough points”,
“loyaltyId”: “XXXXXXXXXXXXXXXXX”,
“expirationDate”: “2021-03-29”,
“code”: null,
“amount”: 10,
“active”: null
}
],
“statusMessage”: “OK”,
“statusCode”: 200
}
Error Responses:
statusCode | Message |
---|---|
406 | vouchers to create not provided |
406 | Empty request body |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://platform-nosoftware-5450.cs92.my.salesforce.com/services/apexrest/veloyalty/v1.0/voucher/create/ \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘[
{
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“expirationDate”:”2021-03-29″,
“amount” :10
}
]
‘
Redeem Vouchers
Description
Redeem Vouchers API will make sure that the redeemed vouchers are tracked in realtime, so the customer cannot use them more than it should be.
URL
/services/apexrest/veloyalty/v1.0/voucher/redeem
Method
POST
Request body
Request body | Type | Description |
---|---|---|
loyaltyId | String | loyaltyId of a customer |
vouchers | list | list of vouchers you want to redeem |
voucherId | String | the voucher code |
TransactionId | String | TransactionId of the redeemedvoucher |
Example:
{
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“vouchers”:[
{
“voucherId”:”VOUCHER-XXXXXX”,
“transactionId”:”Test”
}
]
}
Success Response:
Code: 200
Content:
{
“statusMessage”: “ok”,
“statusCode”: 200,
“loyaltyId”: “XXXXXXXXXXXXXXXXX”,
“vouchers”: [
{
“transactionId”: “Test”,
“statusMessage”: “Ok”,
“statusCode”: 201,
“voucherId”: “VOUCHER-XXXXXX”
}
]
}
Error Responses:
statusCode | Message |
---|---|
404 | LoyaltyID not found |
406 | Empty request body |
500 | Internal Server Error |
Sample Call:
curl -X POST \
https://site-efficiency-9583.cs94.my.salesforce.com/services/apexrest/veloyalty/v1.0/voucher/redeem/ \
-H ‘authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ \
-d ‘{
“loyaltyId”:”XXXXXXXXXXXXXXXXX”,
“vouchers”:[
{
“voucherId”:”VOUCHER-XXXXXX”,
“transactionId”:”Test”
}
]
}’
Notes:
This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.