Design and implement an ERP integration for order processing, customer replication, and data synchronization with Composable Commerce.
Integrating Composable Commerce with an Enterprise Resource Planning (ERP) system is often a central aspect of a commerce project. An ERP system typically holds the key master data crucial for a business, including product information, customer data, and inventory levels. To ensure smooth operations, core business processes such as order replication must be managed and synchronized between both systems.
This page covers the key considerations for integrating Composable Commerce with an ERP system. Topics include typical data flows, middleware selection, order replication with Connect, and integration best practices.
Typical ERP data flows
The following table outlines the typical data flows between an ERP system and Composable Commerce:
| Data domain | Data flow direction | Composable Commerce resource | Integration method |
|---|---|---|---|
| Products and material | ERP → Composable Commerce | Product and Product Variant | Asynchronous: batch and delta |
| Product classification | ERP → Composable Commerce | Product Type, Attribute, and Product Variant | Asynchronous: batch and delta |
| Prices and discounts | ERP → Composable Commerce | Embedded or Standalone Prices | Asynchronous: batch and delta |
| B2C Customer | Composable Commerce → ERP | Customer profiles and transaction histories | Asynchronous |
| B2B Customer | ERP → Composable Commerce | Business Units and Associates | Asynchronous: batch and delta |
| B2B Customer | Composable Commerce → ERP | Associates → Accounts | Asynchronous |
| Stock levels | ERP → Composable Commerce | Inventory | Asynchronous: batch and delta |
| Orders | Composable Commerce → ERP | Orders → Sales Orders | Asynchronous |
| Invoices | ERP → Composable Commerce | Order (via Custom Fields) | Asynchronous |
This data exchange framework covers the key elements of commerce operations: product information, pricing, customer data, inventory, and order management. The asynchronous nature of these integrations, often incorporating both batch and delta methods, enables efficient data transfer without blocking real-time API operations.
Inbound data flow (ERP to Composable Commerce)
Inbound data replication brings Products, Prices, Inventory, and B2B Customers from the ERP into Composable Commerce. The middleware layer handles data extraction from the ERP, transformation, and mapping to the Composable Commerce APIs. Key scenarios include:
- Product replication: use the Import API to create product data. Handle prices and stock as separate integrations, as covered in Integrate product data.
- Customer replication (B2C and B2B): use API Extensions to relay the successful customer creation response from the middleware to the frontend synchronously.
- Order creation and replication: use Subscriptions with a message queue and downstream services to push the order payload into the middleware asynchronously.
Outbound data flow (Composable Commerce to ERP)
Outbound replication sends Orders and B2C Customer data from Composable Commerce to the ERP using Subscriptions or middleware polling. A common outbound scenario is:
- Invoice replication (B2B): extract invoice data from the ERP and store it as a Custom Field on the corresponding Order. To make the invoice accessible from the Buyer portal and the Merchant Center, generate a PDF and store it at a URL-accessible location. Use a CDN or file storage service, and reference the URL as a Custom Field.
Choose an integration solution
ERP integrations typically use a middleware layer to bridge the commerce platform and the ERP system, facilitating communication, data mapping, and transformation. When selecting a middleware solution, consider these factors:
- Scalability and performance: can the middleware handle your data volumes and grow with the business?
- Security: does it provide robust security features to protect sensitive data in transit?
- Flexibility: can it integrate with your ERP and other systems as requirements evolve?
- Team skillset: does the required expertise match your team's capabilities?
- Cost: evaluate setup, maintenance, and scalability costs against expected return on investment.
Common middleware categories include:
-
ERP-vendor middleware (for example, SAP Cloud Integration): a centralized solution for linking systems and applications within an existing ERP ecosystem. SAP Cloud Integration provides out-of-the-box data extraction from the ERP. You can create integration flows with data mapping and transformation. Best suited for organizations already using the ERP vendor's middleware.
-
Cloud-based services: an alternative to dedicated middleware is building the integration directly with cloud services from AWS, Google Cloud, or Azure. Use API gateways, serverless functions, and managed message queues to extract and transform ERP data. Integrate the data into Composable Commerce using APIs such as the Import API.
Replicate orders with Connect
Overall, Connect reduces the operational overhead and risk of building, hosting, and maintaining integrations between Composable Commerce and the ERP.
Integration best practices
To ensure a seamless flow of data and maintain the highest standards of security and reliability, prioritize the following:
-
Accurate data mapping and transformation: ensure that data remains consistent and compatible across both systems, preserving its integrity and relevance. Define the source of truth at the attribute level and restrict updates accordingly.
-
Authentication and security: secure data transmission with reliable authentication mechanisms. Adhere to the security best practices of both Composable Commerce and the ERP to maintain data confidentiality.
-
Error handling and logging: develop strong error-handling protocols to manage discrepancies or failures during the integration process. Comprehensive logging provides valuable insights for troubleshooting and enables continuous monitoring.
-
Separate integration processes: handle Products, Prices, Inventory, Customers, and Orders as separate integrations. This allows each process to be optimized independently for its specific latency, volume, and frequency requirements.
SAP ERP integration example
SAP-specific data mapping
SAP ERP systems exchange data using Intermediate Documents (IDOCs). The following table maps SAP data types to Composable Commerce resources:
| SAP data type | IDOC type | Composable Commerce resource |
|---|---|---|
| Products and Material | MATMAS | Product and Product Variant |
| Product Classification | CHRMAS, CLFMAS, CLSMAS | Product Type, Attribute, and Product Variant |
| Prices and Discounts | COND_A | Embedded or Standalone Prices |
| Stock Levels | LOISTD | Inventory |
| Invoices | Invoice IDOCs | Order (via Custom Fields) |
Integration architecture using SAP Cloud Integration
The inbound integration from SAP systems requires additional cloud services to push data synchronously and asynchronously from SAP CI to Composable Commerce. The required cloud services include API Extensions for synchronous customer replication and Subscriptions for asynchronous order replication.
Cloud-based alternative with SAP Gateway
- Expose SAP data over APIs: SAP Gateway provides data endpoints using OData. OData endpoints enable data extraction from SAP systems to cloud-based services or storage solutions like Amazon S3 or Azure Data Lake Storage.
- Map to cloud provider API layers: within the cloud provider's environment, map OData APIs to the provider-specific API layer (such as Azure API Management or Amazon API Gateway), which handles authentication, authorization, and security.
- Transform and integrate data: transform the data from OData XML format to JSON, using cloud functions like AWS Lambdas or GCP Cloud Functions. Integrate the transformed data into Composable Commerce using the Import API. This layer also handles errors, retries, and timeouts.