Customer Information

custInfoAPIi gives you access to a customers administrative information and order history. For accont information see the Retrieving Customer Acounts.

Note: Authentication is required for access to this API. See authAPI for more information.

custInfoAPI

Methods: GET, POST, PUT, DELETE

Each method call requires the custID paramater.

Parameter Description
firstName

The customer's first name
Type: character, max legth = 128

lastName The customer's last name
Type: character, max legth = 128
streetName The name of the street in the customer's address
Type: character, max legth = 128
streetNum

The house number in the customer's address
Type: number, max legth = 10

unitNum The unit or apartment number int he customer's address
Type: character, max legth = 10
city

The name of the city in the customer's address
Type: character, max legth = 128

state The name of the state or province in the customer's address
Type: character, max legth = 128
country The customer's country of residence
Type: character, max legth = 128
zip The postal/zip code in the customer's address
Type: character, max legth = 20
terms Established credit terms
Type: character, max legth = 128
custID The customer ID number
Type: number, max legth = 10

Sample API Calls

PUT https//www.seansworld.com/custInfoAPI/?custID=212215&firstname=John&lastName=Doe

cURL Example

curl --request POST 'https//www.seansworld.com/custInfoAPI/' \ --data custID=212215&firstname=John&lastName=Doe'

Java Example

public static String httpPost(String urlStr, String[] paramName,
String[] paramVal) throws Exception {
  URL url = new URL(urlStr);
  HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  conn.setRequestMethod("PUT"); conn.setDoOutput(true);
  conn.setDoInput(true); conn.setUseCaches(false);
  conn.setAllowUserInteraction(false);
  conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");


// Create the form content OutputStream out = conn.getOutputStream();
Writer writer = new OutputStreamWriter(out, "UTF-8");
for (int i = 0; i < paramName.length; i++) { writer.write(paramName[i]);
  writer.write("=");
  writer.write(URLEncoder.encode(paramVal[i], "UTF-8"));
  writer.write("&");
}
writer.close();
out.close();


if (conn.getResponseCode() != 200) {
  throw new IOException(conn.getResponseMessage());
}


// Buffer the result into a string
BufferedReader rd = new BufferedReader(
  new InputStreamReader(conn.getInputStream()));
StringBuilder sb = new StringBuilder();
String line; while ((line = rd.readLine()) != null) {
   sb.append(line);
}
rd.close();


conn.disconnect();
return sb.toString();

}

 

Sample Response

<cust-info>

<firstName>John</firstName>

<lastName>Doe</lastName>

<streetNameMain St.></streetName>

<unitNum>1215</unitNum>

<city>Any Town</city>

<state>CA</state>

<country>USA</country>

<zip>95111</zip>

<terms>COC</terms>

<custID>212215</custID>

<cust-info>