OrderSearch resource (Shop API 19.10)

Summary

Http Method Resource Description
POST /order_search Searches for orders.

The query attribute specifies a complex query that can be used to narrow down the search.

Note that search fields are mandatory now and no default ones are supported.

As the old order search version, the new one always uses Search Service too and the for that reason Order Incremental Indexing should be enabled. Otherwise HTTP 500 response will occur.

The supported search fields are:
  • affiliate_partner_i_d
  • affiliate_partner_name
  • business_type
  • channel_type
  • confirmation_status (String)
  • created_by
  • creation_date
  • currency_code
  • customer_email
  • customer_name
  • customer_no
  • export_after
  • export_status (String)
  • external_order_no
  • external_order_status
  • global_party_id
  • last_modified
  • order_no
  • original_order_no
  • payment_status (String)
  • replaced_order_no
  • replacement_order_no
  • shipping_status (String)
  • status (String)
  • total_gross_price
  • total_net_price
  • order.has_holds
  • coupon_line_items.coupon_code
  • coupon_line_items.coupon_id
  • holds.type
  • invoices.status
  • order_items.status
  • payment_instruments.credit_card_type
  • payment_instruments.payment_method_id
  • product_items.product_id
  • return_cases.return_case_number
  • shipments.shipping_method_id
  • shipping_orders.shipping_order_number
The sort order of the retrieved orders could be specified by the "sorts" parameter. It is a list of objects presenting field name 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.

The query attribute specifies a complex query that can be used to narrow down the search.

Note that search fields are mandatory now and no default ones are supported.

As the old order search version, the new one always uses Search Service too and the for that reason Order Incremental Indexing should be enabled. Otherwise HTTP 500 response will occur.

The supported search fields are: The sort order of the retrieved orders could be specified by the "sorts" parameter. It is a list of objects presenting field name 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/v19_10/order_search

Formats

json, xml

Authentication

Name Description
JWT Authentication via Customer JWT token. A valid user is required.
OAuth Authentication via OAuth token.

Request Document

OrderSearchRequest

Response Document

OrderSearchResult

Customization

This Resource supports server-side customization.

Extension Point Method Detail
dw.ocapi.shop.order_search.modifyPOSTResponse

modifyPOSTResponse (orderSearchResultResponse : OrderSearchResult ) : Status

Parameters:
orderSearchResultResponse - order search result response object.
Returns:
a non-null Status ends the hook execution

Sample

REQUEST:
POST /dw/shop/v19_10/order_search HTTP/1.1
Host: example.com
Accept: application/json
{ 
   "query" :
   { 
      "text_query": { "fields": ["customer_email"], "search_phrase":"[email protected]" }
   },
   "select" : "(**)",
   "sorts" : [{"field":"customer_name", "sort_order":"asc"}]
}

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
   "_v" : "19.10",
   "_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
}
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. By continuing to use this site you are giving us your consent to do this.