ml-connector
SAP S/4HANABigCommerce

SAP S/4HANA and BigCommerce integration

SAP S/4HANA runs finance, accounting, and the general ledger. BigCommerce runs the online storefront, its orders, and its payments. Connecting the two means web orders, the payments captured against them, and refunds post into SAP S/4HANA as accounting documents without re-keying, and the customer master stays in agreement. ml-connector handles the very different APIs on each side and moves the data on a schedule you control. Because BigCommerce has no chart of accounts, the general ledger stays in SAP S/4HANA where it belongs.

How SAP S/4HANA works

SAP S/4HANA Cloud exposes business partners and customers, supplier invoices, purchase orders, GL accounts, cost centers, and journal entry posting through OData V2 and V4 services on a tenant-specific URL such as https://my123456-api.s4hana.ondemand.com. Production calls use OAuth 2.0 client credentials, with a short-lived bearer token requested from a tenant token endpoint, and an SAP admin must first set up a Communication Arrangement before any service answers. Every write requires an X-CSRF-Token fetched from a prior GET, and GL accounts are read-only master data. SAP S/4HANA has no native outbound webhook to an external URL, so records are read by polling with $filter on LastChangeDateTime.

How BigCommerce works

BigCommerce exposes orders through its REST Management v2 API and order transactions and refunds through v3, plus customers and catalog products, all scoped by a store hash in the base URL. It authenticates with a static access token passed in the X-Auth-Token header, with no Bearer prefix, generated once when a store-level API account is created. BigCommerce pushes webhooks for order, customer, and product events, signed with HMAC-SHA256 over the raw body using the client secret and delivered in the X-BC-Signature header. Webhook payloads are stubs that carry only a resource type and id, so the full record must be fetched from the REST API. BigCommerce has no GL accounts, vendors, or purchase orders.

What moves between them

The main flow runs from BigCommerce into SAP S/4HANA. ml-connector reads BigCommerce orders, the transactions captured against them, and refunds, and posts them into SAP S/4HANA as journal entries mapped to the matching GL accounts and cost centers. Customer records flow the same direction so the SAP business partner master reflects storefront buyers, created or updated under the customer role. Product and SKU references are aligned so each order line resolves to the right SAP account assignment. GL accounts are read-only in SAP and absent in BigCommerce, so ml-connector reads the chart of accounts from SAP to validate postings and never writes ledger structure back to the store.

How ml-connector handles it

ml-connector stores both credential sets encrypted. On the BigCommerce side it sends the static access token in the X-Auth-Token header on every call and scopes each request to the store hash. On the SAP side it requests and caches the OAuth 2.0 client credentials bearer token, refreshing it before its roughly 12-hour expiry, and accepts the full tenant API base URL per customer since SAP publishes no shared hostname. Because SAP requires a CSRF token on every write, ml-connector first issues a GET with X-CSRF-Token Fetch, keeps the returned token and session cookies, and includes them on each journal entry or business partner post; if a write returns 403 it re-fetches the token and retries. GL accounts and cost centers are read from SAP first, so every posted line references an account and dimension that already exist. Where the BigCommerce store has webhooks enabled, an order or customer event triggers the sync, but since the payload is only a type and id, ml-connector immediately calls GET on the v2 order or v3 transactions endpoint to fetch the full record before posting. A scheduled poll using LastChangeDateTime and date filters backfills anything a webhook missed, because SAP itself does not push events. SAP's own FI logic rejects duplicate postings, and ml-connector dedupes on the BigCommerce order id and a BullMQ jobId, so a re-read order is not double-booked. Refunds are processed one at a time per order, matching the BigCommerce constraint, and every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized consumer goods brand with about 200 employees runs SAP S/4HANA Cloud for finance and accounting and sells direct to shoppers through a BigCommerce storefront on the Pro plan. Before the integration, an accountant exported the daily order and payment report from BigCommerce and keyed the sales, tax, and shipping totals into SAP by hand, which meant revenue posted a day or two late, refunds were sometimes missed, and the storefront totals never tied out to the ledger at month-end. With SAP S/4HANA and BigCommerce connected, each settled order and its captured payment post into SAP as a journal entry within the polling window, allocated to the correct GL accounts and cost centers, and refunds post as offsetting entries. Revenue lands in the ledger the same day, the missed refunds are gone, and the sales accounts reconcile without a month-end scramble.

What you can do

  • Post BigCommerce orders and captured payments into SAP S/4HANA as journal entries against the correct GL accounts.
  • Post BigCommerce refunds into SAP S/4HANA as offsetting entries, processed one at a time per order.
  • Keep the SAP S/4HANA business partner master aligned with BigCommerce storefront customers.
  • Bridge the BigCommerce X-Auth-Token and the SAP OAuth 2.0 tenant login, fetching the X-CSRF-Token before every write.
  • Trigger on BigCommerce webhooks where enabled and poll on a schedule, with jobId dedup, retries, and a full audit trail.

Questions

Which direction does data move between SAP S/4HANA and BigCommerce?
The main flow is BigCommerce into SAP S/4HANA. Orders, captured payments, refunds, and customer records move from BigCommerce into SAP, while GL accounts and cost centers are read from SAP to validate each posting. BigCommerce has no chart of accounts, so the general ledger stays in SAP and ml-connector never writes ledger structure back to the store.
Does BigCommerce push orders, or does ml-connector poll for them?
Both are supported. Where the store has webhooks enabled, an order or customer event triggers the sync, but the payload carries only a resource type and id, so ml-connector immediately calls the BigCommerce REST API to fetch the full record. SAP S/4HANA cannot push events, so a scheduled poll filtered on LastChangeDateTime backfills anything a webhook missed.
How does the integration handle SAP S/4HANA's CSRF token requirement on writes?
SAP S/4HANA requires an X-CSRF-Token on every write, fetched from a prior GET that also returns session cookies. ml-connector issues that fetch, keeps the token and cookies, and includes them on each journal entry or business partner post. If a write returns HTTP 403 because the token has expired with the session, it re-fetches a fresh token and retries.

Related integrations

Connect SAP S/4HANA and BigCommerce

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started