====== OrderQueryRq (Request) ====== The OrderQueryRq request allows users to retrieve the entire order information from the Fortune3 database. All relevant order information will be included in the response. It can be used to retrieve all of the orders in the ecommerce website, or a single order, or a group of orders based on certain conditions (Filters). ===== Retrieving All Orders ===== Although Fortune3 recommends filtering your requests in order to save bandwidth and response lengths, you can retrieve the information for all of the orders on your ecommerce shopping cart. Proceed as follows: **Sample Code**: TWmY6WBft SKW8ssAmDu6xTGDl ===== Retrieving 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 conditions. Using the 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 nodes for each filter you want to add to your request. Proceed as Follows: **Sample Code** (retrieving Order ID "29563"): TWmY6WBft SKW8ssAmDu6xTGDl 29563 ===== Available Filters for OrderQueryRq ===== ^ Tag Name ^ Sub-Tag Of ^ Description ^ Field Type ^ Can Repeat ^ | Filters | OrderQueryRs | 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 node, or by adding separate nodes for each filter. By using the same 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"): TWmY6WBft SKW8ssAmDu6xTGDl 42355 45223 43644 ===== Filtering Options ===== However, if you use multiple 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, and . 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 your condition match if the value you send partially matches the result in the databse (where Name contains "Sony"). The 'FilterStyle' tag is only used if you are using more than one 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"): TWmY6WBft SKW8ssAmDu6xTGDl 2011-03-16 23:59:59 2011-03-17 23:59:59 and **Sample Code 2** (Starting Date "2011-03-16 23:59:59" and Status "shipped" and StatusHistory contains "authorized"): TWmY6WBft SKW8ssAmDu6xTGDl 2011-03-16 23:59:59 shipped and authorized contains and **Sample Code 3** (Customer Name contains "Steve Miller" or Customer Name contains "Kevin Miller"): TWmY6WBft SKW8ssAmDu6xTGDl Steve contains Miller exact and Kevin contains or Miller exact and Using these guidelines, you can fully filter out the OrderQueryRq response to only provide you with the categories that you need. Next: [[OrderQueryRs|Reading the Response (OrderQueryRs)]]