POST / PUT - Customer

Post / Put a Customer. Both Http verbs will create / update a provided customer

URL

Verb Url Json object
POST OR PUT - Basic authentication /api/apiCustomer?ShopCode=shopcode Single APICustomer

Request Parameters

Parameter Description Format
ShopCode Shop identifier as provided with your account string

Json: APICustomer

        
            
        {
        "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 */
        }
        ]
        }

        
    

Response Elements

Name Description Example
APICustomer Updated customer object See Request object

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();
            }
        }