Invoices

The invoicesAPI allows you to access stored invoice information and to create a new invoice.

invoicesAPI

Methods: GET, POST, PUT, DELETE

Each method call requires the invoiceID paramater

Parameter Description
InvoiceID

A unique invoice identifier. The invoiceID is automatically created when a new order object is created. This is read only in GET, PUT, and DELETE operations.
Type: number, max. length = 10

xustomerID

A unique identifer associated with the customer placing the order.
Type: number, max. length = 10

Items

A list of items, by item number and quantity, associated with the invoice.
Type: number, max. length = 10

NOTE: detailed information about an item may be obtained using the itemsAPI..

orderDate

The date the order was entered.
Type: character, max. length = 10

fillDate The date the order was filled in preparation for shippment.
Type: character, max. length = 10
shipDate The date the order was shipped.
Type: character, max. length = 10
shipMethod The shipping method or carrier.
Type: character, max. length = 64
tax The amount of sales tax applied to the order.
Type: number, max. length = 10
shipChgs The amount of shipping charges applies to the order.
Type: number, max. length = 10
invTotal The total amount of the invoice
Type: number, max. length = 10 .
instructions

Any special instructions input by the customer.
Type: character, max. length = 512

Sample API Calls

GET https//www.seansworld.com/custInfoAPI/?invoiceID=2011

cURL Example

curl --request GET 'https//www.seansworld.com/custInfoAPI/' \ --data invoiceID=2011'

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("GET"); 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

<invoice-info>

<invoiceID>2011</invoiceID>

<custID>212215</custID>

<items>

<line>1</line>

<itemID>1995</itemID>

<qty>2</qty>

<price>4.95</price>

</line>

<line>2</line>

<itemID>1906</itemID>

<qty>2</qty>

<price>9.95</price>

</line>

<line>3</line>

<itemID>915</itemID>

<qty>1</qty>

<price>0.95</price>

</line>

</items>

<orderDate>01/25/2015</orderDate>

<fillDate>01/25/2015</fillDate>

<shipDate>o1/26/2015</shipDate>

<shipMethod>UPS</shipMethod>

<tax>2.54</tax>

<shipChgs>10.00</shipChgs>

<invTotal>43.49</invTotal>

<instructions></instructions>

<invoice-info>