SAP S/4HANA and Stripe integration
SAP S/4HANA is the source of truth for your finance and procurement records. Stripe handles payment collection, subscriptions, and revenue recognition. Connecting them keeps your billing system synchronized with your ERP, so every invoice created in SAP flows into Stripe for payment processing, and every payment received in Stripe can be reconciled back to the GL. ml-connector handles the different authentication models and moves invoices, customers, and line items on a schedule you control.
What moves between them
The flow runs from SAP S/4HANA into Stripe. ml-connector reads customer master records from SAP Business Partner entities and publishes them into Stripe as customer objects. SAP supplier invoices are read on a schedule and posted into Stripe as invoice records, with line items mapped to Stripe invoice items. GL line items from the receivables accounts are queried to track payment status and reconciliation state. No data writes back to SAP; the flow is pull-only from the ERP into the payments system.
How ml-connector handles it
ml-connector stores the SAP OAuth 2.0 credentials and refreshes the bearer token every 11 hours to avoid expiry-driven failures. Stripe API Key is stored encrypted and sent with every request via HTTP Basic Auth. Because SAP has no webhooks, ml-connector polls the OData endpoints with a LastChangeDateTime filter to fetch only modified records since the last run. Customer synchronization reads A_BusinessPartner and A_SupplierCompany to build the Stripe customer objects; supplier invoices map A_SupplierInvoice and A_SupplierInvoiceItemGLAcct to invoice items, using cost centers to tag each line item. GL Account Line Items are queried to track posting dates and amounts for reconciliation. On the Stripe side, ml-connector handles the fact that resources are updated via POST, not PATCH, by reading the current customer or invoice state before constructing the update payload. Polling failures are retried with exponential backoff, and every record carries an audit trail.
A real-world example
A mid-sized technology company manufactures software appliances and ships them worldwide. SAP S/4HANA runs finance and order fulfillment; Stripe handles subscription billing for SaaS customers. Before the integration, the finance team exported monthly invoices from SAP and manually created entries in Stripe, a process that delayed payment processing and created reconciliation gaps. With SAP S/4HANA and Stripe connected, invoices for SaaS subscriptions flow into Stripe automatically every day, customers are kept in sync so billing names and contact details always match, and payment receipts in Stripe are tagged with the original SAP GL posting for month-end close.
What you can do
- Sync customer master data from SAP S/4HANA Business Partner records into Stripe as customer objects.
- Read supplier invoices from SAP and create Stripe invoice records with line items mapped to cost centers.
- Track GL line item postings to reconcile invoice status and payment receipts in Stripe.
- Authenticate SAP S/4HANA via OAuth 2.0 with token refresh and Stripe via API Key, handling short-lived token expiry.
- Poll SAP OData endpoints on a schedule using LastChangeDateTime filters to fetch only modified records.
Questions
- Does the integration work with both SAP S/4HANA Cloud and On-Premise deployments?
- Yes. Both modes expose the same OData APIs and OAuth 2.0 authentication. On-Premise requires the sap-client query parameter; Cloud Public does not. The SAP admin must create a Communication System, User, and Arrangement before API access is available, and must provide the token endpoint URL copied from the Communication Arrangement, not constructed manually.
- Why does ml-connector poll SAP instead of waiting for a webhook?
- SAP S/4HANA has no native webhook system for cloud connectors. ml-connector polls the OData endpoints with a LastChangeDateTime filter to fetch only records modified since the last run. SAP Event Mesh can provide event-driven push, but that requires SAP BTP and additional configuration not covered by this integration.
- How does the integration handle SAP token expiry and Stripe's POST-only updates?
- ml-connector caches the SAP OAuth 2.0 token and refreshes it every 11 hours, 1 hour before the typical 12-hour expiry. On the Stripe side, the integration reads the current customer or invoice state before each update and constructs the POST request with the full new state, since Stripe resources are updated via POST not PATCH.
Related integrations
More SAP S/4HANA integrations
Other systems that connect to Stripe
Connect SAP S/4HANA and Stripe
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started