cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CCOM Integration with External system

raveedriaz
Explorer
0 Kudos
268

Hi All,
I am trying to integrate CCO loyalty records with external system.
I have configured the communication as follow.

External API which I have created is on .net core type PUT and body structure is same as of the LoyaltyRecord in CCO api documentation

The issues is when I run the job for Loyalty records: Repost it gives me the following message but in reality there are records which still needs to be synced.
Kindly let me know if there is anything else which needs to be done.

External API accepts the following structure successfully

{
  "loyaltyRecords": [
    {
      "id": "",
      "externalLoyaltyId": "",
      "loyaltyUserId": "U001011",
      "companyId": "",
      "posSystemId": "",
      "posGroupId": "",
      "reference": "referd",
      "source": "",
      "version": "",
      "timestamp": "2021-05-21T06:59:24.709Z",
      "processingStatus": "INITIALIZED",
      "reason": "",
      "salesItems": [
        {
          "articleId": "",
          "articleGroup": "",
          "articleName": "",
          "grossAmount": 0,
          "netAmount": 0,
          "currency": "",
          "quantity": 0,
          "unitOfMeasure": "",
          "salesPersonId": "",
          "salesItemType": ""
        }
      ],
      "paymentItems": [
        {
          "paymentMethod": "",
          "amount": 0,
          "currency": "",
          "creditCardType": ""
        }
      ],
      "loyaltyPayments": [
        {
          "loyaltyAccountId": "",
          "loyaltyAccountType": "",
          "pointValue": 0,
          "amount": 0
        }
      ],
      "couponAssignments": [
        {
          "instanceId": "",
          "amount": 0,
          "currency": ""
        }
      ],
      "additionalData": [
        {
          "key": "",
          "value": ""
        }
      ],
      "evaluationSteps": [
        {
          "message": "",
          "timestamp": "2021-05-21T06:59:24.709Z",
          "actionType": "CALCULATE_POINTS",
          "loyaltyAccountId": "L001051",
          "points": 0
        }
      ],
      "currency": "string",
      "totalGrossAmount": 100,
      "totalNetAmount": 100
    }
  ]
}

Accepted Solutions (0)

Answers (1)

Answers (1)

JoergAldinger
Active Contributor
0 Kudos

Hello raveedriaz

We haven't done any loyalty point integration, but we have created an API that receives CCOM receipts so they are posted to an external system (it works similar to the endpoint you are configuring).

During testing we noticed that the .NET Core Web API rejects the payload submitted by CCOM, specifically because of the "Content-Type" header. The reason is CCOM including the encoding in the content-type in a way that is unsupported by .NET Web APIs.

Our solution was to "fix" the Content-Type header submitted by CCOM so that it is accepted by our API, by dropping an nginx proxy server in between with the following configuration:

location /pos-invoice-api/ {
	proxy_pass http://127.0.0.1/;
	proxy_set_header content-type "application/json";
}

Maybe this information can help you with your problem.

Best regards,

Joerg.