cancel
Showing results for 
Search instead for 
Did you mean: 

Add customer to Loyalty from API

Fedias
Participant
0 Kudos

Hi.

We are trying to create a small plugin in SAP Business One to send/create the new customer directly to the CCO Manager Loyalty system

We are using the bellow

POST: http://127.0.0.1:8090/ccos/api/internal/users
{
"publicId": "C10043",
"userName": "C10043",
"state": "ACTIVE",
"email": "email@email.com",
"firstName": "CustomerName",
"lastname": "CustomerLastName"
}

The customer is created in the CCO Manager Loyalty Accounts correctly. When we sync the CCO client and try to create a sales receipt on this customer, the CCO doesn't recognize him as Loyalty.

If we try to select him and click the Create Loyalty button, we are getting the message that customer already exists in Loyalty. What might be the issue?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

In FP11 the payload for POST: http://[server]:[port]/ccos/api/internal/users needs to be enhanced by identities array. To use customer C10043 as an example:

{
"publicId": "C10043",
"userName": "C10043",
"state": "ACTIVE",
"email": "email@email.com",
"firstName": "CustomerName",
"lastname": "CustomerLastName",

"identities" : [{
"value" : "C10043"
}]
}

From FP12 onwards (correct at time of posting this answer, subject to change) the payload has to be enhanced with "customerId" for POST: http://[server]:[port]/ccos/api/internal/users

An example of a correct payload for customer C10043 is:

{
"customerId": "C10043",

"userName": "C10043",

"email": "email@email.com",
"firstName": "CustomerName",
"lastname": "CustomerLastName"
}

Kind regards,

Gunther

Fedias
Participant
0 Kudos

Thanks gunther.sandtner2

It works! customerId was the missing field.