This is an old revision of the document!


OrderStatusQueryRq (Request)

The OrderStatusQueryRq request allows users to quickly retrieve order status and tracking information from any order on your ecommerce store, without retrieving all of the other information about the order (for simplifying status retrievals). Only Status and Tracking information for the order will be returned. It can be used to retrieve the status information for all of the products and options in the ecommerce website, or a single product, or a group of products based on the SKU conditions (Filters) you submit.

Retrieving Status Information for All Orders

Although Fortune3 strongly recommends filtering your requests in order to save bandwidth and response lengths, you can retrieve the status information for all of the orders on your ecommerce shopping cart. Proceed as follows:

Sample Code:

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<OrderStatusQueryRq RequestID="1" />
</sendRequestXML>

Warning: If your shopping cart has more than 10,000 orders in its history, please do not query all of your orders, as this may cause problems with your database and even crash your site. Instead use filters in your queries to only retrieve certain orders based on criteria or conditions.

Retrieving Status for Certain Orders (Using Filters)

You can use Filters to limit which orders you get in the response based on certain conditions, and therefore highly optimize the response by shortening it to only include your desired orders. Using the <Filters> node, you can specify as many filters as you like that must be matched in order for the order to be returned in the response. Since you can specify multiple filters within the same request, and each filter can have different settings, you may also specify individual <Filter> nodes for each filter you want to add to your request. Proceed as Follows:

Sample Code (retrieving status info for Order ID “29563”):

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<OrderStatusQueryRq RequestID="1">
  <Filters>
    <Filter>
      <OrderID>29563</OrderID>
    </Filter>
  </Filters>
</OrderStatusQueryRq>
</sendRequestXML>

Available Filters for OrderStatusQueryRq

Tag Name Sub-Tag Of Description Field Type Can Repeat
Filters OrderStatusQueryRs The Filters Activation Node Node False
Filter Filters The Current Filter Node Node True
OrderID Filter Matches the Order ID Number True
DateFrom Filter Orders after this date using EST
Time Zone (New York)
Date
Format: “YYYY-MM-DD hh:mm:ss”
Sample: “2011-04-16 12:32:57”
False
DateTo Filter Orders until this date using EST
Time Zone (New York)
Date
Format: “YYYY-MM-DD hh:mm:ss”
Sample: “2011-04-16 12:32:57”
False
PONumber Filter Matches the Purchase Order Number String True
OrderIDFrom Filter Returns Orders where Order ID is >= value Number False
OrderIDTo Filter Returns Orders where Order ID is ⇐ value Number False
OrderType Filter Returns Orders that Match the Order Type String:
* retail
* wholesale
False
Status Filter Matches the Order's Current Status String:
* authorized
* preauthorized
* shipped
* partialship
* backorder
* open
* receivepay
* pending
* delivered
* failed
* voided
* incremented
* refunded
True
StatusHistory Filter Matches any of the Order's Status History String:
* authorized
* preauthorized
* shipped
* partialship
* backorder
* open
* receivepay
* pending
* delivered
* failed
* voided
* incremented
* refunded
True
PaymentMethod Filter Matches the Order's Payment Method String:
* visa
* master
* amex
* discover
* paypal
* echeck
* diners
* jcb
* cash
* COD
* storecredit
* check
* cashiercheck
* moneyorder
* wire
* other
True
CustomerID Filter Returns Orders that match the Customer ID Number True
CustomerFName Filter Returns Orders that match the First Name String True
CustomerLName Filter Returns Orders that match the Last Name String True

Using Multiple Filters

You can use multiple filters within a single request by either adding the multiple filters to the same <Filter> node, or by adding separate <Filter> nodes for each filter. By using the same <Filter> node to list multiple filters, you cannot add filtering options and you are therefore limited to the default filtering settings, which is to do an “exact” match of the filter, and to separate each filter with an “or”, so that each filter will produce a result independent of the other filters:

Sample Code (Order ID matches “42355” or Order ID matches “45223” or Order ID matches “43644”):

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<OrderStatusQueryRq RequestID="1">
  <Filters>
    <Filter>
      <OrderID>42355</OrderID>
      <OrderID>45223</OrderID>
      <OrderID>43644</OrderID>
    </Filter>
  </Filters>
</OrderStatusQueryRq>
</sendRequestXML>

Filtering Options

However, if you use multiple <Filter> nodes for each filter, you can specify the options for each Filter using Filtering Options.

There are 2 XML tags that you can use on each filter to specify the options for that filter, <FilterMatch> and <FilterStyle>.

The 'FilterMatch' tag allows you to specify if you would like to do an “exact” match of the filter (the default), or a “contains” match of the filter, making the result match if the value you send partially matches the value in the databse (where CustomerFName contains “Steve”).

The 'FilterStyle' tag is only used if you are using more than one <Filter> node and should only be used for the 2nd filter and on (not for the first). It allows you to specify if the current filter you are sending should be matched with an 'or' parameter when following the previous filter (the default), or an 'and' parameter. Using 'and' will make the current filter match in addition to the previous filter (which is why the first filter should not have it), whereas using 'or' (or omitting the 'FilterStyle' since this is the default value) will make the current filter match, whether or not the previous filter matched.

Tag Name Sub-Tag Of Description Field Type Allowed Values Can Repeat
FilterStyle Filter Specifies if the current filter is
independent from the previous filter
String “or”
“and”
False
FilterMatch Filter Specifies if the current filter must
be an exact match or a “like” match
String “exact”
“contains”
False

Sample Code (Starting Date “2011-03-16 23:59:59” and End Date “2011-03-17 23:59:59”):

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<OrderStatusQueryRq RequestID="1">
  <Filters>
    <Filter>
      <DateFrom>2011-03-16 23:59:59</DateFrom>
    </Filter>
    <Filter>
      <DateTo>2011-03-17 23:59:59</DateTo>
      <FilterStyle>and</FilterStyle>
    </Filter>
  </Filters>
</OrderStatusQueryRq>
</sendRequestXML>

Sample Code 2 (Starting Date “2011-03-16 23:59:59” and Status “shipped” and StatusHistory contains “authorized”):

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<OrderStatusQueryRq RequestID="1">
  <Filters>
    <Filter>
      <DateFrom>2011-03-16 23:59:59</DateFrom>
    </Filter>
    <Filter>
      <Status>shipped</Status>
      <FilterStyle>and</FilterStyle>
    </Filter>
    <Filter>
      <StatusHistory>authorized</StatusHistory>
      <FilterMatch>contains</FilterMatch>
      <FilterStyle>and</FilterStyle>
    </Filter>
  </Filters>
</OrderStatusQueryRq>
</sendRequestXML>

Sample Code 3 (Customer Name contains “Steve Miller” or Customer Name contains “Kevin Miller”):

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<OrderStatusQueryRq RequestID="1">
  <Filters>
    <Filter>
      <CustomerFName>Steve</CustomerFName>
      <FilterMatch>contains</FilterMatch>
    </Filter>
    <Filter>
      <CustomerLName>Miller</CustomerLName>
      <FilterMatch>exact</FilterMatch>
      <FilterStyle>and</FilterStyle>
    </Filter>
    <Filter>
      <CustomerFName>Kevin</CustomerFName>
      <FilterMatch>contains</FilterMatch>
      <FilterStyle>or</FilterStyle>
    </Filter>
    <Filter>
      <CustomerLName>Miller</CustomerLName>
      <FilterMatch>exact</FilterMatch>
      <FilterStyle>and</FilterStyle>
    </Filter>
  </Filters>
</OrderStatusQueryRq>
</sendRequestXML>

Using these guidelines, you can fully filter out the OrderStatusQueryRq to only provide you with the orders that you need.

Next: Reading the Response (OrderStatusQueryRs)

Print/export