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

Table of Contents


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 CX suite. This framework plays a key role in extending the SAP CX 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

Extension FactoryFeatures

  • 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 SAP CX cockpit by following these links:

Installing the Module

One-Click Integration

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

Extension Factory

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

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 Factory

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.

 SAP Commerce

The node dependencies needed for this lambda function.

Extension Factory

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.


Extending SAP Commerce is much easier than before with the introduction of SCP Extension Factory. 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.

Share the article with your peers!