OrderSearch Resource (Shop API 16.1)

Summary

Http Method Resource Description
POST /Order_search

Searches for orders performing full text search.

The search is configured by providing a search phrase and search fields (optional). If search fields are not provided, the default ones are used (order_no). The search retrieves orders having each one word of the search phrase in any of the search fields.

Additionally the retrieved orders could be limited by "query" and "query_args" parameters.

Note that full text order search always uses Search Service and the following limitations exist:

  • wildcards are not supported, they will be filtered from the query (*, %, +) and replaces by spaces
  • LIKE and ILIKE queries will be executed as fulltext queries (working on whole words), not as substring searches
  • LIKE queries will always be case insensitive
  • using logical operators might change the execution of LIKE/ILIKE clauses to exact string comparison, depending on how they are combined
  • using logical operators might result in degraded performance, depending on how they are combined
  • the search will return only the first 1000 hits from the search result

The supported search fields are:

  • affiliate_partner_i_d
  • affiliate_partner_name
  • business_type
  • channel_type
  • confirmation_status
  • created_by
  • creation_date
  • customer_email
  • customer_name
  • customer_no
  • export_after
  • export_status
  • external_order_no
  • external_order_status
  • last_modified
  • order_no
  • original_order_no
  • payment_status
  • replaced_order_no
  • replacement_order_no
  • shipping_status
  • status
  • productitems.productid
  • orderitems.status
  • shippingorders.shippingordernumber
  • returncases.returncasenumber
  • invoices.status
  • order.hasholds
  • holds.type

The sort order of the retrieved orders could be specified by the "sort_fields" parameter. It is a list of objects presenting field name (mandatory) and sort direction ("asc" or "desc").

Custom attributes could be used as "search_fields" and as "sort_fields" too. A prefix "c_" has to be added to them.

Search Orders

Searches for orders performing full text search.

The search is configured by providing a search phrase and search fields (optional). If search fields are not provided, the default ones are used (order_no). The search retrieves orders having each one word of the search phrase in any of the search fields.

Additionally the retrieved orders could be limited by "query" and "query_args" parameters.

Note that full text order search always uses Search Service and the following limitations exist:

The supported search fields are:

The sort order of the retrieved orders could be specified by the "sort_fields" parameter. It is a list of objects presenting field name (mandatory) and sort direction ("asc" or "desc").

Custom attributes could be used as "search_fields" and as "sort_fields" too. A prefix "c_" has to be added to them.

Url

POST https://hostname:port/dw/shop/v16_1/order_search

Formats

json, xml

Authentication

Name Description
JWT Authentication via Customer JWT token.
OAuth Authentication via OAuth token.

Request Document

OrderSearchRequest

Response Document

OrderSearchResult

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 OrderSearchIndexingDisabledException   Thrown when Incremental Indexing is not enabled for Order search schema.

Sample

REQUEST:
POST /dw/shop/v16_1/order_search HTTP/1.1
Host: example.com
Accept: application/json
{
    sort_fields : [
        {
            field_name:"customer_name", 
            sort_dir : "ASC"
        }], 
        search_phrase : "[email protected]", 
        search_fields : ["customer_email" ], 
        select : "(**)" 
}

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
   "_v" : "16.1",
   "_type" : "order_search_result",
   "count" : 1,
   "hits" : 
   [
      
      {
         "_type" : "order_search_hit",
         "data" : 
         {
            "_type" : "order",
            "adjusted_merchandize_total_tax" : 3.75,
            "adjusted_shipping_total_tax" : 0.00,
            "billing_address" : 
            {
               "_type" : "order_address",
               "city" : "Boston",
               "country_code" : "US",
               "first_name" : "Jane",
               "full_name" : "Jane Doe",
               "last_name" : "Doe",
               "postal_code" : "29199"
            },
            "channel_type" : "callcenter",
           ...
            "c_created_by" : "testAgent"
         },
         "relevance" : 2.822207450866699
      }
   ],
   "select" : "(**)",
   "start" : 0,
   "total" : 1
}
OCAPI obsolete versions 13.x and 14.x will be end of life in 2020 and versions 15.x and 16.x in 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.