IOrderSearchService, available in the EPiServer.Commerce.Order namespace, retrieves historical data for IOrderGroup. You can for example search for IOrderGroup (ICart, IPurchaseOrder, IPaymentPlan), apply filters, and modify search results.
This API finds orders with a specific OrderSearchFilter for a specific TOrderGroup, then returns OrderSearchResults.
## Filter orders in search
OrderSearchFilter has a criteria set for filtering orders in the search results.
CreatedFrom – Specifies the time that returned orders were created after.
CreatedTo – Specifies the time that returned orders were created before.
MarketId – Specifies that only orders created in identified markets should be returned.
ModifiedFrom – Specifies the time that returned orders were modified after.
ModifiedTo – Specifies the time that returned orders were modified before.
StartingIndex – Gets or sets the starting index.
RecordsToRetrieve – Gets or sets the number of records to retrieve.
The search is inclusive; begin and end values are included for datetime filters (CreatedFrom, CreatedTo, ModifiedFrom, ModifiedTo).
## Search results for orders
OrderSearchResults contains a collection of orders found IEnumerable <T> Orders and the number of records found int TotalRecords.
As with other abstraction APIs, you can modify this API using a custom implementation.
## Extension methods
You can also use IOrderSearchServiceExtensions to provide convenient extension methods when working with IOrderSearchService.