The aim of this blog is to demonstrate how to extend SAP Commerce using SCP (SAP Cloud Platform) Extension Factory, the new functionality showcased here is focused on sending SMS updates to customers for orders created in SAP Commerce, leveraging Twilio.
Twilio is a cloud communications platform as a service (cPAAS) whose Programmable SMS API helps to add robust messaging capabilities to any application.
SCP Extension Factory is an innovative extension framework available as part of the SAP C/4HANA suite. In addition, this framework plays a key role in extending the C/4HANA clouds through side-by-side extensibility. Hence, SAP Commerce could be extended in an event-driven, cloud-native way rather than the traditional way of java based extensions along with the benefits of efficiency, speed and independent deployments. For this POC I am using the Kyma runtime under the SCP Extension factory.
The image below shows how this integration works
Setup in SAP Commerce Cloud
I have connected the SAP Commerce Cloud with SCP Extension factory through C/4HANA cockpit by following these links:
Similarly, I customised the order.created event in SAP Commerce Cloud through the back office by adding 2 additional attributes to the event.
Adding a new attribute in order.created event configuration
Furthermore, The set of attributes under order.created event will be passed to the event bus in Kyma when the order is placed in SAP Commerce.
As well as, I created a trial account in Twilio (https://www.twilio.com/) and got the Twilio phone number, Auth token and Account SID by creating a sample project which is required for triggering an SMS message.
Moreover, After completing the setup in Kyma and SAP Commerce, I created a lambda function to process the order created event.
Below is the lambda function which utilises Twilio node.js APIs to send SMS to customers.
The node dependencies needed for this lambda function.
The environment variables that will be used within the lambda function.
Upon placing an order in SAP Commerce, I received an SMS on my phone from Twilio.
Extending SAP Commerce is much easier than before with the introduction of SCP Extension Factory. Uniquely, the key takeaways from this POC demonstration is how easy it has become to integrate a new system with SAP Commerce and extend its capability with very minimal code, easy configuration, no downtime and deployment.