1. Overview
  2. Sandbox
  3. API Demo Code
  4. SOAP
  5. XML
  6. Available API Calls

Overview

The Doba API allows you to utilize the Doba supply chain platform programmatically within your own application. The API includes functions to search or browse the Doba product catalog, obtain detailed product information, lookup shipping and handling charges, submit orders, fund orders, obtain shipment information for orders when they ship. Additional functions are provided for partners who want to create subscription members or leads and manage the account through the member life-cycle.

The API includes the following systems:

 

 

Product API

Allows for the retrieval of on-demand and up-to-the-minute product data from the Doba platform.

When downloading more than 10,000 products, we recommend using the Data Export system. Downloading large data sets via the API can take long periods of time, and flat files are often easier to work with when dealing with large sets of data.

 

Order API

Allows for the submittal of orders to the Doba platform as well as the retrieval of current order status and shipping/tracking data.

Orders submitted via the API can be funded through the API using several different payment methods.

Current order status can be called at any time although status updates can be provided in real-time through callback's. For an order status overview click here.

 

Callbacks

Callbacks are sent to the URL on file to notify the integrators system of changes in order status, product status, etc. Callbacks are significant due to its purpose of keeping the end-user up to date with the most accurate information available to the Doba platform.

For example: When the status of a product changes from in-stock to out-of-stock, the retailer's system will be informed via callback if the product is currently being sold by that retailer. When an supplier submits shipment tracking information through the Doba platform, the retailers system will be notified via callback.

 

Suggested Flow Diagrams

Download the following flowchart diagrams to see the Doba suggested process for some of the most common API processes.

Order Process -  [link]

Store Checkout Process -  [link]

Warehouse Import Process -  [link]

 

 

 

Sandbox

A sandbox is a testing (or virtual) environment that isolates untested code changes and outright experimentation from the production environment. Sandbox environments protect production servers and their data from changes that could be damaging (regardless of the intent of the author of those changes) to a mission-critical system or which could simply be difficult to revert. Sandboxes replicate the functionality needed to test accurately the programs or other code under development. See Wikipedia for further clarification.

Notice: Although we strive to keep the sandbox server available at all times, there may be times when it will not be accessible. If this is the case, please contact Doba.

Sandbox URL

The sandbox API URL information is found in the following locations...

SOAP

XML

Sandbox Web Site

Additionally, a sandbox web site, mimicking the Doba web site, is available at the URL below.

https://sandbox.doba.com/ [link]

The sandbox web site can be used to perform several tasks that would normally be done by suppliers. For orders, you can log in as a retailer so that you can view orders and change status' and/or send callbacks upon status changes.

To change the status of an order, log in as the retailer your using in your API calls and select "orders". Select an order from the list by clicking the number in the "order" column or by searching for the order number at the top. In the supplier order section of the order detail, select the yellow button labeled "Change Order Status". Select and save the new status and a callback will be issued to the location saved in your sandbox URL settings.

To change the callback URL used in your sandbox environment, go to http://sandbox.doba.com/members, log in using your username and password and select Settings from the top menu. Next, select API on the sub-menu. Here, you can add your callback URL as well as select the updates that you would like callbacks sent for. Typically, you will want all of the preferences selected.

 

 

 

API Demo Code

Demo code has been provided to make it easier for developers to quickly and easily learn to use the Doba API. The demo is not intended to be a fully functional site, but to show examples of using the Doba API to perform many of the tasks required for a Doba integration. The demo site includes code for both SOAP and XML integrations. You can download and install the code locally or find it installed here - http://www.doba.com/developer-demo/20110301/Retailer

This demo code includes debug panes that show the actual API request and response for each call. To show the debug panes click on 'Show' at the top of the window.

Before running a locally installed copy of the demo code the config.inc must be updated with an API username and password, and a valid retailer id.

When running the code green text indicates tips/practices to include in each Doba integration, and red text indicates data that should be stored/updated in a local database.

Use following URL to download the PHP5 code for the demo site.

http://www.doba.com/developer-demo/20110301/Retailer.zip [link]

Installation instructions are included in ReadMe.txt in the download.

 

 

 

SOAP

 

SOAP API URL

The following URL is to be used for development and testing:

Product Methods:

https://sandbox.doba.com/soap/20110301/wsdl/ApiRetailerSearch.wsdl [link]

Order Methods:

https://sandbox.doba.com/soap/20110301/wsdl/ApiRetailerOrder.wsdl [link]

The following URL's are to be used in production after testing on the sandbox server has been validated:

Product Methods:

https://www.doba.com/soap/20110301/wsdl/ApiRetailerSearch.wsdl [link]

Order Methods:

https://www.doba.com/soap/20110301/wsdl/ApiRetailerOrder.wsdl [link]

 

SOAP Code Example - PHP5

The PHP5 example code below shows how to set up a SOAP client to call the API. There are three variables (username, password and retailer_id) within the code that you will need to replace with your own.

This code requires PHP5 with SOAP configured properly. Other development environments may use similar structure, although the functions will need to be customized accordingly.

<?php
$client = new   SoapClient("https://sandbox.doba.com/soap/20110301/wsdl/ApiRetailerSearch.wsdl", array('trace' => 1));
$objAuth = new stdClass();
$objAuth->username = '%username%'; 
$objAuth->password = '%password%';
$objRequest = new stdClass();   
$objRequest->authentication = $objAuth; 
$objRequest->retailer_id = '%retailer_id%';
$objRequest->products = array(147129); 
$objRequest->items = array(); 
$objRequest->watchlists = array(); 
$response = $client->getProductDetail($objRequest); 
if(false == is_soap_fault($response)){   
 foreach($response as $product) {   
  foreach ($product->items as $item) { 
   print   "price: "  . $item->price . "\n\n"; 
  }   
 }
	print_r($response);
}else{   
 echo   "error code: " . $response->faultstring . "<br>"; 
 echo   "error message: " . $response->detail . "<br>"; 
}   
?> 

 

SOAP Code Example - .NET

The .NET example code below shows how to set up a SOAP client to call the API. There are three variables (username, password and retailer_id) within the code that you will need to replace with your own.

This code requires that you initially build a DLL with the WSDL file. Once that is accomplished, the code below can be utilized to submit and accept the content of the request..

<%@ Page Language="C#" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Text" %>
<% 
  ApiRetailerAuthenticationInfo _auth = new ApiRetailerAuthenticationInfo();
  ApiRetailerSearch _ret = new ApiRetailerSearch();
  ApiRetailerSupplierRequest _supplier = new ApiRetailerSupplierRequest();
  ApiSupplierResponse[] _supplierResponse;


  
  _auth.username = "username";
  _auth.password = "password";
  _supplier.authentication = _auth;
  _supplier.retailer_id = "retailer_id";
  _supplierResponse = _ret.getSuppliers(_supplier);

  
  for (int x = 0; x < _supplierResponse.Length; x++) 
 {
 Response.Write(_brandResponse[x].supplier_name + "<BR>");
 }
%>

 

 

 

XML

 

XML API URL

When implimenting the API using XML, you will POST your calls to the URL intended for the environment you are currently working in.

The following URL is to be used for development and testing:

https://sandbox.doba.com/api/20110301/xml_retailer_api.php [link]

The following URL is to be used in production after testing on the sandbox server has been validated:

https://www.doba.com/api/20110301/xml_retailer_api.php [link]

 

 

XML Structure

Certain required elements are required of every API call regardless of the functions used.

The <dce> tag must enclose everything else, meaning that it should open at the beginning of the call and should close as the end of the call.

The <authentication> tag must follow the opening <dce> tag. The API account's username and password will be included to verify access rights to the API.

The <request> tag will encapsulate the actions request, the core of each API call.

 

 

XML Request Outline

<dce>
    <request>
	
        <authentication>
            <username><!-- retailer username --></username>
            <password><!-- retailer password --></password>
        </authentication>

  <action><!-- request specific action --></action>
  
  <!-- action specific xml request data -->

    </request>
</dce>

 

 

XML Response Outline

Each API request will return a response inside the <response> tag. The <action> tag will repeat the action requested.

The <outcome> tag will indicate whether the call succeeded or failed. If the call failed, it will provide additional information that will indicate the level of failure that has occurred.

The ENTITY information is provided to ensure that no special characters will cause problems while parsing the data. Your XML parsing system should use the ENTITY information to replace special characters throughout the response automatically.

<?xml version="1.0"?>
<!DOCTYPE dce [
<!ENTITY apos "&#39;">
<!ENTITY minus "&#45;">
<!ENTITY circ "&#94;">
<!ENTITY tilde "&#126;">
<!ENTITY Scaron "&#138;">
<!ENTITY lsaquo "&#139;">
<!ENTITY OElig "&#140;">
<!ENTITY lsquo "&#145;">
<!ENTITY rsquo "&#146;">
<!ENTITY ldquo "&#147;">
<!ENTITY rdquo "&#148;">
<!ENTITY bull "&#149;">
<!ENTITY ndash "&#150;">
<!ENTITY mdash "&#151;">
<!ENTITY trade "&#153;">
<!ENTITY scaron "&#154;">
<!ENTITY rsaquo "&#155;">
<!ENTITY oelig "&#156;">
<!ENTITY Yuml "&#159;">
<!ENTITY yuml "&#255;">
<!ENTITY fnof "&#402;">
<!ENTITY Alpha "&#913;">
<!ENTITY Beta "&#914;">
<!ENTITY Gamma "&#915;">
<!ENTITY Delta "&#916;">
<!ENTITY Epsilon "&#917;">
<!ENTITY Zeta "&#918;">
<!ENTITY Eta "&#919;">
<!ENTITY Theta "&#920;">
<!ENTITY Iota "&#921;">
<!ENTITY Kappa "&#922;">
<!ENTITY Lambda "&#923;">
<!ENTITY Mu "&#924;">
<!ENTITY Nu "&#925;">
<!ENTITY Xi "&#926;">
<!ENTITY Omicron "&#927;">
<!ENTITY Pi "&#928;">
<!ENTITY Rho "&#929;">
<!ENTITY Sigma "&#931;">
<!ENTITY Tau "&#932;">
<!ENTITY Upsilon "&#933;">
<!ENTITY Phi "&#934;">
<!ENTITY Chi "&#935;">
<!ENTITY Psi "&#936;">
<!ENTITY Omega "&#937;">
<!ENTITY alpha "&#945;">
<!ENTITY beta "&#946;">
<!ENTITY gamma "&#947;">
<!ENTITY delta "&#948;">
<!ENTITY epsilon "&#949;">
<!ENTITY zeta "&#950;">
<!ENTITY eta "&#951;">
<!ENTITY theta "&#952;">
<!ENTITY iota "&#953;">
<!ENTITY kappa "&#954;">
<!ENTITY lambda "&#955;">
<!ENTITY mu "&#956;">
<!ENTITY nu "&#957;">
<!ENTITY xi "&#958;">
<!ENTITY omicron "&#959;">
<!ENTITY pi "&#960;">
<!ENTITY rho "&#961;">
<!ENTITY sigmaf "&#962;">
<!ENTITY sigma "&#963;">
<!ENTITY tau "&#964;">
<!ENTITY upsilon "&#965;">
<!ENTITY phi "&#966;">
<!ENTITY chi "&#967;">
<!ENTITY psi "&#968;">
<!ENTITY omega "&#969;">
<!ENTITY thetasym "&#977;">
<!ENTITY upsih "&#978;">
<!ENTITY piv "&#982;">
<!ENTITY ensp "&#8194;">
<!ENTITY emsp "&#8195;">
<!ENTITY thinsp "&#8201;">
<!ENTITY zwnj "&#8204;">
<!ENTITY zwj "&#8205;">
<!ENTITY lrm "&#8206;">
<!ENTITY rlm "&#8207;">
<!ENTITY sbquo "&#8218;">
<!ENTITY bdquo "&#8222;">
<!ENTITY dagger "&#8224;">
<!ENTITY Dagger "&#8225;">
<!ENTITY hellip "&#8230;">
<!ENTITY permil "&#8240;">
<!ENTITY prime "&#8242;">
<!ENTITY Prime "&#8243;">
<!ENTITY oline "&#8254;">
<!ENTITY frasl "&#8260;">
<!ENTITY euro "&#8364;">
<!ENTITY image "&#8465;">
<!ENTITY weierp "&#8472;">
<!ENTITY real "&#8476;">
<!ENTITY alefsym "&#8501;">
<!ENTITY larr "&#8592;">
<!ENTITY uarr "&#8593;">
<!ENTITY rarr "&#8594;">
<!ENTITY darr "&#8595;">
<!ENTITY harr "&#8596;">
<!ENTITY crarr "&#8629;">
<!ENTITY lArr "&#8656;">
<!ENTITY uArr "&#8657;">
<!ENTITY rArr "&#8658;">
<!ENTITY dArr "&#8659;">
<!ENTITY hArr "&#8660;">
<!ENTITY forall "&#8704;">
<!ENTITY part "&#8706;">
<!ENTITY exist "&#8707;">
<!ENTITY empty "&#8709;">
<!ENTITY nabla "&#8711;">
<!ENTITY isin "&#8712;">
<!ENTITY notin "&#8713;">
<!ENTITY ni "&#8715;">
<!ENTITY prod "&#8719;">
<!ENTITY sum "&#8721;">
<!ENTITY lowast "&#8727;">
<!ENTITY radic "&#8730;">
<!ENTITY prop "&#8733;">
<!ENTITY infin "&#8734;">
<!ENTITY ang "&#8736;">
<!ENTITY and "&#8743;">
<!ENTITY or "&#8744;">
<!ENTITY cap "&#8745;">
<!ENTITY cup "&#8746;">
<!ENTITY int "&#8747;">
<!ENTITY there4 "&#8756;">
<!ENTITY sim "&#8764;">
<!ENTITY cong "&#8773;">
<!ENTITY asymp "&#8776;">
<!ENTITY ne "&#8800;">
<!ENTITY equiv "&#8801;">
<!ENTITY le "&#8804;">
<!ENTITY ge "&#8805;">
<!ENTITY sub "&#8834;">
<!ENTITY sup "&#8835;">
<!ENTITY nsub "&#8836;">
<!ENTITY sube "&#8838;">
<!ENTITY supe "&#8839;">
<!ENTITY oplus "&#8853;">
<!ENTITY otimes "&#8855;">
<!ENTITY perp "&#8869;">
<!ENTITY sdot "&#8901;">
<!ENTITY lceil "&#8968;">
<!ENTITY rceil "&#8969;">
<!ENTITY lfloor "&#8970;">
<!ENTITY rfloor "&#8971;">
<!ENTITY lang "&#9001;">
<!ENTITY rang "&#9002;">
<!ENTITY loz "&#9674;">
<!ENTITY spades "&#9824;">
<!ENTITY clubs "&#9827;">
<!ENTITY hearts "&#9829;">
<!ENTITY diams "&#9830;">
<!ENTITY nbsp "&#160;">
<!ENTITY iexcl "&#161;">
<!ENTITY cent "&#162;">
<!ENTITY pound "&#163;">
<!ENTITY curren "&#164;">
<!ENTITY yen "&#165;">
<!ENTITY brvbar "&#166;">
<!ENTITY sect "&#167;">
<!ENTITY uml "&#168;">
<!ENTITY copy "&#169;">
<!ENTITY ordf "&#170;">
<!ENTITY laquo "&#171;">
<!ENTITY not "&#172;">
<!ENTITY shy "&#173;">
<!ENTITY reg "&#174;">
<!ENTITY macr "&#175;">
<!ENTITY deg "&#176;">
<!ENTITY plusmn "&#177;">
<!ENTITY sup2 "&#178;">
<!ENTITY sup3 "&#179;">
<!ENTITY acute "&#180;">
<!ENTITY micro "&#181;">
<!ENTITY para "&#182;">
<!ENTITY middot "&#183;">
<!ENTITY cedil "&#184;">
<!ENTITY sup1 "&#185;">
<!ENTITY ordm "&#186;">
<!ENTITY raquo "&#187;">
<!ENTITY frac14 "&#188;">
<!ENTITY frac12 "&#189;">
<!ENTITY frac34 "&#190;">
<!ENTITY iquest "&#191;">
<!ENTITY Agrave "&#192;">
<!ENTITY Aacute "&#193;">
<!ENTITY Acirc "&#194;">
<!ENTITY Atilde "&#195;">
<!ENTITY Auml "&#196;">
<!ENTITY Aring "&#197;">
<!ENTITY AElig "&#198;">
<!ENTITY Ccedil "&#199;">
<!ENTITY Egrave "&#200;">
<!ENTITY Eacute "&#201;">
<!ENTITY Ecirc "&#202;">
<!ENTITY Euml "&#203;">
<!ENTITY Igrave "&#204;">
<!ENTITY Iacute "&#205;">
<!ENTITY Icirc "&#206;">
<!ENTITY Iuml "&#207;">
<!ENTITY ETH "&#208;">
<!ENTITY Ntilde "&#209;">
<!ENTITY Ograve "&#210;">
<!ENTITY Oacute "&#211;">
<!ENTITY Ocirc "&#212;">
<!ENTITY Otilde "&#213;">
<!ENTITY Ouml "&#214;">
<!ENTITY times "&#215;">
<!ENTITY Oslash "&#216;">
<!ENTITY Ugrave "&#217;">
<!ENTITY Uacute "&#218;">
<!ENTITY Ucirc "&#219;">
<!ENTITY Uuml "&#220;">
<!ENTITY Yacute "&#221;">
<!ENTITY THORN "&#222;">
<!ENTITY szlig "&#223;">
<!ENTITY agrave "&#224;">
<!ENTITY aacute "&#225;">
<!ENTITY acirc "&#226;">
<!ENTITY atilde "&#227;">
<!ENTITY auml "&#228;">
<!ENTITY aring "&#229;">
<!ENTITY aelig "&#230;">
<!ENTITY ccedil "&#231;">
<!ENTITY egrave "&#232;">
<!ENTITY eacute "&#233;">
<!ENTITY ecirc "&#234;">
<!ENTITY euml "&#235;">
<!ENTITY igrave "&#236;">
<!ENTITY iacute "&#237;">
<!ENTITY icirc "&#238;">
<!ENTITY iuml "&#239;">
<!ENTITY eth "&#240;">
<!ENTITY ntilde "&#241;">
<!ENTITY ograve "&#242;">
<!ENTITY oacute "&#243;">
<!ENTITY ocirc "&#244;">
<!ENTITY otilde "&#245;">
<!ENTITY ouml "&#246;">
<!ENTITY divide "&#247;">
<!ENTITY oslash "&#248;">
<!ENTITY ugrave "&#249;">
<!ENTITY uacute "&#250;">
<!ENTITY ucirc "&#251;">
<!ENTITY uuml "&#252;">
<!ENTITY yacute "&#253;">
<!ENTITY thorn "&#254;">
<!ENTITY lt "&lt;">
<!ENTITY gt "&gt;">
<!ENTITY amp "&amp;">
]>
<dce>

 <response>
  <outcome><!-- 'success', 'failure' : level 3, 'api_error' : level 2, 'system_error' : level 1 --></outcome>
		
  <!-- if the outcome is not 'success' then the section below will contain error information -->
  <errors>
   <error>
    </code>
    </description>
   </error>
  </errors>
  
  <!-- response data specific to the request made -->

 </response>
 
</dce>

 

 

XML Code Example - PHP5

<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php";
$api_username = "username";
$api_password = "password";
$api_retailer_id = "123456";

$strRequest = "
<dce>
    <request>
        <authentication>
            <username>". $api_username ."</username>
            <password>". $api_password ."</password>
        </authentication>		
        <retailer_id>". $api_retailer_id ."</retailer_id>
        <action>getSuppliers</action>
    </request>
</dce>
";
	
//initialize a CURL session
$connection = curl_init();
//set the server we are using (could be Sandbox or Production server)
curl_setopt($connection, CURLOPT_URL, $api_url );
//stop CURL from verifying the peer's certificate
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($connection, CURLOPT_SSL_VERIFYHOST, 0);
//set method as POST
curl_setopt($connection, CURLOPT_POST, 1);
//set the XML body of the request
curl_setopt($connection, CURLOPT_POSTFIELDS, $strRequest);
//set it to return the transfer as a string from curl_exec
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
//increase time-out as some calls can take a long time to respond with data
set_time_limit(108000);
//Send the Request
$strResponse = curl_exec($connection);
if(curl_errno($connection)) {
    print 'Curl error: ' . curl_error($connection);
} 
//close the connection
curl_close($connection);

print_r($strResponse);
?>

 

 

 

Available API Calls

 

Product Methods

 

Order Methods