An oft overlooked feature of Sitecore XP and XC is the xConnect layer. Specifically the xConnect Search API can be leveraged for detailing key Commerce information such as returning a list of clients of who purchased a product.
The xConnect Client API
Before we dive into searching and listing out Commerce interactions, its critical to understand the xConnect Client API. Simply stated by Sitecore:
The xConnect Client API is a portable web API that allows trusted clients to create, read, update, and search contacts and interactions over HTTPS.
What this means is that you can leverage the xConnect layer for retrieving data and performing actions such as bulk index updates. Why this is so powerful is that you can literally use this data in any way you need. You could create custom reports, custom admin pages, or new features by extending the base Sitecore xConnect operations to specifically meet the needs of your organization.
For example, if marketing requires a special report of customers in a location and the ability to update a contact with custom facets, you can do that. Conversely from an admin perspective, you can use the API to delete contacts and interactions from the xDB database. Lastly, you could create new powerful features driven by this data, such as showing an end user products they are likely to enjoy based on what others have bought in their region (ex. Other users in London bought umbrellas, you should consider one too!).
This is truly a full SOA type layer, so please take some time to look at all the options for the xConnect Client API at: https://doc.sitecore.com/developers/101/sitecore-experience-platform/en/xconnect-client-api–c–.html
Retrieving Commerce Interactions via the xConnect Search API
The xConnect Search API is a powerful subset of the overall client API. It allows you to search contacts and interactions without leveraging Sitecore’s Content Search. More details about the Search API is here: https://doc.sitecore.com/developers/101/sitecore-experience-platform/en/work-with-search.html
Why this matters in a Commerce scenario is that you can you leverage the xConnect Search API to perform actions such as:
- Returning a list of customers who have placed orders
- Return a list of products purchased by customers
- Get a list of products and categories viewed by customers (just imagine a recommend products feature tied to this!)
- Return a list of customers who have abandoned their carts
Sitecore provides details examples of the aforementioned in their documentation at: https://doc.sitecore.com/developers/101/sitecore-experience-commerce/en/search-contacts-and-commerce-interactions-in-the-xdb-index.html
As you can see by the examples, there are a lot of options for the facets to grab and how to utilize this data. You could use it for reporting purposes, or tie it into larger features for higher conversion on product purchases… it is really up to you on how to use this, but I would recommend looking beyond just these examples and into the overall xConnect Client API to maximize your xConnect use.