POST - UpdateLoyaltyPoints
Update loyalty points on a customer cards.
URL
Verb |
Url |
POST - Basic authentication |
/api/apiCustomer/UpdateLoyaltyPoints?ShopCode=shop code&CustomerIdentifier=customer identifier&LoyaltyCardnumber=loyaltycard used&Points=extra points&RewardedPoints=points to deduct |
Request Parameters
Parameter |
Description |
Format |
ShopCode |
Shop identifier as provided with your account |
string |
CustomerIdentifier |
Identifier of the Customer a known within RetailNxt |
string |
LoyaltyCardNumber |
The cardnumber for which the points need to be processed |
string |
Points |
The points that need to be added to the balance of the LoyaltyCardNumber |
integer |
RewardedPoints |
The points that need to be deducted from the balance of the LoyaltyCardNumber |
integer |
Response Elements
[
{
"Identifier":"RTN_LOY_123",
"CustomerNumber": 123, /* Used for Identification in POST / PUT / DELETE */
"Surname":"Lastname", /* Used for Identification in POST / PUT / DELETE */
"Insertion":"Between Initials and Lastname",
"Initials":"Initials",
"Name": "Firstname",
"PhoneNumber":"0123-456789",
"DateOfBirth":"yyyy-MM-dd",
"MobileNumber":"06-12345678",
"Email":"someone@somewhere.com", /* Used for Identification in POST / PUT / DELETE */
"Gender": "M",
"Newsletter": true, /* Customer wants to recieve the Newsletter */
"Advertisement": true, /* Customer wants to recieve Advertising */
"IsDebtor": true, /* Is the customer known as a Debtor in RetailNxt. This property cannot be saved to RetailNxt from the API */
"Branch":
{
"Identifier": "FL_NL_1",
"StoreEanAddresscode": "1234567890123",
"MainStoreEanAddresscode": "3210987654321",
"Name": "ShopName",
"Description": "Fullname of Shop",
"Active": true,
"StoreFormat": "Formula",
"Addresses":
[
{
"Street":"streetname",
"Housenumber": 1,
"HouseNumberExtension":"a",
"Residence":"City",
"ZipCode":"1234AA",
"Country":"NL",
"Type":"address type" /* Default Postadres */
}
]
},
"Addresses":
[
{
"Street":"streetname",
"Housenumber": 1,
"HouseNumberExtension":"a",
"Residence":"City",
"ZipCode":"1234AA",
"Country":"NL",
"Type":"address type" /* Default Postadres */
}
],
"LoyaltyCards":
[
{
"Identifier": 123, /* Internal identifier of the Card */
"LoyaltyCardNumber": "9875461230879",
"LoyaltyPoints": 100, /* Total points saved */
"RewardedLoyaltyPoints": 10, /* Total points rewarded */
"RemainingAmount": 0.50, /* Amount below 1 point saved */
"LoyaltyCardRowId": 123, /* Internal identifier of the Card */
"RemainingLoyaltyPoints": 90 /* LoyaltyPoints - RewardedLoyaltyPoints */
}
]
}
,
{ ... (next customer) ... }
]
Code Samples
C#.net
public async void Post(List<APIObject> APIObjects, string Url, string SourceUser, SourcePassword)
{
using (System.Net.Http.HttpClient client = new System.Net.Http.HttpClient())
{
System.Net.Http.HttpContent content = Newtonsoft.Json.JsonConvert.SerializeObject(APIObjects);
string credentials = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(SourceUser + ":" + SourcePassword));
content.Headers.Add("Authorization", "Basic " + credentials);
var response = await client.PostAsync(Url, content);
var responseString = await response.Content.ReadAsStringAsync();
}
}