GetCustomer

This function will return one customer record based on the search criteria provided. The customer can be found with either the Customer Id or the External Customer Reference.

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_id(int) - Required*. The unique internal id for the customer in PDM.
external_customer_ref(string) - Required*. The unique reference int for the customer as known by the third-party system. Max length = 50

*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_id": 1408,
"external_customer_ref": ""
}

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 / inactive API key
204 = IP address not approved
205 = Rate limit exceeded
301 = Required data missing
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",
"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
}
}