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.
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:
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.
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:
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 .
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:
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.
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:
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
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:
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).
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:
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
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:
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.