FAIR Consulting Group Extending SAP Commerce with SCP for Twilio SMS order Updates.

Extending SAP Commerce With SCP Extension Factory & Twilio for SMS order updates

Share on facebook
Share on twitter
Share on linkedin

Extending SAP Commerce With SCP Extension Factory & Twilio for SMS order updates

Overview

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.

Why do we need this?

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.

How does it work?

  • Customer places an order in SAP Commerce
  • SCP Extension factory consumes the order created event through the pre-built integration which triggers a serverless lambda function
  • The lambda function reads the customer’s phone number from the order details and uses the Twilio APIs to trigger an SMS
  • The customer gets an SMS on their recently placed order

The image below shows how this integration works

Features

  • Order updates via SMS capability in SAP Commerce

Technical implementation

Setup in SAP Commerce Cloud

I have connected the SAP Commerce Cloud with SCP Extension factory through C/4HANA cockpit by following these links:

https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/1905/en-US/cdd6c450a2f24f56961c02edb070f1c4.html
https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/1905/en-US/01c870c2c21448c6bffb8412bc2d5038.html

Similarly, I customised the order.created event in SAP Commerce Cloud through the back office by adding 2 additional attributes to the event.

  1. Customer’s name
  2. Customer’s mobile number

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.

 

Setup in Twilio

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.

 

Implementation in SCP Extension

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.

Customer Journey

Upon placing an order in SAP Commerce, I received an SMS on my phone from Twilio.

Conclusion

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.

Stay up-to-date with FAIR

Connect with FAIR today and get the latest tips and tricks on improving your customer experience tools and eCommerce platforms. Once you subscribe you will get access to workshops, webinars, recent projects and so much more.