ModifyCustomer

The function will allow for the modification of customer records. The complete customer record must be provided including the fields that have been modified. To obtain the complete customer record, use the GetCustomer API method.

POST body(JSON):

company_id(int) - Unique Company Id in the PDM system. Required.
session_token(string) - Session Token valid for finite period of time (See expiry date/time). Issued by the GetSession API call.
customer
    customer_id(int) - Unique Customer Id in the PDM system. Required*.
    
external_customer_ref(string) - External Customer Reference. Required*. Max length = 50
    title(string) - Customer Title. Max Length 12
    first_name(string) - Customer First Name. Required. Max length = 50
    last_name(string) - Customer Last Name. Required. Max length = 50
    gender(string) - Gender (Male / Female)
    dob(string) - Customer Date of Birth. Format YYYY-MM-DD
    address
        line_1(string) - Customer Address Line 1. Required. Max length = 50
        line_2(string) - Customer Address Line 2. 
        line_3(string) - Customer Address Line 3. 
        city(string) - Customer Address City. Required. Max length = 50
        county(string) - Customer Address County. 
        postal_code(string) - Customer Address Postcode. Required. Max length = 20
    email_address(string) - Email Address. Max length = 250
    tel_number_1(string) - Telephone Number 1. Max length = 50
    tel_number_2(string) - Telephone Number 2. Max length = 50
    active(boolean) - Customer Active (true / false)

*either customer_id or external_customer_ref are required, but not both. If both are provided, both will be tried starting with customer_id and using first match.

Example

{
"company_id": 9001,
"session_token": "9001|85d1c76d-5088-4cbe-a681-f3a86594dac9|0001",
"customer": {
"customer_id": 1408,
"external_customer_ref": "EXTREF165116",
"title": "Mr",
"first_name": "Joe",
"last_name": "Bloggs",
"gender": "Male",
"dob": "1968-11-06",
"address": {
"line_1": "Test Address Line 1",
"line_2": "Test Address Line 2",
"line_3": "",
"city": "Test City",
"county": "Test County",
"postal_code": "TT11 1TT"
},
"email_address": "joe@blogs.com",
"tel_number_1": "",
"tel_number_2": "",
"active": 1
}
}

Response(JSON):

status
    code(int) - See status codes
    details(string) - Response details
customer 
    customer_id(int) - Unique Customer Id from the PDM system
    customer_ref(string) - Unique Customer Reference with the format C######
    external_customer_ref(string) - External Customer Reference

Response status codes:

101 = OK
201 = Invalid / inactive company ID
202 = Invalid session token
203 = Session token expired
204 = IP address not approved
205 = Rate limit exceeded
301 = Required data missing(list fields in status details)
302 = Data exceeded parameters(list fields in status details)
303 = Incorrect data type(list fields in status details)
401 = No matching customer found
500 = General service error

Example

{ 
"status": {
"code": 101,
"details": "OK"
},
"customer": {
"customer_id": 1408,
"customer_ref": "C001408",
"external_customer_ref": "EXTREF164736"
}
}