CreateCustomer

The function will allow for the creation of customers.

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
    external_customer_ref(string) - External Customer Reference. 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)

Example

{
"company_id": 9001,
"session_token": "9001|85d1c76d-5088-4cbe-a681-f3a86594dac9|0001",
"customer": {
"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
    created(string) - Date Created. Format YYYY-MM-DD
    last_modified(string) - Date Modified. Format YYYY-MM-DD
    title(string) - Customer Title. Max Length 12
    first_name(string) - Customer First Name
    last_name(string) - Customer Last Name
    gender(string) - Customer gender (Male / Female)
    dob(string) - Customer Date of Birth. Format YYYY-MM-DD
    address
        line_1(string) - Address Line 1
        line_2(string) - Address Line 2
        line_3(string) - Address Line 3
        city(string) - Address City
        county(string) - Address County
        postal_code(string) - Address Postcode
    email_address(string) - Email Address
    tel_number_1(string) - Telephone Number 1
    tel_number_2(string) - Telephone Number 2
    active(boolean) - Customer Active (True / False)

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)
402 = Customer already exists with same external_customer_ref - matching customer object in CreateCustomer response(same format as GetCustomer response)
500 = General service error

Example

{ 
"status": {
"code": 101,
"details": "OK"
},
"customer": {
"customer_id": 1408,
"customer_ref": "C001408",
"external_customer_ref": "EXTREF164736",
"created": "2017-12-12",
"last_modified": "2017-12-14",
"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": true
}
}