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 bodyTypeDescription
contactIdsList[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:

statusCodeMessage
406loyaltyIds list not provided
406Empty request body
500Internal 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 bodyTypeDescription
loyaltyIdsList[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:

statusCodeMessage
406contactIds list not provided
406Empty request body
500Internal 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 bodyTypeDescription
loyaltyIdsStringloyaltyId of a profile
issuedPointsNumberAmount of points
typeStringthe type shows if the points are Incidental or Purchase
expirationTypeStringShows 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:

statusCodeMessage
406data to insert not provided
406Empty request body
500Internal 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 bodyTypeDescription
loyaltyIdsList[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:

statusCodeMessage
406List of loyalty id is empty
406the Body is empty
500Internal 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 bodyTypeDescription
loyaltyIdsStringloyaltyId of a profile
Benefitslistlist of benefits you want to redeem
BenefitIdStringthe tierBenefitId
TransactionIdStringTransactionId 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:

statusCodeMessage
406LoyaltyID not found
406Empty request body
500Internal 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 bodyTypeDescription
loyaltyIdloyaltyId of a customerTable Data
expirationDateDateexpirationDate of the voucher created
amountNumberVoucher'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:

statusCodeMessage
406vouchers to create not provided
406Empty request body
500Internal 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 bodyTypeDescription
loyaltyIdStringloyaltyId of a customer
voucherslistlist of vouchers you want to redeem
voucherIdStringthe voucher code
TransactionIdStringTransactionId 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:

statusCodeMessage
404LoyaltyID not found
406Empty request body
500Internal 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.