on 2025 Jul 24 8:51 AM
This blog explores how SAP Integration Suite can be used to send real-time sales data from a commerce system to Emarsys Predict Data Source, enabling Smart Insights to function seamlessly. We'll walk through the integration flow, highlight key and payload structures.
Business Scenario
Let’s consider a retail brand, which wants to send real-time online sales data to Emarsys for Smart Insights. The goal is to capture customer purchase behavior immediately after a transaction and feed it into Emarsys Predict.
Architecture Overview
The integration flow involves:
Integration Flow:
In our integration flow (iFlow), we implemented a real-time sales data pipeline to Emarsys Predict using SAP Integration Suite. Here's a high-level overview of the steps involved, which can be customized based on specific business requirements:
JSON to XML Conversion:
We began by adding a JSON to XML Converter, setting the root element as "salesOrder" to structure the incoming data appropriately.
Message Mapping:
A Message Mapping step was introduced where we:
XML to CSV Conversion:
The transformed XML was then passed through an XML to CSV Converter.
Content Modifier & API Call:
We used a Content Modifier to add the required CSV headers, followed by a Request-Reply step to send the final payload to the Emarsys Sales API.
Request Reply - HTTP Adapter Configuration:
Emarsys Sales API Details: Uploading your sales data
Sample Input Payload:
{
"user": "RetailStore",
"id": "403509910",
"transType": "SALES_ORDER",
"transDate": "20230524",
"transTime": "12:41:56+00:00",
"marketingArea": "STORE",
"storeId": "store_gb",
"totalSalesAmount": 208.0,
"salesCurrency": "GBP",
"customerId": "uk.user3@gmail.com",
"discountPercent": 0.0,
"discountAmount": 0.0,
"totalDiscounts": 0.0,
"promotionDiscounts": 0.0,
"communicationMedium": "Online",
"deliveryCost": 0.0,
"deliveryType": "",
"deliveryPostalCode": "",
"deliveryCity": "",
"deliveryCountry": "",
"items": [
{
"productId": "PROD001",
"totalPrice": 160.00,
"unitPrice": 20.0,
"quantity": 8,
"discountLineAmount": 0.0,
"discountLinePercent": 0.0,
"promotionName": "SAMPLECODE-100-200-300-400-500",
"promotionCode": "SAMPLECODE-100-200-300-400-500",
"salesAmount": 160.00
},
{
"productId": "PROD001",
"totalPrice": 0.00,
"unitPrice": 0.0,
"quantity": 1,
"discountLineAmount": 0.0,
"discountLinePercent": 0.0,
"promotionName": "SAMPLECODE-100-200-300-400-500",
"promotionCode": "SAMPLECODE-100-200-300-400-500",
"salesAmount": 0.00
}
]
}This setup ensures seamless and real-time data flow from your source system to Emarsys Predict. The iFlow can be easily modified to accommodate different data structures or business logic as needed.
Request clarification before answering.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.