OMS DOCUMENTATIONRESOURCE CENTER

These guides provide examples for many tasks that a developer will need to be familiar with during implementation.

KIBO OMS DEVELOPMENT

Documentation

Ready Order Download

The Ready Order Download API communicates information about all orders that are ready to fulfill. This API returns shopper information, order information, and a printable packing list for orders that have a ready status, in all available catalogs.

Fulfillment partners can also use this API to obtain ready status information on their orders (with permission).

To accommodate server load, order download requests are queued and then sent at regular intervals. Because of this, the user may not receive the order information as soon as they request it. However, under normal operating conditions, assuming that authentication is correct and that no Internet or server issues or other errors occur, the data will usually be received within an hour of the time that the request was placed.

Getting Started

System Requirements

To use the Ready Order Download API, the user needs to have a valid, active OMS user account with appropriate permissions. Specifically, they must be assigned to the XML Auth User Group and have a user Type of System Admin or Order Admin. If the user account is ever deactivated, the Ready Order Download API will cease to function correctly.

In addition, there should be:

  • A server with Internet access that can communicate with Kibo’s server.
  • The ability to set up a cron on the client’s server.

Writing the Application

The client needs to write two applications:

  • Order Data Request application – This application is used to authenticate permission and submit the Ready Order request. If authentication is successful, the user has defined a server and Remote Procedure Call (RPC) name, and there are Ready orders in the system; the request to retrieve these orders is placed in the send queue.
  • Order Data Receive application – This is the XML-RPC server application used to receive the data. The Order Data Receive application is an XML-RPC server that OMS can call to send order data to.

The application can be written in any programming or scripting language that can handle a Remote Procedure Call (RPC), including PHP, ASP, Cold Fusion, JSP, JAVA, C, and so on.

Process Flow

The process for the OMS Ready Order Download XML-RPC is summarized here and depicted in Figure 1:

  1. To initiate the order download, make a request to the OMS XML-RPC server.
  2. The RPC authenticates the user name and password, checks the server and RPC name information, and verifies that there are Ready orders in the system.
  3. If these conditions are met, the request is placed in a send queue.
  4. Receive a response code that indicates that the request was successful.
    • †If the request is not successful, an error response will be returned instead.
  5. An application on Kibo’s server checks the queue at periodic intervals. The server assembles ready order data, generates HTML packing lists, and sends the data in an XML package to the client’s XML-RPC server. It then logs the data sent, the time sent, the client’s response, and any error messages.
    • If OMS receives a success response from the server, the request is deleted from the queue.
    • If OMS receives an error code response from the server, an email is sent to the administrators, who then follow up to resolve the issue before another data send is attempted.

Programming the Order Data Request Application

The Order Data Request application will be used to authenticate permission and submit the request. If authentication is successful, the user has defined a server and RPC name, and there are Ready orders in the system; the request will be placed in the send queue.

Server and RPC Information

  1. Create an XML-RPC message that calls queue.xml_request_data and passes an array of the parameters shown in the table for defining request elements, below.
  2. Create an XML-RPC client that connects to the following server:
    • Server file name: /xmlServer.php
    • Server address: xml.shopatron.com
    • Server port: 443 (HTTPS)

Required and Optional Parameters

There are a number of possible parameters. Note that leading and trailing spaces are removed from the username, password, mfg_id, and catalog_id elements before authentication.

ElementRequiredParent ElementTypeOccursDescription
usernameYesNonestring1OMS username (must be a valid and active user account with System Admin or Order Admin permission). The maximum length is 50.
passwordYesNonestring1Password for OMS user account. The maximum length is 50.
data_typeYesNonestring1The type of data to download: ready_orders. The maximum length is 50.
filtersOptionalNonestruct0/1Filter to limit orders retrieved. ShipType is the only supported filter.
ShipTypeOptionalfiltersstring0/filtersThe shipping method for orders retrieved. Supported values are: sts (ship to store), ispu (in-store pick up, local search first), 1day (1-day express shipping), 2day (2-day express shipping), 3day (3-day express shipping), and standard (standard shipping).
IncludeFulfillerDataOptionalfiltersboolean0/11 enables the fulfiller_line_item_subtotal and fulfiller_line_item_tax elements, described below.
test_modeOptionalNoneint0/1Non-zero values indicate test orders should be sent; by default, they are not.
EnableShipToNameOptionalfiltersboolean0/11 enables the a_first_name and s_last_name elements, described below.

Example Request

This example could be used to retrieve order and shipment information for Standard orders in Ready state.

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
   <methodName>queue.xml_request_data</methodName>
   <params>
      <param>
         <value>
            <string>xmluser4</string>
         </value>
      </param>
      <param>
         <value>
            <string>Testing1234</string>
         </value>
      </param>
      <param>
         <value>
            <string>ready_orders</string>
         </value>
      </param>
      <param>
         <value>
            <struct>
               <member>
                  <name>ShipType</name>
                  <value>
                     <string>standard</string>
                  </value>
               </member>
            </struct>
         </value>
      </param>
      <param>
         <value>
            <struct>
               <member>
                  <name>IncludeFulfillerData</name>
                  <value>
                     <int>1</int>
                  </value>
               </member>
            </struct>
         </value>
      </param>
      <param>
         <value>
            <struct>
               <member>
                  <name>test_mode</name>
                  <value>
                     <int>1</int>
                  </value>
               </member>
            </struct>
         </value>
      </param>
   </params>
</methodCall>

Example Responses

Unlike REST APIs, the XML-RPC APIs do not return HTTP status codes to indicate success or failure. On success, the RPC returns a value of 0. On an error, the RPC returns a response message with the faultCode and faultString.

A full list of faultCode and faultString options can be found below:

CodeDescription
0Success. The request has been queued.
1Username or password is blank.
2Invalid username, password, or permission.
3Data_type is blank.
4Data_type is not supported.
5No server or RPC name on file for this data_type.
6No data to retrieve. (No ready orders to send.)
7Error adding request to queue.

Successful responses may look like the below sample:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
   <params>
      <param>
         <value>
            <int>0</int>
         </value>
      </param>
   </params>
</methodResponse>

An error response includes an error code and reason:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
   <fault>
      <value>
         <struct>
            <member>
               <name>faultCode</name>
               <value>
                  <int>4</int>
               </value>
            </member>
            <member>
               <name>faultString</name>
               <value>
                  <string>unsupported is not a valid data type</string>
               </value>
            </member>
         </struct>
      </value>
   </fault>
</methodResponse>

Handling Errors

If an error response fault code is received after sending the order information to OMS, follow these steps:

  1. Record the outgoing package and the associated fault code response from OMS.
  2. Test for connectivity to the server.
  3. Hold the XML package for future transmission to OMs’s servers.
  4. Send an email to OMS Merchant Support; include the time and date of the failed transmission.
  5. When Kibo support staff responds, resend the failed attempts.

Programming the Order Data Receive Application

The Order Data Receive application receives an XML package with all order and shipment information. In most cases, each order contains a single shipment. In rare cases, however, the response may be an XML package that includes two orders with the same Order ID (Order Number) but different Shipment IDs. Therefore, the application code must look for identical Order IDs and handle them correctly.

Server and RPC Information

  1. Create an XML-RPC server with an RPC method that accepts a single XML package as a parameter.
    • The parameters listed below (num_orders, test_mode, and order_data) are extracted from this function parameter.
  2. Send email to OMS Merchant Support Services with the following information:
    • Server file name – The pathname of the file, for example: /myXMLServer.php
    • Server address – The URL of the server, for example: xml.shopatron.com
    • Server port – The port number on which the server is connected, for example: 80 or 443
    • RPC name – The name of the remote procedure, for example: get_my_orders

Required and Optional Parameters

There are a number of possible parameters:

ElementRequiredParent ElementTypeOccursDescription
num_ordersYesNoneint1The number of orders in the package.
test_modeOptionalNoneint0/1Value of 0 or 1.
order_xYesNonestructNumordersThe order container. There is one order container for each order in the package. Replace x with a number starting with 0; for example, order_0, order_1, and so on.
order_idYesorder_xint1/orderOMS Order ID (also called the “Order Number”).
order_dateYesorder_xstring1/orderThe date the order was placed.
mfg_idYesorder_xint1/orderThe OMS-assigned manufacturer ID.
catalog_idYesorder_xint1/orderThe OMs-assigned Catalog ID.
first_nameYesorder_xstring1/orderOrder contact’s first name.
last_nameYesorder_xstring1/orderOrder contact’s last name.
recipientOptionalorder_xstring0 or 1/orderThe name of the gift recipient, if this is a gift order. The maximum length is 100..
messageOptionalorder_xstring0 or 1/orderThe gift message, if this is a gift order. The maximum length is 100..
address1Yesorder_xstring1/orderFirst line of ship-to address. The maximum length is 50.
address2Optionalorder_xstring1/orderSecond line of ship-to address. The maximum length is 50.
address3Optionalorder_xstring1/orderThird line of ship-to address. The maximum length is 50.
cityYesorder_xstring1/orderCity for ship-to address. The maximum length is 50.
stateYesorder_xstring1/orderState for ship-to address. The maximum length is 50.
zipYesorder_xstring1/orderZip or postal code for ship-to address. The maximum length is 10.
countryYesorder_xstring1/orderCountry for the ship-to address. The maximum length is 50.
country_codeYesorder_xstring1/orderTwo-character country code for the ship-to address.
phoneYesorder_xstring1/orderConsumer’s phone number. The maximum length is 20.
subtotalYesorder_xdouble1/orderThe order subtotal amount.
taxYesorder_xdouble1/orderThe order tax amount.
shippingYesorder_xdouble1/orderThe shipping amount.
totalYesorder_xdouble1/orderThe consumer total for the order. (In other words, the amount the consumer paid).
shopatron_totalYesorder_xdouble1/orderThe total amount that Kibo keeps for the order.
fulfiller_totalYesorder_xdouble1/orderThe total amount that the fulfiller keeps for the order.
fulfiller_shippingYesorder_xdouble1/orderThe fulfiller’s shipping and handling charges for the order.
fulfiller_taxYesorder_xdouble1/orderThe fulfiller’s tax amount for the order.
package_feeYesorder_xdouble1/orderOMS discount, per order. This is usually 0.75.
shipment_idYesorder_xint1/orderThe OMS-assigned Shipment ID for the order. The Shipment ID is required to use the Shipment Data Upload Tool API.
discountOptionalorder_xstruct1/orderThe order discount container.
discount_descriptionOptionaldiscountstring1/discountA text description of the order discount.
discount_percentageOptionaldiscountdouble1/discountThe percentage discount of the order total.
discount_totalOptionaldiscountdouble1/discountThe amount of discount from the order total.
language_idOptionalOrder Blockint1/orderThe language for the order. The following values are accepted: 1 (US English), 3 (Canadian French), 4 (UK English), 6 (FR French), 5 (DE German), 7 (IT Italian), 15 (NL Dutch), 17 (SV Swedish), and 18 (NO Norwegian).
currency_idOptionalOrder Blockint1/orderThe currency type for the order. The following currency types are supported: 1 (US Dollar), 2 (Canadian Dollar), 3 (British Pound), 5 (German Euro), 6 (French Euro), 7 (Italian Euro), 8 (Spanish Euro), 9 (British Euro), 10 (Dutch Euro), 11 (Austrian Euro), 12 (Swiss Franc), 13 (Belgian Euro), 14 (Luxembourg Euro), 15 (Norwegian Krona), 16 (Swedish Krona), and 22 (Irish Euro).
cust_commentsYesorder_xstring1/orderComments the consumer entered for the order. The maximum length is 50.
ship_typeYesorder_xstring1/structThe shipping type for the order. Acceptable values are: standard (standard shipping), 1day (1-day express shipping), 2day (2-day express shipping), 3day (3-day express shipping), ispu (in-store pick up or Local Search First), sts (ship to store), and sts+ (shopper’s choice).
promotion_run_idOptionalorder_xint0 or 1/orderThe promo run for the order, if any.
authorization_codeOptionalorder_xstring0 or 1/orderThe authorization code for the order, if any,
pro_orderOptionalorder_xint0 or 1/orderFlag for Pro Store order. 1 = true.
pro_group_combo_idOptionalorder_xstring0 or 1/orderThe Pro Group Combo discount, if this is a Pro Store order.
additional_infoOptionalorder_xstruct1/orderAdditional info about the order.
in_store_pickupOptionaladditional_infoint1/additional_infoFlag for In-Store Pickup (Local Search First). 1 = true.
express_shippingOptionaladditional_infostruct1/additional_infoExpress shipping information.
express_shipping_flagOptionalexpress_shippingint1/express_shippingFlag for Express shipping. 1 = true.
express_shipping_textOptionalexpress_shippingstring1/express_shippingText for Express shipping.
express_shipping_arrivalOptionalexpress_shippingint1/express_shippingExpected arrival date for Express shipping.
ssvs_paymentsOptionaladditional_infostruct0 or 1/orderContainer for SSVS (Gift Card) information, where supported.
svs_payment_xOptionalSsvs_paymentsint0 or 1/orderFlag for SVS order. 1 = true.
account_numberOptionalSsvs_paymentsstring0 or 1/orderAccount number for SVS order.
amountOptionalSvspayment_xint0 or 1/orderAmount for SVS order.
authorization_numberOptionalSvspayment_xstring0 or 1/orderAuthorization number for SVS order.
assigned_infoOptionalorder_xstruct1/orderA container with assignment information about the order.
retailer_idOptionalAssignedinfoint1/assignedinfoThe OMS-assigned ID of the order fulfiller.
retailer_nameOptionalAssignedinfostring1/assignedinfoThe name of the order fulfiller.
retailer_location_idOptionalAssignedinfoint1/assignedinfoThe OMS-assigned Location ID for the fulfiller. If not included, the default location ID is used.
retailer_locationOptionalAssignedinfostring1/assignedinfoThe name of the retail location to which the order was assigned. If not included, the default location is used.
retailer_addressOptionalAssignedinfostring1/assignedinfoThe address of the retail location to which the order was assigned, as defined in OMS.
retailer_zipOptionalAssignedinfostring1/assignedinfoThe Zip code of the retail location to which the order was assigned, as defined in OMS.
packing_listYesorder_xstring1/orderThe packing list for the order, in HTML-encoded format.
num_itemsYesorder_xint1/orderThe number of items in the order.
itemsYesorder_xstructnum items/orderThe item container. Its children are labeled item_x; where x is replaced with the item number beginning with 1; for example, item_1, item_2, and so on.
item_idYesitem_xint1/itemThe OMS-assigned Item ID.
quantityYesitem_xint1/itemHow many of this item the order includes.
priceYesitem_xdouble1/itemThe per-item price that the consumer paid. This amount reflects any order discounts (shown in the discount container) but does not reflect any line_discount.
part_numberYesitem_xstring1/itemThe part number for the item, as assigned by the manufacturer. The maximum length is 50.
line_item_taxYesitem_xdouble1/itemThe amount of tax the consumer paid for this item.
line_item_subtotalYesitem_xdouble1/itemThe consumer’s subtotal for this item = (qty * price) – line_discount
line_discountYesitem_xdouble1/itemAny discount applied to this line item.
fulfiller_totalYesitem_xdouble1/itemThe per-item fulfiller total for this item, after processing fees and discounts. Per- piece in the line item (for example, price/qty).
shopatron_totalYesitem_xdouble1/itemThe amount OMS keeps for this item.
optionsOptionalitem_xstruct1/itemThe options container.
option_xOptionaloptionsstringnum options/itemAn option. Here, x is replaced by an option number; for example, option_1, option_2, and so on. The value is a string with the option category and value, such as Color: Blue. The maximum length is 402.
fulfiller_line_item_subtotalYesitem_xdouble1/itemThe fulfiller’s subtotal for this item = (qty * price) – line_discount.
fulfiller_line_item_taxYesitem_xdouble1/itemThe amount of tax the fulfiller is paid for this item = line_item_tax – Kibo discount on line_item_tax
s_first_nameOptionalorder_xstring1/orderThe first name on the ship-to address, if it exists
s_last_nameOptionalorder_xstring1/orderThe last name on the ship-to address, if it exists

Example Requests

This first example includes a single order and a single item but does not include the required packing list. It includes the optional assigned order parameters and uses the additional_info element to identify the order as an In-Store Pickup (Local Search First) order.

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
   <methodName>examples.xml_get_my_orders</methodName>
   <params>
      <param>
         <value>
            <int>1</int>
         </value>
      </param>
      <param>
         <value>
            <struct>
               <member>
                  <name>order_0</name>
                  <value>
                     <struct>
                        <member>
                           <name>order_id</name>
                           <value>
                              <int>1234567</int>
                           </value>
                        </member>
                        <member>
                           <name>order_date</name>
                           <value>
                              <string>2005-09-19</string>
                           </value>
                        </member>
                        <member>
                           <name>mfg_id</name>
                           <value>
                              <int>138</int>
                           </value>
                        </member>
                        <member>
                           <name>catalog_id</name>
                           <value>
                              <int>0</int>
                           </value>
                        </member>
                        <member>
                           <name>first_name</name>
                           <value>
                              <string>John</string>
                           </value>
                        </member>
                        <member>
                           <name>last_name</name>
                           <value>
                              <string>Smith</string>
                           </value>
                        </member>
                        <member>
                           <name>recipient</name>
                           <value>
                              <string>Joan Smith</string>
                           </value>
                        </member>
                        <member>
                           <name>message</name>
                           <value>
                              <string>This gift is for you</string>
                           </value>
                        </member>
                        <member>
                           <name>address1</name>
                           <value>
                              <string>123 Main St.</string>
                           </value>
                        </member>
                        <member>
                           <name>address2</name>
                           <value>
                              <string>Suite 100</string>
                           </value>
                        </member>
                        <member>
                           <name>address3</name>
                           <value>
                              <string />
                           </value>
                        </member>
                        <member>
                           <name>city</name>
                           <value>
                              <string>Anyville</string>
                           </value>
                        </member>
                        <member>
                           <name>state</name>
                           <value>
                              <string>CA</string>
                           </value>
                        </member>
                        <member>
                           <name>zip</name>
                           <value>
                              <string>98765</string>
                           </value>
                        </member>
                        <member>
                           <name>country</name>
                           <value>
                              <string>United States</string>
                           </value>
                        </member>
                        <member>
                           <name>country_code</name>
                           <value>
                              <string>US</string>
                           </value>
                        </member>
                        <member>
                           <name>phone</name>
                           <value>
                              <string>(877)715-7467</string>
                           </value>
                        </member>
                        <member>
                           <name>subtotal</name>
                           <value>
                              <double>15.65</double>
                           </value>
                        </member>
                        <member>
                           <name>tax</name>
                           <value>
                              <double>0</double>
                           </value>
                        </member>
                        <member>
                           <name>shipping</name>
                           <value>
                              <double>2.9</double>
                           </value>
                        </member>
                        <member>
                           <name>total</name>
                           <value>
                              <double>18.55</double>
                           </value>
                        </member>
                        <member>
                           <name>shopatron_total</name>
                           <value>
                              <double>0.74</double>
                           </value>
                        </member>
                        <member>
                           <name>fulfiller_total</name>
                           <value>
                              <double>17.81</double>
                           </value>
                        </member>
                        <member>
                           <name>fulfiller_shipping</name>
                           <value>
                              <double>2.10</double>
                           </value>
                        </member>
                        <member>
                           <name>fulfiller_tax</name>
                           <value>
                              <double>0</double>
                           </value>
                        </member>
                        <member>
                           <name>package_fee</name>
                           <value>
                              <double>0.85</double>
                           </value>
                        </member>
                        <member>
                           <name>shipment_id</name>
                           <value>
                              <int>100001</int>
                           </value>
                        </member>
                        <member>
                           <name>assigned_info</name>
                           <value>
                              <struct>
                                 <member>
                                    <name>retailer_id</name>
                                    <value>
                                       <int>2687</int>
                                    </value>
                                 </member>
                                 <member>
                                    <name>retailer_name</name>
                                    <value>
                                       <string>Test Store</string>
                                    </value>
                                 </member>
                                 <member>
                                    <name>retailer_location_id</name>
                                    <value>
                                       <int>8006</int>
                                    </value>
                                 </member>
                                 <member>
                                    <name>retailer_location_name</name>
                                    <value>
                                       <string>Test Store #24</string>
                                    </value>
                                 </member>
                                 <member>
                                    <name>retailer_address</name>
                                    <value>
                                       <string>123 Fake St</string>
                                    </value>
                                 </member>
                                 <member>
                                    <name>retailer_zip</name>
                                    <value>
                                       <string>93412</string>
                                    </value>
                                 </member>
                              </struct>
                           </value>
                        </member>
                        <member>
                           <name>additional_info</name>
                           <value>
                              <struct>
                                 <member>
                                    <name>in_store_pickup</name>
                                    <value>
                                       <int>1</int>
                                    </value>
                                 </member>
                              </struct>
                           </value>
                        </member>
                        <member>
                           <name>language_id</name>
                           <value>
                              <int>1</int>
                           </value>
                        </member>
                        <member>
                           <name>currency_id</name>
                           <value>
                              <int>1</int>
                           </value>
                        </member>
                        <member>
                           <name>packing_list</name>
                           <value>
                              <string>[packing list here]</string>
                           </value>
                        </member>
                        <member>
                           <name>num_items</name>
                           <value>
                              <int>1</int>
                           </value>
                        </member>
                        <member>
                           <name>items</name>
                           <value>
                              <struct>
                                 <member>
                                    <name>item_1</name>
                                    <value>
                                       <struct>
                                          <member>
                                             <name>item_id</name>
                                             <value>
                                                <int>12345</int>
                                             </value>
                                          </member>
                                          <member>
                                             <name>quantity</name>
                                             <value>
                                                <int>1</int>
                                             </value>
                                          </member>
                                          <member>
                                             <name>price</name>
                                             <value>
                                                <double>15.65</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>part_number</name>
                                             <value>
                                                <string>1001</string>
                                             </value>
                                          </member>
                                          <member>
                                             <name>line_item_tax</name>
                                             <value>
                                                <double>0.7942</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>line_item_subtotal</name>
                                             <value>
                                                <double>15.65</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>line_discount</name>
                                             <value>
                                                <double>0</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>fulfiller_total</name>
                                             <value>
                                                <double>14.45</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>shopatron_total</name>
                                             <value>
                                                <double>1.2</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>fulfiller_line_item_subtotal</name>
                                             <value>
                                                <double>14.3625</double>
                                             </value>
                                          </member>
                                          <member>
                                             <name>fulfiller_line_item_tax</name>
                                             <value>
                                                <double>1.3692</double>
                                             </value>
                                          </member>
                                       </struct>
                                    </value>
                                 </member>
                              </struct>
                           </value>
                        </member>
                     </struct>
                  </value>
               </member>
            </struct>
         </value>
      </param>
   </params>
</methodCall>

This example includes two orders and a test_mode parameter.

<?xml version="1.0"?>
<methodCall>
  <methodName>examples.xml_get_my_orders</methodName>
  <params>
    <param>
      <value>
        <int>2</int>
      </value>
    </param>
    <param>
      <value>
        <int>0</int>
      </value>
    </param>
    <param>
      <value>
        <struct>
          <member>
            <name>order_0</name>
            <value>
              <struct>
                <member>
                  <name>order_id</name>
                  <value>
                    <int>1234567</int>
                  </value>
                </member>
                <member>
                  <name>order_date</name>
                  <value>
                    <string>2005-09-19</string>
                  </value>
                </member>
                <member>
                  <name>mfg_id</name>
                  <value>
                    <int>138</int>
                  </value>
                </member>
                <member>
                  <name>catalog_id</name>
                  <value>
                    <int>0</int>
                  </value>
                </member>
                <member>
                  <name>first_name</name>
                  <value>
                    <string>John</string>
                  </value>
                </member>
                <member>
                  <name>last_name</name>
                  <value>
                    <string>Smith</string>
                  </value>
                </member>
                <member>
                  <name>recipient</name>
                  <value>
                    <string>Joan Smith</string>
                  </value>
                </member>
                <member>
                  <name>message</name>
                  <value>
                    <string>A gift for you </string>
                  </value>
                </member>
                <member>
                  <name>address1</name>
                  <value>
                    <string>123 Main St.</string>
                  </value>
                </member>
                <member>
                  <name>address2</name>
                  <value>
                    <string>Suite 100</string>
                  </value>
                </member>
                <member>
                  <name>address3</name>
                  <value>
                    <string></string>
                  </value>
                </member>
                <member>
                  <name>city</name>
                  <value>
                    <string>Anyville</string>
                  </value>
                </member>
                <member>
                  <name>state</name>
                  <value>
                    <string>CA</string>
                  </value>
                </member>
                <member>
                  <name>zip</name>
                  <value>
                    <string>98765</string>
                  </value>
                </member>
                <member>
                  <name>country</name>
                  <value>
                    <string>United States</string>
                  </value>
                </member>
                <member>
                  <name>country_code</name>
                  <value>
                    <string>US</string>
                  </value>
                </member>
                <member>
                  <name>phone</name>
                  <value>
                    <string>877-715-7467</string>
                  </value>
                </member>
                <member>
                  <name>subtotal</name>
                  <value>
                    <double>15.65</double>
                  </value>
                </member>
                <member>
                  <name>tax</name>
                  <value>
                    <double>0</double>
                  </value>
                </member>
                <member>
                  <name>shipping</name>
                  <value>
                    <double>2.9</double>
                  </value>
                </member>
                <member>
                  <name>total</name>
                  <value>
                    <double>18.65</double>
                  </value>
                </member>
                <member>
                  <name>shopatron_total</name>
                  <value>
                    <double>0.74</double>
                  </value>
                </member>
                <member>
                  <name>fulfiller_total</name>
                  <value>
                    <double>17.91</double>
                  </value>
                </member>
                <member>
                  <name>fulfiller_shipping</name>
                  <value>
                    <double>2.81</double>
                  </value>
                </member>
                <member>
                  <name>fulfiller_tax</name>
                  <value>
                    <double>0</double>
                  </value>
                </member>
                <member>
                  <name>package_fee</name>
                  <value>
                    <double>0.07</double>
                  </value>
                </member>
                <member>
                  <name>shipment_id</name>
                  <value>
                    <int>100001</int>
                  </value>
                </member>
                <member>
                  <name>discount</name>
                  <value>
                    <struct>
                      <member>
                        <name>discount_description</name>
                        <value>
                          <string>Abb</string>
                        </value>
                      </member>
                      <member>
                        <name>discount_percentage</name>
                        <value>
                          <double>0.1</double>
                        </value>
                      </member>
                      <member>
                        <name>discount_total</name>
                        <value>
                          <double>1.87</double>
                        </value>
                      </member>
                    </struct>
                  </value>
                </member>
                <member>
                  <name>language_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>currency_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>ship_type</name>
                    <value>
                      <string>standard</string>
                    </value>
                  </member>
                  <member>
                    <name>packing_list</name>
                    <value>
                      <string>
                        [HTML CODE HERE]
                      </string>
                    </value>
                  </member>
                  <member>
                    <name>num_items</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>items</name>
                    <value>
                      <struct>
                        <member>
                          <name>item_1</name>
                          <value>
                            <struct>
                              <member>
                                <name>item_id</name>
                                <value>
                                  <int>12345</int>
                                </value>
                              </member>
                              <member>
                                <name>quantity</name>
                                <value>
                                  <int>1</int>
                                </value>
                              </member>
                              <member>
                                <name>price</name>
                                <value>
                                  <double>15.65</double>
                                </value>
                              </member>
                              <member>
                                <name>part_number</name>
                                <value>
                                  <string>1001</string>
                                </value>
                              </member>
                              <member>
                                <name>line_item_tax</name>
                                <value>
                                  <double>0.7942</double>
                                </value>
                              </member>
                              <member>
                                <name>line_item_subtotal</name>
                                <value>
                                  <double>15.65</double>
                                </value>
                              </member>
                              <member>
                                <name>line_discount</name>
                                <value>
                                  <double>0</double>
                                </value>
                              </member>
                              <member>
                                <name>fulfiller_total</name>
                                <value>
                                  <double>14.45</double>
                                </value>
                              </member>
                              <member>
                                <name>shopatron_total</name>
                                <value>
                                  <double>1.2</double>
                                </value>
                              </member>
                              <member>
                                <name>options</name>
                                <value>
                                  <struct>
                                    <member>
                                      <name>option_1</name>
                                      <value>
                                        <string>Color:Blue </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>option_2</name>
                                      <value>
                                        <string>Style: Rough</string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>option_3</name>
                                      <value>
                                        <string>Size:L </string>
                                      </value>
                                    </member>
                                  </struct>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                </struct>
              </value>
            </member>
            <member>
              <name>order_1</name>
              <value>
                <struct>
                  <member>
                    <name>order_id</name>
                    <value>
                      <int>1234568</int>
                    </value>
                  </member>
                  <member>
                    <name>order_date</name>
                    <value>
                      <string>2005-09-19</string>
                    </value>
                  </member>
                  <member>
                    <name>mfg_id</name>
                    <value>
                      <int>138</int>
                    </value>
                  </member>
                  <member>
                    <name>catalog_id</name>
                    <value>
                      <int>0</int>
                    </value>
                  </member>
                  <member>
                    <name>first_name</name>
                    <value>
                      <string>Bob</string>
                    </value>
                  </member>
                  <member>
                    <name>last_name</name>
                    <value>
                      <string>Jones</string>
                    </value>
                  </member>
                  <member>
                    <name>recipient</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>message</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>address1</name>
                    <value>
                      <string>1234 Whatever St.</string>
                    </value>
                  </member>
                  <member>
                    <name>address2</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>address3</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>city</name>
                    <value>
                      <string>Whatever City</string>
                    </value>
                  </member>
                  <member>
                    <name>state</name>
                    <value>
                      <string>CA</string>
                    </value>
                  </member>
                  <member>
                    <name>zip</name>
                    <value>
                      <string>11111</string>
                    </value>
                  </member>
                  <member>
                    <name>country</name>
                    <value>
                      <string>United States</string>
                    </value>
                  </member>
                  <member>
                    <name>country_code</name>
                    <value>
                      <string>US</string>
                    </value>
                  </member>
                  <member>
                    <name>phone</name>
                    <value>
                      <string>877-715-7467</string>
                    </value>
                  </member>
                  <member>
                    <name>subtotal</name>
                    <value>
                      <double>21.99</double>
                    </value>
                  </member>
                  <member>
                    <name>tax</name>
                    <value>
                      <double>2.99</double>
                    </value>
                  </member>
                  <member>
                    <name>shipping</name>
                    <value>
                      <double>8.9</double>
                    </value>
                  </member>
                  <member>
                    <name>total</name>
                    <value>
                      <double>33.88</double>
                    </value>
                  </member>
                  <member>
                    <name>shopatron_total</name>
                    <value>
                      <double>1.90</double>
                    </value>
                  </member>
                  <member>
                    <name>fulfiller_total</name>
                    <value>
                      <double>31.98</double>
                    </value>
                  </member>
                  <member>
                    <name>fulfiller_shipping</name>
                    <value>
                      <double>8.74</double>
                    </value>
                  </member>
                  <member>
                    <name>fulfiller_tax</name>
                    <value>
                      <double>0</double>
                    </value>
                  </member>
                  <member>
                    <name>package_fee</name>
                    <value>
                      <double>0.07</double>
                    </value>
                  </member>
                  <member>
                    <name>shipment_id</name>
                    <value>
                      <int>100002</int>
                    </value>
                  </member>
                  <member>
                    <name>language_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>currency_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>ship_type</name>
                    <value>
                      <string>2day</string>
                    </value>
                  </member>
                  <member>
                    <name>packing_list</name>
                    <value>
                      <string>[packing list here]</string>
                    </value>
                  </member>
                  <member>
                    <name>num_items</name>
                    <value>
                      <int>2</int>
                    </value>
                  </member>
                  <member>
                    <name>items</name>
                    <value>
                      <struct>
                        <member>
                          <name>item_1</name>
                          <value>
                            <struct>
                              <member>
                                <name>item_id</name>
                                <value>
                                  <int>12346</int>
                                </value>
                              </member>
                              <member>
                                <name>quantity</name>
                                <value>
                                  <int>1</int>
                                </value>
                              </member>
                              <member>
                                <name>price</name>
                                <value>
                                  <double>9.99</double>
                                </value>
                              </member>
                              <member>
                                <name>part_number</name>
                                <value>
                                  <string>1002</string>
                                </value>
                              </member>
                              <member>
                                <name>line_item_tax</name>
                                <value>
                                  <double>0.7942</double>
                                </value>
                              </member>
                              <member>
                                <name>line_item_subtotal</name>
                                <value>
                                  <double>9.99</double>
                                </value>
                              </member>
                              <member>
                                <name>line_discount</name>
                                <value>
                                  <double>0</double>
                                </value>
                              </member>
                              <member>
                                <name>fulfiller_total</name>
                                <value>
                                  <double>9.79</double>
                                </value>
                              </member>
                              <member>
                                <name>shopatron_total</name>
                                <value>
                                  <double>1.2</double>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                        <member>
                          <name>item_2</name>
                          <value>
                            <struct>
                              <member>
                                <name>item_id</name>
                                <value>
                                  <int>12347</int>
                                </value>
                              </member>
                              <member>
                                <name>quantity</name>
                                <value>
                                  <int>2</int>
                                </value>
                              </member>
                              <member>
                                <name>price</name>
                                <value>
                                  <double>5.5</double>
                                </value>
                              </member>
                              <member>
                                <name>part_number</name>
                                <value>
                                  <string>1003</string>
                                </value>
                              </member>
                              <member>
                                <name>line_item_tax</name>
                                <value>
                                  <double>0.7942</double>
                                </value>
                              </member>
                              <member>
                                <name>line_item_subtotal</name>
                                <value>
                                  <double>11.00</double>
                                </value>
                              </member>
                              <member>
                                <name>line_discount</name>
                                <value>
                                  <double>0</double>
                                </value>
                              </member>
                              <member>
                                <name>fulfiller_total</name>
                                <value>
                                  <double>10.21</double>
                                </value>
                              </member>
                              <member>
                                <name>shopatron_total</name>
                                <value>
                                  <double>1.2</double>
                                </value>
                              </member>
                              <member>
                                <name>options</name>
                                <value>
                                  <struct>
                                    <member>
                                      <name>option_1</name>
                                      <value>
                                        <string>Color:Red </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>option_2</name>
                                      <value>
                                        <string>Size:M </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>fulfiller_line_item_subtotal</name>
                                      <value>
                                        <double>14.3625</double>
                                      </value>
                                    </member>
                                    <member>
                                      <name>fulfiller_line_item_tax</name>
                                      <value>
                                        <double>1.3692</double>
                                      </value>
                                    </member>
                                  </struct>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                </struct>
              </value>
            </member>
          </struct>
        </value>
      </param>
    </params>
  </methodCall>

This order data message includes two orders and packing lists:

<?xml version="1.0"?>
<methodCall>
  <methodName>examples.xml_get_my_orders</methodName>
  <params>
    <param>
      <value>
        <int>2</int>
      </value>
    </param>
    <param>
      <value>
        <int>0</int>
      </value>
    </param>
    <param>
      <value>
        <struct>
          <member>
            <name>order_0</name>
            <value>
              <struct>
                <member>
                  <name>order_id</name>
                  <value>
                    <int>1234567</int>
                  </value>
                </member>
                <member>
                  <name>order_date</name>
                  <value>
                    <string>2005-09-19</string>
                  </value>
                </member>
                <member>
                  <name>mfg_id</name>
                  <value>
                    <int>138</int>
                  </value>
                </member>
                <member>
                  <name>catalog_id</name>
                  <value>
                    <int>0</int>
                  </value>
                </member>
                <member>
                  <name>first_name</name>
                  <value>
                    <string>John</string>
                  </value>
                </member>
                <member>
                  <name>last_name</name>
                  <value>
                    <string>Smith</string>
                  </value>
                </member>
                <member>
                  <name>recipient</name>
                  <value>
                    <string>Joan Smith</string>
                  </value>
                </member>
                <member>
                  <name>message</name>
                  <value>
                    <string>A gift for you </string>
                  </value>
                </member>
                <member>
                  <name>address1</name>
                  <value>
                    <string>123 Main St.</string>
                  </value>
                </member>
                <member>
                  <name>address2</name>
                  <value>
                    <string>Suite 100</string>
                  </value>
                </member>
                <member>
                  <name>address3</name>
                  <value>
                    <string></string>
                  </value>
                </member>
                <member>
                  <name>city</name>
                  <value>
                    <string>Anyville</string>
                  </value>
                </member>
                <member>
                  <name>state</name>
                  <value>
                    <string>CA</string>
                  </value>
                </member>
                <member>
                  <name>zip</name>
                  <value>
                    <string>98765</string>
                  </value>
                </member>
                <member>
                  <name>country</name>
                  <value>
                    <string>United States</string>
                  </value>
                </member>
                <member>
                  <name>country_code</name>
                  <value>
                    <string>US</string>
                  </value>
                </member>
                <member>
                  <name>phone</name>
                  <value>
                    <string>877-715-7467</string>
                  </value>
                </member>
                <member>
                  <name>subtotal</name>
                  <value>
                    <double>15.65</double>
                  </value>
                </member>
                <member>
                  <name>tax</name>
                  <value>
                    <double>0</double>
                  </value>
                </member>
                <member>
                  <name>shipping</name>
                  <value>
                    <double>2.9</double>
                  </value>
                </member>
                <member>
                  <name>total</name>
                  <value>
                    <double>18.65</double>
                  </value>
                </member>
                <member>
                  <name>shopatron_total</name>
                  <value>
                    <double>0.74</double>
                  </value>
                </member>
                <member>
                  <name>fulfiller_total</name>
                  <value>
                    <double>17.91</double>
                  </value>
                </member>
                <member>
                  <name>fulfiller_shipping</name>
                  <value>
                    <double>2.81</double>
                  </value>
                </member>
                <member>
                  <name>fulfiller_tax</name>
                  <value>
                    <double>0</double>
                  </value>
                </member>
                <member>
                  <name>package_fee</name>
                  <value>
                    <double>0.07</double>
                  </value>
                </member>
                <member>
                  <name>shipment_id</name>
                  <value>
                    <int>100001</int>
                  </value>
                </member>
                <member>
                  <name>discount</name>
                  <value>
                    <struct>
                      <member>
                        <name>discount_description</name>
                        <value>
                          <string>Abb</string>
                        </value>
                      </member>
                      <member>
                        <name>discount_percentage</name>
                        <value>
                          <double>0.1</double>
                        </value>
                      </member>
                      <member>
                        <name>discount_total</name>
                        <value>
                          <double>1.87</double>
                        </value>
                      </member>
                    </struct>
                  </value>
                </member>
                <member>
                  <name>language_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>currency_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>ship_type</name>
                    <value>
                      <string>standard</string>
                    </value>
                  </member>
                  <member>
                    <name>promotion_run_id</name>
                    <value>
                      <int>11448</int>
                    </value>
                  </member>
                  <member>
                    <name>authorization_code</name>
                    <value>
                      <string>3off</string>
                    </value>
                  </member>
                  <member>
                    <name>pro_order</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>pro_group_combo_id</name>
                    <value>
                      <string>970</string>
                    </value>
                  </member>
                  <member>
                    <name>additional_info</name>
                    <value>
                      <struct>
                        <member>
                          <name>express_shipping</name>
                          <value>
                            <struct>
                              <member>
                                <name>express_shipping_flag </name>
                                <value>
                                  <int>1</int>
                                </value>
                              </member>
                              <member>
                                <name>express_shipping_text </name>
                                <value>
                                  <string>Second day express shipment </string>
                                </value>
                              </member>
                              <member>
                                <name>express_shipping_arrival </name>
                                <value>
                                  <string>2011-09-21</string>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                        <member>
                          <name>ssvs_payments</name>
                          <value>
                            <struct>
                              <member>
                                <name>svs_payment_0</name>
                                <value>
                                  <struct>
                                    <member>
                                      <name>account_number </name>
                                      <value>
                                        <string>25768 </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>amount</name>
                                      <value>
                                        <double>25 </double>
                                      </value>
                                    </member>
                                    <member>
                                      <name>authorization_ number</name>
                                      <value>
                                        <string> 6090983212674927</string>
                                      </value>
                                    </member>
                                  </struct>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                  <member>
                    <name>discount</name>
                    <value>
                      <struct>
                        <member>
                          <name>discount_description</name>
                          <value>
                            <string>1</string>
                          </value>
                        </member>
                        <member>
                          <name>discount_percentage</name>
                          <value>
                            <double>0.04</double>
                          </value>
                        </member>
                        <member>
                          <name>discount_total</name>
                          <value>
                            <double>0.626</double>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                  <member>
                    <name>assigned_info</name>
                    <value>
                      <struct>
                        <member>
                          <name>retailer_id</name>
                          <value>
                            <int>30826</int>
                          </value>
                        </member>
                        <member>
                          <name>retailer_name</name>
                          <value>
                            <string>Motor Werks Certified Outlet Wheaton</string>
                          </value>
                        </member>
                        <member>
                          <name>retailer_location_id</name>
                          <value>
                            <int>11569</int>
                          </value>
                        </member>
                        <member>
                          <name>retailer_location_name</name>
                          <value>
                            <string>Motor Werks Certified Outlet Wheaton</string>
                          </value>
                        </member>
                        <member>
                          <name>retailer_address</name>
                          <value>
                            <string>1100 E. Roosevelt Rd.</string>
                          </value>
                        </member>
                        <member>
                          <name>retailer_zip</name>
                          <value>
                            <string>60187</string>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                  <member>
                    <name>packing_list</name>
                    <value>
                      <string>
                        [HTML CODE HERE]
                      </string>
                    </value>
                  </member>
                  <member>
                    <name>num_items</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>items</name>
                    <value>
                      <struct>
                        <member>
                          <name>item_1</name>
                          <value>
                            <struct>
                              <member>
                                <name>item_id</name>
                                <value>
                                  <int>12345</int>
                                </value>
                              </member>
                              <member>
                                <name>quantity</name>
                                <value>
                                  <int>1</int>
                                </value>
                              </member>
                              <member>
                                <name>price</name>
                                <value>
                                  <double>15.65</double>
                                </value>
                              </member>
                              <member>
                                <name>part_number</name>
                                <value>
                                  <string>1001</string>
                                </value>
                              </member>
                              <member>
                                <name>line_item_tax</name>
                                <value>
                                  <double>0.7942</double>
                                </value>
                              </member>
                              <member>
                                <name>line_item_subtotal</name>
                                <value>
                                  <double>15.65</double>
                                </value>
                              </member>
                              <member>
                                <name>line_discount</name>
                                <value>
                                  <double>0</double>
                                </value>
                              </member>
                              <member>
                                <name>fulfiller_total</name>
                                <value>
                                  <double>14.45</double>
                                </value>
                              </member>
                              <member>
                                <name>shopatron_total</name>
                                <value>
                                  <double>1.2</double>
                                </value>
                              </member>
                              <member>
                                <name>options</name>
                                <value>
                                  <struct>
                                    <member>
                                      <name>option_1</name>
                                      <value>
                                        <string>Color:Blue </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>option_2</name>
                                      <value>
                                        <string>Style: Rough</string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>option_3</name>
                                      <value>
                                        <string>Size:L </string>
                                      </value>
                                    </member>
                                  </struct>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                </struct>
              </value>
            </member>
            <member>
              <name>order_1</name>
              <value>
                <struct>
                  <member>
                    <name>order_id</name>
                    <value>
                      <int>1234568</int>
                    </value>
                  </member>
                  <member>
                    <name>order_date</name>
                    <value>
                      <string>2005-09-19</string>
                    </value>
                  </member>
                  <member>
                    <name>mfg_id</name>
                    <value>
                      <int>138</int>
                    </value>
                  </member>
                  <member>
                    <name>catalog_id</name>
                    <value>
                      <int>0</int>
                    </value>
                  </member>
                  <member>
                    <name>first_name</name>
                    <value>
                      <string>Bob</string>
                    </value>
                  </member>
                  <member>
                    <name>last_name</name>
                    <value>
                      <string>Jones</string>
                    </value>
                  </member>
                  <member>
                    <name>recipient</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>message</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>address1</name>
                    <value>
                      <string>1234 Whatever St.</string>
                    </value>
                  </member>
                  <member>
                    <name>address2</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>address3</name>
                    <value>
                      <string></string>
                    </value>
                  </member>
                  <member>
                    <name>city</name>
                    <value>
                      <string>Whatever City</string>
                    </value>
                  </member>
                  <member>
                    <name>state</name>
                    <value>
                      <string>CA</string>
                    </value>
                  </member>
                  <member>
                    <name>zip</name>
                    <value>
                      <string>11111</string>
                    </value>
                  </member>
                  <member>
                    <name>country</name>
                    <value>
                      <string>United States</string>
                    </value>
                  </member>
                  <member>
                    <name>country_code</name>
                    <value>
                      <string>US</string>
                    </value>
                  </member>
                  <member>
                    <name>phone</name>
                    <value>
                      <string>877-715-7467</string>
                    </value>
                  </member>
                  <member>
                    <name>subtotal</name>
                    <value>
                      <double>21.99</double>
                    </value>
                  </member>
                  <member>
                    <name>tax</name>
                    <value>
                      <double>2.99</double>
                    </value>
                  </member>
                  <member>
                    <name>shipping</name>
                    <value>
                      <double>8.9</double>
                    </value>
                  </member>
                  <member>
                    <name>total</name>
                    <value>
                      <double>33.88</double>
                    </value>
                  </member>
                  <member>
                    <name>shopatron_total</name>
                    <value>
                      <double>1.90</double>
                    </value>
                  </member>
                  <member>
                    <name>fulfiller_total</name>
                    <value>
                      <double>31.98</double>
                    </value>
                  </member>
                  <member>
                    <name>fulfiller_shipping</name>
                    <value>
                      <double>8.74</double>
                    </value>
                  </member>
                  <member>
                    <name>fulfiller_tax</name>
                    <value>
                      <double>0</double>
                    </value>
                  </member>
                  <member>
                    <name>package_fee</name>
                    <value>
                      <double>0.07</double>
                    </value>
                  </member>
                  <member>
                    <name>shipment_id</name>
                    <value>
                      <int>100002</int>
                    </value>
                  </member>
                  <member>
                    <name>language_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>currency_id</name>
                    <value>
                      <int>1</int>
                    </value>
                  </member>
                  <member>
                    <name>ship_type</name>
                    <value>
                      <string>2day</string>
                    </value>
                  </member>
                  <member>
                    <name>packing_list</name>
                    <value>
                      <string>[packing list here]</string>
                    </value>
                  </member>
                  <member>
                    <name>num_items</name>
                    <value>
                      <int>2</int>
                    </value>
                  </member>
                  <member>
                    <name>items</name>
                    <value>
                      <struct>
                        <member>
                          <name>item_1</name>
                          <value>
                            <struct>
                              <member>
                                <name>item_id</name>
                                <value>
                                  <int>12346</int>
                                </value>
                              </member>
                              <member>
                                <name>quantity</name>
                                <value>
                                  <int>1</int>
                                </value>
                              </member>
                              <member>
                                <name>price</name>
                                <value>
                                  <double>9.99</double>
                                </value>
                              </member>
                              <member>
                                <name>part_number</name>
                                <value>
                                  <string>1002</string>
                                </value>
                              </member>
                              <member>
                                <name>line_item_tax</name>
                                <value>
                                  <double>0.7942</double>
                                </value>
                              </member>
                              <member>
                                <name>line_item_subtotal</name>
                                <value>
                                  <double>9.99</double>
                                </value>
                              </member>
                              <member>
                                <name>line_discount</name>
                                <value>
                                  <double>0</double>
                                </value>
                              </member>
                              <member>
                                <name>fulfiller_total</name>
                                <value>
                                  <double>9.79</double>
                                </value>
                              </member>
                              <member>
                                <name>shopatron_total</name>
                                <value>
                                  <double>1.2</double>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                        <member>
                          <name>item_2</name>
                          <value>
                            <struct>
                              <member>
                                <name>item_id</name>
                                <value>
                                  <int>12347</int>
                                </value>
                              </member>
                              <member>
                                <name>quantity</name>
                                <value>
                                  <int>2</int>
                                </value>
                              </member>
                              <member>
                                <name>price</name>
                                <value>
                                  <double>5.5</double>
                                </value>
                              </member>
                              <member>
                                <name>part_number</name>
                                <value>
                                  <string>1003</string>
                                </value>
                              </member>
                              <member>
                                <name>line_item_tax</name>
                                <value>
                                  <double>0.7942</double>
                                </value>
                              </member>
                              <member>
                                <name>line_item_subtotal</name>
                                <value>
                                  <double>11.00</double>
                                </value>
                              </member>
                              <member>
                                <name>line_discount</name>
                                <value>
                                  <double>0</double>
                                </value>
                              </member>
                              <member>
                                <name>fulfiller_total</name>
                                <value>
                                  <double>10.21</double>
                                </value>
                              </member>
                              <member>
                                <name>shopatron_total</name>
                                <value>
                                  <double>1.2</double>
                                </value>
                              </member>
                              <member>
                                <name>options</name>
                                <value>
                                  <struct>
                                    <member>
                                      <name>option_1</name>
                                      <value>
                                        <string>Color:Red </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>option_2</name>
                                      <value>
                                        <string>Size:M </string>
                                      </value>
                                    </member>
                                    <member>
                                      <name>fulfiller_line_item_subtotal</name>
                                      <value>
                                        <double>14.3625</double>
                                      </value>
                                    </member>
                                    <member>
                                      <name>fulfiller_line_item_tax</name>
                                       <value>
                                         <double>1.3692</double>
                                       </value>
                                    </member>
                                  </struct>
                                </value>
                              </member>
                            </struct>
                          </value>
                        </member>
                      </struct>
                    </value>
                  </member>
                </struct>
              </value>
            </member>
          </struct>
        </value>
      </param>
    </params>
  </methodCall>

Example Responses

Unlike REST APIs, the XML-RPC APIs do not return HTTP status codes to indicate success or failure. On success, the RPC returns the value 0. On an error, the RPC returns a response message with the faultCode and faultString.

A full list of faultCode and faultString options can be found below:

CodeDescription
0Success. All orders received.
1XML message is blank.
2XML message is invalid or not well-formed.
3Order data missing.
4Required shipping information missing.
5Unspecified error.

Successful responses may look like the below sample:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
   <params>
      <param>
         <value>
            <int>0</int>
         </value>
      </param>
   </params>
</methodResponse>

An error response includes an error code and reason:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
   <fault>
      <value>
         <struct>
            <member>
               <name>faultCode</name>
               <value>
                  <int>4</int>
               </value>
            </member>
            <member>
               <name>faultString</name>
               <value>
                  <string>Required shipping information missing</string>
               </value>
            </member>
         </struct>
      </value>
   </fault>
</methodResponse>

Handling Errors

If an error response fault code is received after sending the order information to OMS, follow these steps:

  1. Record the outgoing package and the associated fault code response from OMS.
  2. Test for connectivity to the server.
  3. Hold the XML package for future transmission to OMs’s servers.
  4. Send an email to OMS Merchant Support; include the time and date of the failed transmission.
  5. When Kibo support staff responds, resend the failed attempts.

System Testing and Activation

After the Ready Order Download applications are written, they need to be tested. When these tests are successful, Kibo activates the Ready Order Download API for the client’s account. To initiate the tests, send an email to OMS Merchant Support. If the project is still in the Implementations phase, work with the Implementations Coordinator.

To perform the tests, follow these steps:

  1. Send a test XML Order Data Request.The request should include the optional test_mode parameter with a value that corresponds to the response that the user wants to receive from the Data Request RPC and the Data Send application. The values correspond to the response codes and are separated by a period. See the Responses section for these values.
  2. Test the Data Request method first, then the Data Receive method. To test for a response from the Data Request RPC only, set the test_mode value to 0. To test the invalid username or password case, set the value to 2. When tests of the Data Request method are complete, test receiving an invalid XML package by setting the value to 0.1.
  3. Test the Data Send application. Set the first value to 0 for authentication. This test verifies the following:
    • The client server can successfully communicate with Kibo’s XML-RPC server
    • The XML Order Data Request is a valid, well-formed XML document and that it includes all required information.
    • The application can receive all the possible response codes.
  4. Receive a test XML Order Data package and return the correct response code. This verifies the following:
    • The OMS server can successfully communicate with the client’s XML RPC server and that the RPC name is correct in Kibo’s system
    • The client’s RPC can receive the XML package, process it, and return the correct response code.

When these tests are successful, send an email to OMS Merchant Support and request activation of this feature.

Sample Order Data Download Code (PHP)

This sample code example uses the XML-RPC for PHP open source libraries from www.xmlrpc.scripting.com.

<?php
// these includes are shown as examples. You need to write your own database connector
// and xml_functions. The two xmlrpc include files are part of XML-RPC for PHP
include_once("/includes/database_connect.php");
include_once("/includes/xmlrpc.inc");
include_once("/includes/xmlrpcs.inc");
include_once("/includes/xml_functions.php");

$username  = "joeuser";      // put in your OMS username
$password  = "Joe123";       // put in your password
$data_type = "ready_orders"; // the type of data you want to download
$test_mode = 0;              // only include when testing!

// the request message
$xml_request = new xmlrpcmsg('queue.xml_request_data',
                              array(new xmlrpcval($username,'string'),
                                  new xmlrpcval($password, 'string'),
                                    new xmlrpcval($data_type, 'string'),
new xmlrpcval($test_mode, 'int')),
                              'array');

// set up client and connect with the OMS XML RPC server
$server = new_xmlrpc_client('/xmlServer.php','xml.shopatron.com', 443);

// $server->setDebug(1);

// start page or method
echo "<html><body>
Requesting Ready Order Data...<br>";

// this is the piece that sends the request and gets the response
$result = $server->send($xml_request, 20, 'https');

// process the result
if (!$result)   // the result has not been returned
{
   $err_msg = "No response returned from RPC.";
}
else if ($result->faultCode())  // the result has been returned but there is an error
{
   $err_msg = "<p>XML-RPC Fault #".$result->faultCode().": ".$result->faultString();
}
else // the result has been returned with success response
{
   $value = $result->value();
   $response = $value->scalarval();
}
echo "response: ".$response."<br>".$err_msg.'
</body></html>';
?>

Sample Order Data Receive Application Code (PHP)

The following example uses XML-RPC for PHP open source libraries from www.xmlrpc.scripting.com.

<?php
// these includes are shown as examples. You need to write your own database connector
// and xml_functions. The two xmlrpc include files are part of XML-RPC for PHP
include_once("/includes/database_connect.php");
include_once("/includes/xmlrpc.inc");
include_once("/includes/xmlrpcs.inc");
include_once("/includes/xml_functions.php");

$xml_get_my_orders_doc = "This application receives OMS ready orders in XML format.";
function xml_get_my_orders($xml_pkg)
{
    GLOBAL $conn;
    $error_message = "";
    // this prameter contains the number of orders in the package
    $param = $xml_pkg->getParam(0);
    $num_orders = $param->scalarval();

    // the second parameter will either be the struct with order data or the test_mode
    $param = $xml_pkg->getParam(1);
    if ($xml_pkg->getNumParams() > 2)
    {
        $test_mode = $param->scalarval();
        $param = $xml_pkg->getParam(2);
    }
    // this parameter contains a struct with all the order data
    $orders = $param;
    $kind=$orders->kindOf();

    // process parameter with order data
    if ($kind == "struct")
    {
       while (list($key,$value)=$orders->structeach())
       {
          // get basic order info
          if ($key == "order_id")
          {
             $order_id = $value->scalarval();
          }
          ...
          // write loops for the items struct and item_options struct
          // get item info
            $item = $value->scalarval();
            foreach ($item as $data_type=>$data)
            {
               if ($data_type == "price")
                  $price = $data->scalarval();
               ...
            }
       }
    }

    // now that you have parsed the order data, put it into your system
    ...

    // set appropriate response code
    $response = 0; // see defined response codes for this application

    // send success or failure response code
    if ($response == 0)
       return new xmlrpcresp(new xmlrpcval($response, "string"));
    else
       return new xmlrpcresp(0, $response, $error_message);
}

$s = new xmlrpc_server (array("examples.xml_get_my_orders"=>array("function"=>"xml_get_my_orders", "signature"=>$xml_get_my_orders_sig, "docstring"=>$xml_get_my_orders_doc)));
?>