SAP S/4HANA and Shopify integration
SAP S/4HANA runs your enterprise resource planning, procurement, and finance. Shopify runs your online store and customer relationships. Connecting the two lets orders placed in Shopify flow into SAP as requisitions and sales orders, keeps customer records aligned between e-commerce and ERP, and eliminates manual order entry and customer setup. Shopify order totals feed into SAP cost allocation, and Shopify customer profiles seed new business partners in your ERP system.
What moves between them
Orders flow from Shopify into SAP S/4HANA. When an order is placed or updated in Shopify, ml-connector receives the webhook, validates the signature, and creates or updates a purchase requisition or sales order in SAP, mapped to the matching customer business partner and GL account. Customer records flow one way: new customers or customer updates in Shopify trigger creation or update of business partners in SAP with the customer's name, address, and contact details. Refunds and cancelled orders update the SAP records accordingly. SAP GL accounts and cost centers are read from SAP and used to allocate Shopify order amounts to the correct financial dimensions during posting.
How ml-connector handles it
ml-connector stores both Shopify and SAP credentials encrypted. Shopify's offline token is sent with each GraphQL query in the Authorization header. For SAP, ml-connector exchanges the Client Credentials for a bearer token at the tenant-specific token endpoint, caches it, and refreshes it before expiry (SAP tokens are short-lived, typically 12 hours). Webhook signatures from Shopify are verified with the client secret before processing. Orders in Shopify are matched to customers; if a customer is new, ml-connector creates a business partner in SAP first, then posts the order as a requisition linked to that partner. Order amounts are allocated to GL accounts and cost centers retrieved from SAP, and if a cost center does not exist in SAP, the record is flagged for manual review. Retries use exponential backoff with jitter. Every transaction carries a full audit trail, and orders can be replayed if an SAP posting fails.
A real-world example
A mid-market online retailer runs Shopify for e-commerce and SAP S/4HANA for back-office finance and procurement. Before the integration, the fulfillment team exported orders from Shopify daily and re-entered them into SAP as purchase requisitions by hand, then chased exceptions when customer names did not match. With SAP and Shopify connected, each order flows into SAP automatically, linked to the customer as a business partner, and allocated to the shipping GL account for cost tracking. New online customers are created as prospects in SAP without manual intervention. The data-entry step is gone, order-to-cash is faster, and customer records stay in sync.
What you can do
- Sync Shopify orders into SAP S/4HANA as purchase requisitions or sales orders, mapped to customer business partners.
- Create and update customer business partners in SAP from Shopify customer records.
- Allocate Shopify order amounts to SAP GL accounts and cost centers for accurate financial posting.
- Authenticate Shopify with OAuth 2.0 offline tokens and SAP with Client Credentials, bridging the two auth models.
- Verify Shopify webhook signatures and replay orders if SAP posting fails, with a full audit trail.
Questions
- Which direction does data flow between Shopify and SAP S/4HANA?
- Orders and customers flow from Shopify into SAP S/4HANA. When an order is placed or updated in Shopify, ml-connector creates or updates a requisition or sales order in SAP linked to the customer as a business partner. Refunds and cancellations update the SAP records. GL accounts and cost centers are read from SAP and used to allocate order amounts to the correct financial dimensions.
- How does ml-connector handle SAP's tenant-specific token endpoint and short token lifetime?
- ml-connector accepts the token endpoint URL and OAuth scope from the SAP Communication Arrangement, not from a shared base URL. It caches the OAuth bearer token after the first exchange and monitors its expiry, refreshing it before it expires (typically 12 hours) so outages do not occur. A failed token refresh halts posting until credentials are verified.
- What happens if a Shopify customer does not already exist as a business partner in SAP?
- ml-connector creates a new business partner in SAP with the customer's name, address, email, and phone number from the Shopify customer record. The order is then posted against that new partner. If required SAP fields are missing from Shopify (such as a tax ID), the record is flagged with a flag for manual review before posting, and the audit trail tracks the reason.
Related integrations
More SAP S/4HANA integrations
Other systems that connect to Shopify
Connect SAP S/4HANA and Shopify
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started