1. Search

Using order search to suit your needs

Premium search for orders and line items provides enhanced search and filtering capabilities for the orders endpoint. This feature enables custom order management screens, reporting interfaces, and unique buyer order history experiences.

Line item search capabilities

Sales metrics

Get total quantity sold or gross sales by product:

http
GET v1/lineitems/{direction}?ProductID={ProductID}

Fulfillment tracking

Find unfulfilled items:

http
GET v1/lineitems/{direction}?QuantityShipped=0

Promotion analysis

Track discounted purchases:

http
GET v1/lineitems/{direction}?PromotionDiscount=>0

Track non-discounted purchases:

http
GET v1/lineitems/{direction}?PromotionDiscount=0

Time-based analysis

Get items sold in specific period:

GET v1/lineitems/{direction}?Order.DateSubmitted=>=01-01-2022&Order.DateSubmitted=<=07-01-2022

Note: All dates use UTC format

User history

View customer purchase history:

http
GET v1/lineitems/{direction}?Order.FromUserID={BuyerUserID}

Supplier analysis

Compare supplier performance:

http
GET v1/lineitems/All?Order.ToCompanyID={SupplierID}

Note: Requires supplier/seller user with OrderAdmin and OrderReader roles.

Order filtering

Product-based filtering

Find orders containing specific products:

http
GET v1/orders/{direction}?LineItems.Product.ID={ProductID}

Address filtering

Orders with California billing:

http
GET v1/orders/Incoming?BillingAddress.State=CA

Multiple state filtering:

http
GET v1/orders/Incoming?BillingAddress.State=CA|CO

Search optimization

Search types

Available search types:

  • Default: AnyTerm
  • Expanded: Product and order data
  • Configurable ranking

Example scenario

Sample product names:

  • Button-up Black Shirt
  • Sleeveless Black Shirt
  • Cotton Blue Shirt
  • High-top Black Shoes
  • Canvas White Shoes

Find orders with any shirts:

http
GET v1/me/orders/{direction}?searchOn=LineItems.Product.Name&search=Shirt

Find orders with black shirts:

http
GET v1/me/orders/{direction}?searchType=ExactPhrase&searchOn=LineItems.Product.Name&search=Black Shirt

Line item retrieval

Get order line items:

http
GET v1/orders/{direction}/{orderID}/lineitems

Alternative URL format:

http
GET v1/orders/{direction}?searchType=ExactPhrase&searchOn=LineItems.Product.Name&search=Black Shirt

Fuzzy search in comments:

http
GET v1/orders/Incoming?search={searchTerm}

Implementation notes

Order submission status

  • Default: Returns submitted orders
  • Unsubmitted orders require explicit filter:
http
GET v1/orders/{direction}?IsSubmitted=false

Extended properties

Filter by xp without indexing:

http
GET v1/orders/{direction}?xp.ShippingOption={shippingOption}

Pagination optimization

Use NextPageKey for better performance:

http
GET v1/lineitems/{direction}?Order.DateSubmitted={date}&pageKey={Meta.NextPageKey}
If you have suggestions for improving this article, let us know!