The headless approach in commerce is no longer an option, businesses more often need omnichannel purchasing and inventory management experiences not just on the customer side of the system, but through any phase of the system lifecycle. There are a number of Commerce Systems on the market today that allow for omnichannel ordering strategies and headless integrations, but there is only one system that combines personalized user experience, a single development process across all components of the platform, and supports headless integration at any phase of the user journey.
To enable the even-drive model, we need to define an input mechanism for Sitecore Order messages, we also need to define a process for subscribing a client to notification pipeline. In my example, I’ve used IoT Device as a client and naturally, IoT Hub was used for establishing messaging flow , but Service Bus, Event Grid or even HTTP hook are excellent options, depends on the client used. The message can be pulled-by or pushed-to Azure Logic App Pipelines for processing. Logic App would not just be responsible for message processing, it’ll be orchestrating ordering process, would notify uses and monitor Sitecore for order status changes and will push data for analytics analysis.
On the Sitecore side, the ordering mechanism will be supported by Commerce Connect Abstract Service layer API which already has most APIs available, but it can be easily extended to support custom end-points, running on top of Commerce Connect. We will need to integrate Sitecore’s internal messaging routines with Azure Logic App to enable subscriber model, where Sitecore would raise an event(using Event Grid, for example ) to notify clients of a change, and we will use Sitecore’s Order API to get data into Logic App. To ensure the security of the purchasing process, Sitecore’s standard authentication approach will be used. The JWT token will be retrieved from the Identity server and passed to subsequent API calls in the header of each request. To place an order over a single end-point, I’ve created a simple order orchestration plugin that combines: CartLineComponent, PhysicalFulfillmentComponent, and FederatedPaymentComponent. Azure functions are a great choice for integrating Sitecore APIs with Azure infrastructure over HTTPS protocol.
I fully expect Sitecore JSS to be used by the majority of Sitecore Commerce Headless integrations, but in a case where you want to connect a special client or use your commerce solution with IoT, using the Commerce Connect Abstract Service layer with Azure SaaS functionalities is a great way to go. The Sitecore plug-and-play APIs and Azure’s SaaS components allow for almost codeless integration of any clients with Experience Commerce.