Integrate ERP

Ask about this Page
Copy for LLM
View as Markdown

Design and implement an ERP integration for order processing, customer replication, and data synchronization with Composable Commerce.

Learn more about integrations in our self-paced Integration patterns module.

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 domainData flow directionComposable Commerce resourceIntegration method
Products and materialERP → Composable CommerceProduct and Product VariantAsynchronous: batch and delta
Product classificationERP → Composable CommerceProduct Type, Attribute, and Product VariantAsynchronous: batch and delta
Prices and discountsERP → Composable CommerceEmbedded or Standalone PricesAsynchronous: batch and delta
B2C CustomerComposable Commerce → ERPCustomer profiles and transaction historiesAsynchronous
B2B CustomerERP → Composable CommerceBusiness Units and AssociatesAsynchronous: batch and delta
B2B CustomerComposable Commerce → ERPAssociates → AccountsAsynchronous
Stock levelsERP → Composable CommerceInventoryAsynchronous: batch and delta
OrdersComposable Commerce → ERPOrders → Sales OrdersAsynchronous
InvoicesERP → Composable CommerceOrder (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:

Replicate orders with Connect

Connect can host the building blocks of your ERP integration, including API Extensions, jobs, and event listeners. You don't need to provision infrastructure or maintain CI/CD processes.
Consider how Connect simplifies order replication. Once an Order is created in Composable Commerce, an OrderCreated Message is sent to a designated event listener.
Without Connect, you would need to provision the event listener manually. This includes setting up a GCP topic and subscription, a Cloud Function, and a Subscription resource in Composable Commerce.
With Connect, you use event type Connectors. By specifying the queue name and its properties, Connect handles all the infrastructure setup. You focus on handling event logic and data mapping.

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

This section provides SAP-specific guidance for organizations integrating Composable Commerce with SAP S/4HANA or other SAP ERP systems. If your ERP is not SAP-based, the general patterns described above still apply. Substitute the middleware and data formats relevant to your ERP.

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 typeIDOC typeComposable Commerce resource
Products and MaterialMATMASProduct and Product Variant
Product ClassificationCHRMAS, CLFMAS, CLSMASProduct Type, Attribute, and Product Variant
Prices and DiscountsCOND_AEmbedded or Standalone Prices
Stock LevelsLOISTDInventory
InvoicesInvoice IDOCsOrder (via Custom Fields)

Integration architecture using SAP Cloud Integration

SAP ERP data flow diagram
SAP Cloud Integration (SAP CI) has out-of-the-box capabilities to extract data from SAP ERP. To enable replication to the Composable Commerce APIs, create specific integration flows. For example, for the Inbound Material Replication Integration Flow, use the Product Import API to create product data without including price or stock information, which are handled separately.

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

  1. 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.
  2. 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.
  3. 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.