D&H is a leading technology distributors specializing in emerging trends across IT, Electronics, Entertainment and Gaming. And D&h providing a way to incorporate them into various online shopping cart portals to obtain their sales in an easy manner. Because of this facility, the online shoping carts do not require a warehouse/shop for its own. Lets see how this D&H integration is possible with our portal.
The first thing we required for this integration is, you should obtain a userId and password from D&H. If you already have a DandH.com account, you create a new usercode dedicated to XML requests. To do this, log in to DandH.com and go to the Account Admin tab, and choose “Add, change or delete usercodes”. All these requests are done via XML. Create an XML document with your login information and then sent request information.
Mainly D&H providing three kinds of requests for three different usage. Which are XML Price and Availability Request, XML Order Entry Request and XML Order Status Request. And for each section there are three ways to sent our request to D&H depending on our requirement. Which are listed below.
- HTTP POST of the XML request.
If we are using HTTP POST of the XML document, we have to submit the request to this URL: https://www.dandh.com/dhXML/xmlDispatch .
- POST an HTML form with the request in a form field called xmlDoc.
If we are using HTML form post, then create an HTTP POST request containing a form field named “xmlDoc”, and include your XML document as the value of the “xmlDoc” field, then submit the request to this URL: https://www.dandh.com/dhXML/xmlDispatch .
- XML request in a SOAP envelope.
If we are using SOAP request, enclose your XML document in a SOAP envelope, and send the SOAP request to D&H.
We will get more information of each XML request from the following urls. They are listed below:-
- Price and Availability Request : https://www.dandh.com/docs/priceAvailabilityDoc.pdf
- Order Entry Request : https://www.dandh.com/docs/orderEntryDoc.pdf
- Order Status Request : https://www.dandh.com/docs/orderStatusDoc.pdf
Before proceeding this we must required an ftp account access from D&H. And we have to pass the access credentials like username, password, etc… along with the request header. Once we have the access credential with us we can start using the XML requests. With the help of curl, we integrate all these xml requests into our required pages. The list of procedures we followed are explained here. We have three different requests are available.
The first we will check the price and availability request. So which will retrieve a response with price and availability of the particular product. Every day we have a scheduled product update for all product exist in our database. Apart from this we will check each product before adding that particular product into cart. So we can ensure that, this product’s availability on D&H.
During the second step, once we got an successful order with payments into our shopping cart immediately we will send an Order Entry request to D&H with necessary fields. As a response we will get an unique order number and a status message either success or error for each order entry. And we have to keep this order number for further inquiry. Once we complete the order entry request successfully, then we can send the Order Status request with the help of the unique order number we got from order entry response. All these requests are done via curl.
Apart from this D&H will provide the facilities to update the product, its product images and the discontinued products from a daily updated server. We can access these facilities with the help of a ftp account, given by D&H. This is we implemented as a scheduled job to update the product, new product images and the discontinued list of products. For updating the product we will get either as a pipe (|) separated list or XML file. We can extract the data from the file and update it to database with sufficient logic. Similar way we will get the discontinued product list as a CSV or XML file and we can extract it and update it into database. Also for new product images also available from D&H. We can download the image and display it based on our requirement.
A sample product list shown below. Each field is delimited by a pipe ( | ). To see the file format and structure from the following url : https://www.dandh.com/docs/ItemListLayout.pdf
- I|017|N| |000110 |0001-10 |788597000015|1560|American Power | 1.85| 0.00| 0.00| 5.31|UP|0002|10′ Standard Parallel Ptr Cbl |Standard Parallel Ptr Cbl, 18 cond, DB25M-C36M, 10′
- I|004|N| |00025302 |00025302 |051851301051|7535|Okidata | 65.00| 0.00| 0.00| 5.31|UP|0002|RS232 Serial Interface/10i/10e|LED page printer interface kit; RS-232C serial I/F (Okipage 10i, Okipage 10e)
- O|000|N| |00356 |0035-6 |788597000213|1570|American Power | 2.35| 0.00| 0.00| 5.31|UP|0002| 6’DB25M/DB25M 25 Cond ST |6′ DB25M/DB25M 25 Cond Straight Through
A sample discontinued product list shown below. Each field is delimited by a pipe ( | ). To see the file format and structure from the following url : https://www.dandh.com/docs/SampleDiscontinuedItems.pdf
- 00143 |00143 |044357001433|71642|Saunders |Molded Titanium PDA Hardcase |07/10/2003
- 00167 |00167 |044357001679|71642|Saunders |Leather Flip Case for m100/105|07/10/2003
- 00252 |00252 |044357002522|71642|Saunders |Sony T665 Leather Flip Cse |07/10/2003