---
schema_version: "1"
id: d85605c915add362b7fecff9348efefcc6dbb33b3a22203b7ce982dcc6a65f49
title: Shop Order Search (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-shop-order-search.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-shop-order-search
source_site: developer.salesforce.com
content_type: documentation
content_hash: 278db695fbe21ec364aba1856cc4f8a72b8661822cb3328ec3ff04fbe605f63b
products:
  - B2C Commerce
  - Salesforce APIs
---
Shop Order Search (deprecated)

# Shop Order Search (deprecated)

The Shop API endpoints enable developers to build full shopper-experience applications such as storefronts. They are designed for high-scale usage, and include a number of areas such as Baskets & Orders, Customers, Products and Pricing. Shop API endpoints are typically read-only APIs, with the exception of baskets and orders.

**Version:** 25.6

## Servers

*   `https://{host}/s/{siteId}/dw/shop/v25_6`

Protocols: https.

## Security

*   `customers_auth` (basic) User authentication either for a registered or a guest customer (selectable in request body). Access via Base64 encoded customer:password string as 'Authorization: Basic' header.
*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### POST Search orders

`POST /order_search`

Operation ID: `Search orders`. Tags: order\_search. Security: customers\_auth; oauth2\_application; client\_id.

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
    
*   last\_modified
    
*   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.

The sum of the values of the start and count parameters should not be more than 10000.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `order_search_request`.

#### Responses

*   **default**
    
    Media type: `application/json, text/xml`. Schema: `order_search_result`.
    

## Schemas

### order\_search\_request

Document representing an order search request.

*   `count` (_integer (int32)_) The number of returned documents  
    Minimum: 1. Maximum: 200.
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling  
    Minimum: 0.
*   `expand` (_array of string_) List of expansions to be applied to each search results. Expands are optional
*   `query` (_query_, required) The query to apply
*   `select` (_string_) The field to be selected.
*   `sorts` (_array of sort_) The list of sort clauses configured for the search request. Sort clauses are optional.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.

_Example_

```
{
  "query": {
    "text_query": {
      "fields": [
        "customer_email"
      ],
      "search_phrase": "example@non.existing.com"
    }
  },
  "select": "(**)",
  "sorts": [
    {
      "field": "customer_name",
      "sort_order": "asc"
    }
  ]
}
```

### order\_search\_result

Document representing an order search result.

*   `count` (_integer (int32)_) The number of returned documents
*   `data` (_array of object_)
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling  
    Minimum: 0.
*   `expand` (_array of string_) List of expansions to be applied to each search results. Expands are optional
*   `hits` (_array of order\_search\_hit_) The sorted array of search hits. This array can be empty.
*   `next` (_result\_page_) The data that can be used (as parameters on the search request) to retrieve the next result page.
*   `previous` (_result\_page_) The data that can be used (as parameters on the search request) to retrieve the previous result page.
*   `query` (_query_) The query passed into the search
*   `select` (_string_) The field to be selected.
*   `sorts` (_array of sort_) The list of sort clauses configured for the search request. Sort clauses are optional.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.
*   `total` (_integer (int32)_) The number of returned documents

_Example_

```
{
  "count": 1,
  "hits": [
    {
      "data": {
        "adjusted_merchandize_total_tax": 3.75,
        "adjusted_shipping_total_tax": 0,
        "billing_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
}
```

### query

Document representing a query. A query contains a set of objects that define criteria used to select records. A query can contain one of the following:

*   match\_all\_query - returns all records.
    
*   term\_query - matches records where a field (or fields) exactly match some simple value (including null).
    
*   text\_query - matches records where a field (or fields) exactly matches one (or more) terms in the search phrase.
    
*   boolean\_query - formulates a complex boolean expression using query objects as criteria.
    
*   filtered\_query - allows for filtering of records based on both a query and a filter.
    

Type: `any`.

### sort

Document representing a sort request.

*   `field` (_string_, required) The name of the field to sort on.
*   `sort_order` (_string_) The sort order to be applied when sorting. When omitted, the default sort order (ASC) is used.  
    Allowed values: `asc`, `desc`.

_Example_

```
{
  "field": "customer_name",
  "sort_order": "asc"
}
```

### order\_search\_hit

Document representing an order search hit.

*   `data` (_order_) The search hit data
*   `relevance` (_number (double)_) The hit's relevance score.

_Example_

```
{
  "data": {
    "adjusted_merchandize_total_tax": 3.75,
    "adjusted_shipping_total_tax": 0,
    "billing_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
}
```

### result\_page

Data that can be used to get the next and previous page of a Data API results object.

*   `count` (_integer (int32)_) The number of returned documents.
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.

### order

Document representing an order.

*   `adjusted_merchandize_total_tax` (_number (double)_)
    
    The products tax after discounts applying in purchase currency.
    
    Adjusted merchandize prices represent the sum of product prices before services such as shipping have been added, but after adjustment from promotions have been added.
    
*   `adjusted_shipping_total_tax` (_number (double)_) The tax of all shipping line items of the line item container after shipping adjustments have been applied.
*   `billing_address` (_order\_address_) The billing address. This property is part of basket checkout information only.
*   `bonus_discount_line_items` (_array of bonus\_discount\_line\_item_) The bonus discount line items of the line item container.
*   `channel_type` (_string_, read-only) The sales channel for the order.  
    Allowed values: `storefront`, `callcenter`, `marketplace`, `dss`, `store`, `pinterest`, `twitter`, `facebookads`, `subscriptions`, `onlinereservation`, `customerservicecenter`, `instagramcommerce`, `google`, `tiktok`, `snapchat`, `youtube`, `whatsapp`.
*   `confirmation_status` (_string_) The confirmation status of the order.  
    Allowed values: `not_confirmed`, `confirmed`.
*   `coupon_items` (_array of coupon\_item_) The sorted array of coupon items. This array can be empty.
*   `created_by` (_string_) The name of the user who created the order.
*   `creation_date` (_string (date-time)_, read-only) Returns the value of attribute 'creationDate'.
*   `currency` (_string_) The ISO 4217 mnemonic code of the currency.
*   `customer_info` (_customer\_info_) The customer information for logged in customers. This property is part of basket checkout information only.
*   `customer_name` (_string_) The name of the customer associated with this order.
*   `export_status` (_string_) The export status of the order.  
    Allowed values: `not_exported`, `exported`, `ready`, `failed`.
*   `external_order_status` (_string_) The external status of the order.
*   `gift_certificate_items` (_array of gift\_certificate\_item_) The sorted array of gift certificate line items. This array can be empty.
*   `global_party_id` (_string_) globalPartyId is managed by Customer 360. Its value can be changed.
*   `grouped_tax_items` (_array of grouped\_tax_) Tax values that are summed and grouped based on the tax rate. The tax totals of the line items with the same tax rate will be grouped together and summed up. This will not affect calculation in any way.
*   `guest` (_boolean_) The registration status of the customer.
*   `last_modified` (_string (date-time)_, read-only) Returns the value of attribute 'lastModified'.
*   `merchandize_total_tax` (_number (double)_)
    
    The products total tax in purchase currency.
    
    Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added.
    
*   `notes` (_simple\_link_) The notes for the line item container.
*   `order_no` (_string_, read-only) The order number of the order.
*   `order_price_adjustments` (_array of price\_adjustment_) The array of order level price adjustments. This array can be empty.
*   `order_token` (_string_) The order token used to secure the lookup of an order on base of the plain order number. The order token contains only URL safe characters.
*   `order_total` (_number (double)_) The total price of the order, including products, shipping and tax. This property is part of basket checkout information only.
*   `payment_instruments` (_array of order\_payment\_instrument_) The payment instruments list for the order.
*   `payment_status` (_string_) The payment status of the order.  
    Allowed values: `not_paid`, `part_paid`, `paid`.
*   `product_items` (_array of product\_item_) The sorted array of product items (up to a maximum of 50 items by default). This array can be empty.
*   `product_sub_total` (_number (double)_) The total price of all product items after all product discounts. Depending on taxation policy the returned price is net or gross.
*   `product_total` (_number (double)_) The total price of all product items after all product and order discounts. Depending on taxation policy the returned price is net or gross.
*   `shipments` (_array of shipment_) The array of shipments. This property is part of basket checkout information only.
*   `shipping_items` (_array of shipping\_item_) The sorted array of shipping items. This array can be empty.
*   `shipping_status` (_string_) The shipping status of the order.  
    Allowed values: `not_shipped`, `part_shipped`, `shipped`.
*   `shipping_total` (_number (double)_)
    
    The total shipping price of the order after all shipping discounts. Excludes tax if taxation policy is net. Includes tax if taxation policy is gross. This property is part of basket checkout information only.
    
    ```
         Includes tax if taxation policy is gross.
    ```
    
*   `shipping_total_tax` (_number (double)_) The tax of all shipping line items of the line item container before shipping adjustments have been applied.
*   `site_id` (_string_) The site where the order resides.
*   `source_code` (_string_) Gets the source code assigned to this basket.
*   `status` (_string_) The status of the order.  
    Allowed values: `created`, `new`, `open`, `completed`, `cancelled`, `replaced`, `failed`.
*   `tax_rounded_at_group` (_boolean_) If the tax is rounded at group level then this is set to true, false if the tax is rounded at item or unit level
*   `tax_total` (_number (double)_) The total tax amount of the order. This property is part of basket checkout information only.
*   `taxation` (_string_) The taxation the line item container is based on.  
    Allowed values: `gross`, `net`.

_Example_

```
{
  "adjusted_merchandize_total_tax": 0.05,
  "adjusted_shipping_total_tax": 0,
  "billing_address": {
    "city": "Boston",
    "country_code": "US",
    "first_name": "Jeff",
    "full_name": "Jeff Lebowski",
    "last_name": "Lebowski",
    "c_strValue": "cTest"
  },
  "creation_date": "2014-11-06T13:36Z",
  "currency": "USD",
  "customer_info": {
    "customer_no": "jlebowski",
    "email": "jeff@lebowski.com"
  },
  "merchandize_total_tax": 5,
  "order_no": "00000101",
  "order_token": "XizrH5hY1vB-Mxno-zfoCqTkegl3y7_OrRPGNZFlYG8",
  "order_total": 1.06,
  "payment_instruments": [
    {
      "amount": 1,
      "id": "cdKCIiWbNVndQaaadhlSa35gtp",
      "payment_bank_account": {
        "drivers_license_last_digits": "ense",
        "drivers_license_masked": "**************ense",
        "number_last_digits": "mber",
        "number_masked": "*************mber"
      },
      "payment_card": {
        "card_type": "testVisa",
        "credit_card_expired": false,
        "expiration_month": 4,
        "expiration_year": 21.2,
        "holder": "TestPerson",
        "number_last_digits": "mber",
        "number_masked": "**********mber"
      },
      "payment_method_id": "OCAPI_Payment_Simple"
    }
  ],
  "product_items": [
    {
      "adjusted_tax": 5,
      "base_price": 16.49,
      "bonus_product_line_item": false,
      "item_id": "cdHBEiWbNV9ZcaaadhrCk35gtp",
      "item_text": "Simple Product",
      "price": 16.49,
      "price_after_item_discount": 16.49,
      "price_after_order_discount": 1,
      "product_id": "SimpleProduct",
      "product_name": "Simple Product",
      "quantity": 1,
      "tax": 5,
      "tax_basis": 16.49,
      "tax_class_id": null,
      "tax_rate": 0.05,
      "c_strValue": "Test"
    }
  ],
  "product_sub_total": 16.49,
  "product_total": 1,
  "shipments": [
    {
      "id": "me",
      "shipping_address": {
        "city": "Boston",
        "country_code": "US",
        "first_name": "Jeff",
        "full_name": "Jeff Lebowski",
        "last_name": "Lebowski",
        "c_strValue": "cTest"
      },
      "shipping_method": {
        "description": {
          "default": "The base shipping method."
        },
        "id": "BaseShippingMethod",
        "name": {
          "default": "Base Shipping Method"
        },
        "price": 0.01,
        "c_somestring": "ShippingMethod String Value"
      }
    }
  ],
  "shipping_items": [
    {
      "adjusted_tax": 0,
      "base_price": 0.01,
      "item_id": "devgoiWbNVc92aaadhrSk35gtp",
      "item_text": "Shipping",
      "price": 0.01,
      "price_after_item_discount": 0.01,
      "shipment_id": "me",
      "tax": 0,
      "tax_basis": 0.01,
      "tax_class_id": "DefaultTaxClass",
      "tax_rate": 0.05
    }
  ],
  "shipping_total": 0.01,
  "shipping_total_tax": 0,
  "status": "created",
  "tax_total": 0.05,
  "c_strValue": "before submit basket",
  "c_textValue": "after submit basket"
}
```

### order\_address

Document representing an order address.

*   `address1` (_string_) The first address.
*   `address2` (_string_) The second address.
*   `city` (_string_) The city.
*   `company_name` (_string_) The company name.
*   `country_code` (_string_) The two-letter ISO 3166-1 (Alpha-2) country code.  
    Allowed values: `CA`, `DE`, `US`. Value meanings: `CA`: Canada; `DE`: Germany; `US`: United States.
*   `first_name` (_string_) The first name.
*   `full_name` (_string_) The full name.
*   `id` (_string_) Id used to identify this address
*   `job_title` (_string_) The job title.
*   `last_name` (_string_) The last name.
*   `phone` (_string_) The phone number.
*   `post_box` (_string_) The post box.
*   `postal_code` (_string_) The postal code.
*   `salutation` (_string_) The salutation.
*   `second_name` (_string_) The second name.
*   `state_code` (_string_) The state code.
*   `suffix` (_string_) The suffix.
*   `suite` (_string_) The suite.
*   `title` (_string_) The title.

_Example_

```
{
  "city": "Boston",
  "country_code": "US",
  "first_name": "John",
  "last_name": "Smith"
}
```

### bonus\_discount\_line\_item

Document representing a bonus discount line item

*   `bonus_products` (_array of product\_details\_link_) The list of links to the bonus products the customer can choose from.
*   `coupon_code` (_string_) The coupon code that triggered the promotion, if applicable.
*   `id` (_string_) The ID of the line item.
*   `max_bonus_items` (_integer (int32)_) The maximum number of bonus items the user can select for this promotion.
*   `promotion_id` (_string_) The ID of the promotion which triggered the creation of the line item.

### coupon\_item

Document representing a coupon item.

*   `code` (_string_, required) The coupon code.  
    Maximum length: 256.
*   `coupon_item_id` (_string_) The coupon item id.
*   `status_code` (_string_) The status of the coupon item.  
    Allowed values: `coupon_code_already_in_basket`, `coupon_code_already_redeemed`, `coupon_code_unknown`, `coupon_disabled`, `redemption_limit_exceeded`, `customer_redemption_limit_exceeded`, `timeframe_redemption_limit_exceeded`, `no_active_promotion`, `coupon_already_in_basket`, `no_applicable_promotion`, `applied`, `adhoc`.
*   `valid` (_boolean_) A flag indicating whether the coupon item is valid. A coupon line item is valid if the status code is 'applied' or 'no\_applicable\_promotion'.

_Example_

```
{
  "code": "the99coupon"
}
```

### customer\_info

Document representing information used to identify a customer.

*   `customer_id` (_string_) The customer's number (id).  
    Maximum length: 100.
*   `customer_name` (_string_)
*   `customer_no` (_string_) The customer's number (id).  
    Maximum length: 100.
*   `email` (_string (email)_, required) The customer's email address.

_Example_

```
{
  "customer_no": "customer0012",
  "email": "valid@email.com"
}
```

### gift\_certificate\_item

A gift certificate item.

*   `amount` (_number (double)_, required) The certificate item amount.
*   `gift_certificate_item_id` (_string_) Id used to identify this item
*   `message` (_string_) The certificate's message.  
    Maximum length: 4000.
*   `recipient_email` (_string_, required) The recipient's email.  
    Minimum length: 1.
*   `recipient_name` (_string_) The recipient's name.
*   `sender_name` (_string_) The sender's name.
*   `shipment_id` (_string_) The shipment id.

_Example_

```
{
  "amount": 200,
  "message": "Present from your brother",
  "recipient_email": "peter@example.com",
  "recipient_name": "Peter Doe",
  "sender_name": "John Doe"
}
```

### grouped\_tax

Document representing a tax rate with it's summed up tax values

*   `tax_rate` (_number (double)_) The tax rate
*   `tax_value` (_number (double)_) The summed up tax total for the tax rate

### simple\_link

Document representing a link to another resource.

*   `link` (_string_) The link to the resource.

_Example_

```
{
  "link": "https://example.com/dw/shop/{version}/orders/bc0KwiWexX0ZQaaadqRTwMZFga/notes"
}
```

### price\_adjustment

Document representing a price adjustment within a basket or order. Price adjustments can be assigned at the order, product, or shipping level. They can be created by the promotion engine (if the custom flag is set to false) or can be added by custom logic (if the custom flag is set to true). For custom price adjustments created by a user, the manual flag should be set to true; this is always the case for price adjustments created using OCAPI.

A price adjustment created by custom logic can either define a price that defines the absolute price reduction or define a discount from which a price reduction is calculated (amount, percentage, and fixed\_price discounts are supported). The applied\_discount property describes the discount applied to create the price-adjustment.

*   `applied_discount` (_discount_) A price adjustment that provides details of the discount that was applied. This is `null` for custom price adjustments created without discount details.
*   `coupon_code` (_string_) The coupon code that triggered the promotion, provided the price adjustment was created as the result of a promotion being triggered by a coupon.
*   `created_by` (_string_) The user who created the price adjustment.
*   `creation_date` (_string (date-time)_, read-only) Returns the value of attribute 'creationDate'.
*   `custom` (_boolean_) A flag indicating whether this price adjustment was created by custom logic. This flag is set to true unless the price adjustment was created by the promotion engine.
*   `item_text` (_string_) The text describing the item in more detail.
*   `last_modified` (_string (date-time)_, read-only) Returns the value of attribute 'lastModified'.
*   `manual` (_boolean_)
    
    A flag indicating whether this price adjustment was created in a manual process.
    
    For custom price adjustments created using the shop API, this _always_ returns `true`. Using the scripting API, however, it is possible to set this to `true` or `false`, according to the use case.
    
*   `price` (_number (double)_) The adjustment price.
*   `price_adjustment_id` (_string_) The price adjustment id (uuid).
*   `promotion_id` (_string_) The id of the related promotion. Custom price adjustments can be assigned any promotion id so long it is not used by a price adjustment belonging to the same item and is not used by promotion defined in the promotion engine. If not specified, a promotion id is generated.
*   `promotion_link` (_string_) The URL addressing the related promotion.
*   `reason_code` (_string_) The reason why this price adjustment was made.  
    Allowed values: `BACKORDER`, `EVEN_EXCHANGE`, `PRICE_MATCH`. Value meanings: `BACKORDER`: Backorder; `EVEN_EXCHANGE`: Even Exchange; `PRICE_MATCH`: Price Match.

### order\_payment\_instrument

Document representing an order payment instrument.

*   `amount` (_number (double)_) The payment transaction amount.
*   `authorization_status` (_status_) The authorization status of the payment transaction.
*   `bank_routing_number` (_string_) The bank routing number.  
    Maximum length: 256.
*   `masked_gift_certificate_code` (_string_) The masked gift certificate code.
*   `payment_bank_account` (_payment\_bank\_account_) The payment bank account.
*   `payment_card` (_payment\_card_) The payment card.
*   `payment_instrument_id` (_string_) The payment instrument ID.
*   `payment_method_id` (_string_) The payment method id. Optional if a customer payment instrument id is specified.  
    Maximum length: 256.

_Example_

```
{
  "amount": 1,
  "payment_card": {
    "card_type": "Visa",
    "credit_card_expired": false,
    "expiration_month": 1,
    "expiration_year": 2021,
    "holder": "John Doe",
    "masked_number": "***********1111",
    "number_last_digits": "1111"
  },
  "payment_instrument_id": "ceDUYiWbN1IkkaaadkYHRkclwC",
  "payment_method_id": "CREDIT_CARD",
  "c_strValue": "any custom value"
}
```

### product\_item

Document representing a product item.

*   `adjusted_tax` (_number (double)_) The tax of the product item after adjustments applying.
*   `base_price` (_number (double)_) The base price for the line item, which is the price of the unit before applying adjustments, in the purchase currency. The base price may be net or gross of tax depending on the configured taxation policy.
*   `bonus_discount_line_item_id` (_string_) The id of the bonus discount line item this bonus product relates to.
*   `bonus_product_line_item` (_boolean_) A flag indicating whether the product item is a bonus.
*   `bundled_product_items` (_array of product\_item_) The array of bundled product items. Can be empty.
*   `gift` (_boolean_) Returns true if the item is a gift.
*   `gift_message` (_string_) The gift message.
*   `inventory_id` (_string_) The inventory list id associated with this item.  
    Maximum length: 256.
*   `item_id` (_string_) The item identifier. Use this to identify an item when updating the item quantity or creating a custom price adjustment for an item.
*   `item_text` (_string_) The text describing the item in more detail.
*   `option_items` (_array of option\_item_) The array of option items. This array can be empty.
*   `price` (_number (double)_) The price of the line item before applying any adjustments. If the line item is based on net pricing then the net price is returned. If the line item is based on gross pricing then the gross price is returned.
*   `price_adjustments` (_array of price\_adjustment_) Array of price adjustments. Can be empty.
*   `price_after_item_discount` (_number (double)_) The price of the product line item after applying all product-level adjustments. For net pricing the adjusted net price is returned. For gross pricing, the adjusted gross price is returned.
*   `price_after_order_discount` (_number (double)_) The price of this product line item after considering all dependent price adjustments and prorating all order-level price adjustments. For net pricing the net price is returned. For gross pricing, the gross price is returned.
*   `product_id` (_string_) The id (SKU) of the product.  
    Maximum length: 100.
*   `product_list_item` (_product\_list\_item\_reference_)
*   `product_name` (_string_) The name of the product.
*   `quantity` (_number (double)_, required) The quantity of the products represented by this item.  
    Minimum: 0.
*   `shipment_id` (_string_) The id of the shipment which includes the product item.
*   `shipping_item_id` (_string_) The reference to the related shipping item if it exists. This is the case if for example when a surcharge is defined for individual products using a particular a shipping method.
*   `tax` (_number (double)_) The tax of the product item before adjustments applying.
*   `tax_basis` (_number (double)_)
    
    The price used to calculate the tax for this product item.
    
    ```
         null if tax has not been set for this product item yet
    ```
    
*   `tax_class_id` (_string_)
    
    The tax class ID for the product item or null if no tax class ID is associated with the product item.
    
    if no tax class ID is associated with the product item
    
*   `tax_rate` (_number (double)_) The tax rate, which is the decimal tax rate to be applied to the product represented by this item.

_Example_

```
{
  "adjusted_tax": 5,
  "base_price": 16.49,
  "bonus_product_line_item": false,
  "item_id": "cdHBEiWbNV9ZcaaadhrCk35gtp",
  "item_text": "Simple Product",
  "price": 16.49,
  "price_after_item_discount": 16.49,
  "price_after_order_discount": 1,
  "product_id": "SimpleProduct",
  "product_name": "Simple Product",
  "quantity": 1,
  "tax": 5,
  "tax_basis": 16.49,
  "tax_class_id": null,
  "tax_rate": 0.05,
  "c_strValue": "Test"
}
```

### shipment

Document representing a shipment.

*   `adjusted_merchandize_total_tax` (_number (double)_)
    
    The products tax after discounts applying in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping have been added, but after adjustment from promotions have been added.
    
    Note that order level adjustments are considered if Discount Taxation preference is set to "Tax Products and Shipping Only Based on Adjusted Price".
    
*   `adjusted_shipping_total_tax` (_number (double)_) The tax of all shipping line items of the line item container after shipping adjustments have been applied.
*   `gift` (_boolean_) A flag indicating whether the shipment is a gift.
*   `gift_message` (_string_) The gift message.
*   `merchandize_total_tax` (_number (double)_) The products total tax in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added.
*   `product_sub_total` (_number (double)_) The total price of all product items after all product discounts. Depending on taxation policy the returned price is net or gross.
*   `product_total` (_number (double)_) The total price of all product items after all product and order discounts. Depending on taxation policy the returned price is net or gross.
*   `shipment_id` (_string_) The order specific id to identify the shipment.
*   `shipment_no` (_string_)
    
    Returns the shipment number for this shipment.
    
    This number is automatically generated.
    
*   `shipment_total` (_number (double)_)
    
    The total price of the shipment, including products, shipping and tax.
    
    Note that order level adjustments are not considered.
    
*   `shipping_address` (_order\_address_) The shipping address.
*   `shipping_method` (_shipping\_method_) The shipping method.
*   `shipping_status` (_string_) The shipping status of the shipment.  
    Allowed values: `not_shipped`, `shipped`.
*   `shipping_total` (_number (double)_)
    
    The total shipping price of the shipment after all shipping discounts. Excludes tax if taxation policy is net. Includes tax if taxation policy is gross.
    
    ```
         net. Includes tax if taxation policy is gross.
    ```
    
*   `shipping_total_tax` (_number (double)_) The tax of all shipping line items of the line item container before shipping adjustments have been applied.
*   `tax_total` (_number (double)_)
    
    The total tax amount of the shipment.
    
    Note that order level adjustments are considered if Discount Taxation preference is set to "Tax Products and Shipping Only Based on Adjusted Price".
    
*   `tracking_number` (_string_) The tracking number of the shipment.

_Example_

```
{
  "gift": true,
  "gift_message": "Happy Birthday, Sværre",
  "id": "StandardShipping",
  "shipping_address": {
    "city": "Boston",
    "country_code": "US",
    "first_name": "John",
    "last_name": "Smith"
  },
  "shipping_method": {
    "id": "BaseShippingMethod"
  }
}
```

### shipping\_item

Document representing a shipping item.

*   `adjusted_tax` (_number (double)_) The tax of the product item after adjustments applying.
*   `base_price` (_number (double)_) The base price for the line item, which is the price of the unit before applying adjustments, in the purchase currency. The base price may be net or gross of tax depending on the configured taxation policy.
*   `item_id` (_string_) The item identifier. Use this to identify an item when updating the item quantity or creating a custom price adjustment for an item.
*   `item_text` (_string_) The text describing the item in more detail.
*   `price` (_number (double)_) The price of the line item before applying any adjustments. If the line item is based on net pricing then the net price is returned. If the line item is based on gross pricing then the gross price is returned.
*   `price_adjustments` (_array of price\_adjustment_) Array of price adjustments. Can be empty.
*   `price_after_item_discount` (_number (double)_) The price of the product line item after applying all product-level adjustments. For net pricing the adjusted net price is returned. For gross pricing, the adjusted gross price is returned.
*   `shipment_id` (_string_) The identifier of the shipment to which this item belongs.
*   `tax` (_number (double)_) The tax of the product item before adjustments applying.
*   `tax_basis` (_number (double)_)
    
    The price used to calculate the tax for this product item.
    
    ```
         null if tax has not been set for this product item yet
    ```
    
*   `tax_class_id` (_string_)
    
    The tax class ID for the product item or null if no tax class ID is associated with the product item.
    
    if no tax class ID is associated with the product item
    
*   `tax_rate` (_number (double)_) The tax rate, which is the decimal tax rate to be applied to the product represented by this item.

_Example_

```
{
  "adjusted_tax": 0,
  "base_price": 0.01,
  "item_id": "devgoiWbNVc92aaadhrSk35gtp",
  "item_text": "Shipping",
  "price": 0.01,
  "price_after_item_discount": 0.01,
  "shipment_id": "me",
  "tax": 0,
  "tax_basis": 0.01,
  "tax_class_id": "DefaultTaxClass",
  "tax_rate": 0.05
}
```

### product\_details\_link

Document representing a link to the resource for product details.

*   `link` (_string_) The target of the link.
*   `product_description` (_string_) The description of the product.
*   `product_id` (_string_, required) The id of the product.
*   `product_name` (_string_) The name of the product.
*   `title` (_string_) The link title.

_Example_

```
{
  "link": "https://example.com/dw/shop/{version}/products/BlueJeansType1",
  "product_id": "BlueJeansType1",
  "product_name": "Product w/- Local Option",
  "title": "Product w/- Local Option"
}
```

### discount

Document representing a discount that was _either_ optionally applied when creating a custom price adjustment _or_ applied by the promotion engine. The property `type` is mandatory; the properties `amount` and `priceBookId` are used only in association with specific types. Some examples:

*   Type `percentage` with percentage `15.00` : a 15% discount was applied.
    
*   Type `amount` with amount `5.99` : a discount was applied to reduce the (unit) price by 5.99.
    
*   Type `fixed_price` with amount `49.99` : a discount was applied to reduce the price to 49.99.
    
*   Type `free` : a discount was applied to reduce the price to zero.
    
*   Type `price_book_price` with price\_book\_id `MyPriceBook` : a discount was applied to set the price to that defined in MyPriceBook.
    

*   `amount` (_number (double)_) The amount that is used with the amount and fixed price types.
*   `percentage` (_number (double)_) The percentage that is used with percentage types.
*   `price_book_id` (_string_) The price book id that is used with some types.
*   `type` (_string_, required) The type of discount.  
    Allowed values: `percentage`, `fixed_price`, `amount`, `free`, `price_book_price`, `bonus`, `total_fixed_price`, `bonus_choice`, `percentage_off_options`.

_Example_

```
{
  "amount": 15,
  "type": "amount"
}
```

### status

Document representing a status of an object.

*   `code` (_string_) The status code.
*   `message` (_string_) The status message.
*   `status` (_integer (int32)_)
    
    The status.
    
    For more information on the status values see dw.system.Status.OK and dw.system.Status.ERROR.
    

### payment\_bank\_account

Document representing a payment bank account.

*   `drivers_license_last_digits` (_string_) The last 4 characters of the decrypted driver's license number of the bank account associated with this payment instrument.  
    Maximum length: 256.
*   `drivers_license_state_code` (_string_) The driver license state code.  
    Maximum length: 256.
*   `holder` (_string_) The holder of the bank account.  
    Maximum length: 256.
*   `masked_drivers_license` (_string_)
    
    The decrypted driver's license number of the bank account with all but the last 4 characters replaced with a '\*' character.
    
    ```
         with a '*' character.
    ```
    
      
    Maximum length: 256.
*   `masked_number` (_string_) The bank account masked number.  
    Maximum length: 256.
*   `number_last_digits` (_string_) The last digits of the bank account number.  
    Maximum length: 256.

_Example_

```
{
  "drivers_license_last_digits": "ense",
  "drivers_license_masked": "**************ense",
  "number_last_digits": "mber",
  "number_masked": "*************mber"
}
```

### payment\_card

Document representing a payment card.

*   `card_type` (_string_) The payment card type (for example, 'Visa').  
    Maximum length: 256.
*   `credit_card_expired` (_boolean_) A flag indicating if the credit card is expired.
*   `credit_card_token` (_string_) A credit card token. If a credit card is tokenized, the token can be used to look up the credit card data at the token store.
*   `expiration_month` (_integer (int32)_) The month when the payment card expires.
*   `expiration_year` (_integer (int32)_) The year when the payment card expires.
*   `holder` (_string_) The payment card holder.  
    Maximum length: 256.
*   `issue_number` (_string_) The payment card issue number.  
    Maximum length: 256.
*   `masked_number` (_string_) The masked credit card number.  
    Maximum length: 4000.
*   `number_last_digits` (_string_) The last digits of credit card number.  
    Maximum length: 4000.
*   `valid_from_month` (_integer (int32)_) The payment card valid from month.  
    Minimum: 1. Maximum: 12.
*   `valid_from_year` (_integer (int32)_) The payment card valid from year.

_Example_

```
{
  "card_type": "Visa",
  "credit_card_expired": false,
  "expiration_month": 2,
  "expiration_year": 2022,
  "holder": "John Smith",
  "masked_number": "***********ber2",
  "number_last_digits": "ber2"
}
```

### option\_item

Document representing an option item.

*   `adjusted_tax` (_number (double)_) The tax of the product item after adjustments applying.
*   `base_price` (_number (double)_) The base price for the line item, which is the price of the unit before applying adjustments, in the purchase currency. The base price may be net or gross of tax depending on the configured taxation policy.
*   `bonus_discount_line_item_id` (_string_) The id of the bonus discount line item this bonus product relates to.
*   `bonus_product_line_item` (_boolean_) A flag indicating whether the product item is a bonus.
*   `bundled_product_items` (_array of product\_item_) The array of bundled product items. Can be empty.
*   `gift` (_boolean_) Returns true if the item is a gift.
*   `gift_message` (_string_) The gift message.
*   `inventory_id` (_string_) The inventory list id associated with this item.  
    Maximum length: 256.
*   `item_id` (_string_) The item identifier. Use this to identify an item when updating the item quantity or creating a custom price adjustment for an item.
*   `item_text` (_string_) The text describing the item in more detail.
*   `option_id` (_string_, required) The id of the option.  
    Maximum length: 256.
*   `option_items` (_array of option\_item_) The array of option items. This array can be empty.
*   `option_value_id` (_string_, required) The id of the option value.  
    Maximum length: 256.
*   `price` (_number (double)_) The price of the line item before applying any adjustments. If the line item is based on net pricing then the net price is returned. If the line item is based on gross pricing then the gross price is returned.
*   `price_adjustments` (_array of price\_adjustment_) Array of price adjustments. Can be empty.
*   `price_after_item_discount` (_number (double)_) The price of the product line item after applying all product-level adjustments. For net pricing the adjusted net price is returned. For gross pricing, the adjusted gross price is returned.
*   `price_after_order_discount` (_number (double)_) The price of this product line item after considering all dependent price adjustments and prorating all order-level price adjustments. For net pricing the net price is returned. For gross pricing, the gross price is returned.
*   `product_id` (_string_) The id (SKU) of the product.  
    Maximum length: 100.
*   `product_list_item` (_product\_list\_item\_reference_)
*   `product_name` (_string_) The name of the product.
*   `quantity` (_number (double)_) The quantity of the products represented by this item.  
    Minimum: 0.
*   `shipment_id` (_string_) The id of the shipment which includes the product item.
*   `shipping_item_id` (_string_) The reference to the related shipping item if it exists. This is the case if for example when a surcharge is defined for individual products using a particular a shipping method.
*   `tax` (_number (double)_) The tax of the product item before adjustments applying.
*   `tax_basis` (_number (double)_)
    
    The price used to calculate the tax for this product item.
    
    ```
         null if tax has not been set for this product item yet
    ```
    
*   `tax_class_id` (_string_)
    
    The tax class ID for the product item or null if no tax class ID is associated with the product item.
    
    if no tax class ID is associated with the product item
    
*   `tax_rate` (_number (double)_) The tax rate, which is the decimal tax rate to be applied to the product represented by this item.

_Example_

```
{
  "option_id": "Warranty",
  "option_value_id": "oneYear"
}
```

### product\_list\_item\_reference

*   `id` (_string_, required) The id of the product list item.
*   `priority` (_integer (int32)_)
*   `product_details_link` (_product\_details\_link_)
*   `product_list` (_product\_list\_link_) The link of the product list, the item is assigned
*   `public` (_boolean_)
*   `purchased_quantity` (_number (double)_)
*   `quantity` (_number (double)_)  
    Minimum: 0.
*   `type` (_string_)  
    Allowed values: `product`, `gift_certificate`.

### shipping\_method

Document representing a shipping method.

*   `description` (_string_) The localized description of the shipping method.
*   `external_shipping_method` (_string_) The external shipping method.
*   `id` (_string_, required) The shipping method id.  
    Maximum length: 256.
*   `name` (_string_) The localized name of the shipping method.
*   `price` (_number (double)_) The shipping cost total, including shipment level costs and product level fix and surcharge costs.
*   `shipping_promotions` (_array of shipping\_promotion_) The array of active customer shipping promotions for this shipping method. This array can be empty.

_Example_

```
{
  "id": "BaseShippingMethod"
}
```

### product\_list\_link

Document representing a link to a product list.

*   `description` (_string_) The description of this product list.
*   `link` (_string_) The target of the link.
*   `name` (_string_) The name of this product list.
*   `public` (_boolean_) A flag indicating whether the owner made this product list available for access by other customers.
*   `title` (_string_) The link title.
*   `type` (_string_) The type of the product list.  
    Allowed values: `wish_list`, `gift_registry`, `shopping_list`, `custom_1`, `custom_2`, `custom_3`.

### shipping\_promotion

Document representing a shipping promotion.

*   `callout_msg` (_string_) The localized call-out message of the promotion.
*   `link` (_string_) The URL addressing the promotion.
*   `promotion_id` (_string_) The unique id of the promotion.
*   `promotion_name` (_string_) The localized promotion name.

### bool\_filter

Document representing a boolean filter.

A boolean filter allows you to combine other filters into (possibly recursive) logical expression trees. A boolean filter is configured with a boolean operator (AND, OR, NOT) and a list of filters the operator relates to. If multiple filters are given to a boolean NOT operator, this is interpreted as a NOT upon a boolean OR of the given filters.

**Example:** (id="myId" AND coupon\_id="couponOne")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "and",
filters: \[
{ term\_filter: { field: "id", operator: "is", values: \["myId"\] } },
{ term\_filter: { field: "coupon\_id", operator: "is", values: \["couponOne"\] } }
\]
}
}
}
}

**Example:** (id="holidaySale" OR redemption\_count BETWEEN(1, 20)

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "or",
filters: \[
{ term\_filter: { field: "id", operator: "is", values: \["holidaySale"\] } },
{ range\_filter: { field: "redemption\_count", from: 1, to: 20 } }
\]
}
}
}
}

**Example:** NOT(enabled=false OR coupon\_id="special")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "not",
filters: \[
{ term\_filter: { field: "enabled", operator: "is", values: \[false\] } },
{ term\_filter: { field: "coupon\_id", operator: "is", values: \["special"\] } }
\]
}
}
}
}

*   `filters` (_array of filter_) A list of filters, which are logically combined by an operator.
*   `operator` (_string_, required) The logical operator the filters are combined with.  
    Allowed values: `and`, `or`, `not`.

### bool\_query

A boolean query allows construction of full logical expression trees consisting of other queries (usually term and text queries). A boolean query basically has 3 sets of clauses that 'must', 'should' and / or 'must not' match. If 'must', 'must\_not', or 'should' appear in the same boolean query, they are combined logically using the AND operator. The difference between must and should operators is that the must operator requires all subqueries to match whereas the should operator only requires one match

**Example:** (id = 'foo' AND description LIKE 'bar')

query: {
bool\_query: {
must: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** (id = 'foo' OR description LIKE 'bar')

query: {
bool\_query: {
should: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** (NOT (id = 'foo' AND description LIKE 'bar'))

query: {
bool\_query: {
must\_not: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** ((coupon\_id LIKE "limit" AND description LIKE "limit per customer") AND NOT (enabled=false))

query: {
bool\_query: {
must: \[
{ text\_query: { fields: \[ "coupon\_id" \], search\_phrase: "limit" } },
{ text\_query: { fields: \[ "description" \], search\_phrase: "limit per customer" } }
\],
must\_not: \[
{ term\_query: { fields: \[ "enabled" \], operator: "is", values: \[false\] } }
\]
}
}

*   `must` (_array of query_) List of queries that must match.
*   `must_not` (_array of query_) List of queries that must not match.
*   `should` (_array of query_) List of queries that should match (i.e., at least one query must match).

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### filter

Document representing a filter.

A filter contains a set of objects that define criteria used to select records. A filter can contain one of the following:

*   term\_filter - matches records where a field (or fields) exactly match some simple value (including null).
    
*   range\_filter - matches records where a field value lies in a specified range.
    
*   query\_filter - provides filtering based on a query.
    
*   bool\_filter - provides filtering of records using a set of filters combined with a specified operator.
    

Type: `any`.

### filtered\_query

A filtered query allows to filter the result of a (possibly complex) query using a (possibly complex) filter.

**Example:**

query : {
filtered\_query: {
query: {
text\_query: { fields: \["coupon\_id"\], search\_phrase: "disabled" }
},
filter: {
term\_filter: {
field: "enabled", operator: "is", values: \[ false \]
}
}
}
}

*   `filter` (_filter_, required) The (possibly complex) filter object.
*   `query` (_query_, required) The query object.

### match\_all\_query

A match all query simply matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints.

**Example:**

query: {
match\_all\_query: {}
}

Type: `any`.

### nested\_query

A nested query queries nested documents that are part of a larger document. The classical example is a product master with variants (in one big document) where you want to constrain a search to masters that have variants that match multiple constraints (like color = blue AND size = M). This query is not compatible with some search types. **Example:** finds all the documents that has firstname = "John" and lastname = "Doe"

{
"query": {
"bool\_query": {
"must": \[
{
"nested\_query": {
"path": "order.shipping\_addresses",
"query": {
"bool\_query": {
"must": \[
{
"bool\_query": {
"must": \[
{
"term\_query": {
"fields": \[ "order.shipping\_addresses.first\_name" \],
"operator": "is",
"values": \[ "John" \]
}
}
\]
}
},
{
"bool\_query": {
"must": \[
{
"term\_query": {
"fields": \[ "order.shipping\_addresses.last\_name" \],
"operator": "is",
"values": \[ "Doe" \]
}
}
\]
}
}
\]
}
},
"score\_mode": "avg"
}
}
\]
}
}
}

*   `path` (_string_, required)
*   `query` (_query_, required)
*   `score_mode` (_string_)  
    Allowed values: `avg`, `total`, `max`, `none`.

### query\_filter

Document representing a query filter. A query filter wraps any query and allows it to be used as a filter.

**Example:** (coupon\_id contains "disabled" AND (enabled=false OR active=false))

query : {
filtered\_query: {
query: { text\_query: { fields: \["coupon\_id"\], search\_phrase: "disabled" } },
filter: {
query\_filter: {
query: {
term\_query: { fields: \["enabled","active"\], operator: "is", values: \[ false \] }
}
}
}
}
}

*   `query` (_query_, required) The query to use as a filter.

### range2\_filter

Document representing a range comparison with a range filter, named Range2Filter.

A Range2Filter allows you to restrict a search result to hits where a range defined by specified attributes has a certain relationship to a specified range.

The first range (R1) is defined by a pair of attributes ("from\_field" and "to\_field") that specify the extent of a range, such as the attributes "valid\_from" and "valid\_to".

The second range (R2) is defined by "from\_value" and "to\_value".

The filter mode specifies the method used to compare the two ranges:

*   overlap: R1 overlaps fully or partially with R2
    
*   containing: R1 contains R2
    
*   contained: R1 is contained in R2
    

The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended (at one end only). You can configure whether the lower and upper bounds are inclusive or exclusive.

A range 2 filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.

**Example:** (valid dates overlap with the range January 1, 2007 through January 1, 2017)

"query" : {
"filtered\_query": {
"filter": {
"range2\_filter": {
"from\_field": "valid\_from",
"to\_field": "valid\_to",
"filter\_mode":"overlap",
"from\_value": "2007-01-01T00:00:00.000Z",
"to\_value": "2017-01-01T00:00:00.000Z"
}
},
"query": { "match\_all\_query": {} }
}
}

*   `filter_mode` (_string_) Compare mode: overlap, containing, or contained. If not specified, the default is overlap.  
    Allowed values: `overlap`, `containing`, `contained`.
*   `from_field` (_string_, required) The field name of the field that starts the first range.
*   `from_inclusive` (_boolean_) Indicates whether the lower bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `from_value` (_object_) The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
*   `to_field` (_string_, required) The field name of the field that ends the first range.
*   `to_inclusive` (_boolean_) Indicates whether the upper bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `to_value` (_object_) The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.

### range\_filter

Document representing a range filter.

A range filter allows you to restrict a search result to hits that have values for a given attribute that fall into a given value range. The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended (at one end only). You can configure whether the lower and upper bounds are inclusive or exclusive.

A range filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.

**Example:** ( redemption\_count BETWEEN (0,10\] )

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
range\_filter: {
field: "redemption\_count",
from: 0,
to: 10,
from\_inclusive: false
}
}
}
}

*   `field` (_string_, required) The search field.
*   `from` (_object_) The lower bound of the filter range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
*   `from_inclusive` (_boolean_) Indicates whether the lower bound of the range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `to` (_object_) The upper bound of the filter range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.
*   `to_inclusive` (_boolean_) Indicates whether the upper bound of the range is inclusive. If not specified, the default is true. Set to false to made the upper bound exclusive.

### term\_filter

Document representing a term filter.

A term filter allows you to restrict a search result to hits that match (exactly) one of the values configured for the filter. A term filter is useful for general restrictions that can be shared between searches. Use term filters whenever the criterion you filter on is a shared property of multiple searches (for example, like filtering by an order status). Use term filters for fields that have a discrete and small set of values only.

**Example:** (id="my\_id")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "id",
operator: "is",
values: \["my\_id"\]
}
}
}
}

**Example:** (id IN ("my\_id","other\_id"))

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "id",
operator: "one\_of",
values: \["my\_id","other\_id"\]
}
}
}
}

**Example:** (description=NULL)

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "description",
operator: "is\_null"
}
}
}
}

*   `field` (_string_, required) The filter field.
*   `operator` (_string_, required) The operator to compare the field's values with the given ones.  
    Allowed values: `is`, `one_of`, `is_null`, `is_not_null`, `less`, `greater`, `not_in`, `neq`.
*   `values` (_array of object_) The filter values.

### term\_query

A term query matches one (or more) value(s) against one (or more) document field(s). A document is considered a hit if one of the values matches (exactly) with at least one of the given fields. The operator "is" can only take one value, while "one\_of" can take multiple values. If multiple fields are specified, they are combined using the OR operator. The `less` and `greater` operators are not compatible with some search types. To query based on numeric bounds in those cases, you can use a range filter on a filtered query .

**Elastic only** : If used with multiple fields, the query is internally handled as a boolean OR of DisjointMaxQueries (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.

**Example:** (id="my\_id")

query: {
term\_query: {
fields: \["id"\],
operator: "is",
values: \["my\_id"\]
}
}

**Example:** (id IN ("my\_id","other\_id"))

query: {
term\_query: {
fields: \["id"\],
operator: "one\_of",
values: \["my\_id","other\_id"\]
}
}

**Example:** (id=null)

query: {
term\_query: {
fields: \["description"\],
operator: "is\_null"
}
}

**Example:** ((id IN ('generic', 'keyword')) OR (description IN ('generic', 'keyword'))

query: {
term\_query: {
fields: \["id", "description"\],
operator: "one\_of",
values: \["generic","keyword"\]
}
}

*   `fields` (_array of string_, required) The document field(s) the value(s) are matched against, combined with the operator.  
    Minimum items: 1.
*   `operator` (_string_, required) Returns the operator to use for the term query.  
    Allowed values: `is`, `one_of`, `is_null`, `is_not_null`, `less`, `greater`, `not_in`, `neq`.
*   `values` (_array of object_) The values the field(s) are compared against, combined with the operator.

### text\_query

A text query is used to match some text (i.e. a search phrase possibly consisting of multiple terms) against one or multiple fields. In case multiple fields are provided, the phrase conceptually forms a logical OR over the fields. In this case, the terms of the phrase basically have to match the text that would result from concatenating all given fields.

**Example:** (coupon\_id contains "xmas" )

query: {
text\_query: {
fields: \["coupon\_id"\],
search\_phrase: "xmas"
}
}

**Example:** (coupon\_id contains "xmas" OR description contains "xmas")

query: {
text\_query: {
fields: \["description", "coupon\_id"\],
search\_phrase: "xmas"
}
}

**Example:** (description contains "holiday" AND description contains "bojo")

query: {
text\_query: {
fields: \["description"\],
search\_phrase: "holiday bogo"
}
}

*   `fields` (_array of string_, required) The document fields the search phrase has to match.  
    Minimum items: 1.
*   `search_phrase` (_string_, required) A search phrase which may consist of multiple terms.