SAP S/4HANA and Stampli integration
SAP S/4HANA runs your procure-to-pay cycle from purchase orders through invoice receipt and GL posting. Stampli automates the approval and payment steps in between. Connecting SAP S/4HANA to Stampli moves invoices and purchase orders into Stampli's approval workflows automatically, retrieves approved payments, and posts the GL impact back into SAP's ledger without manual re-keying. ml-connector bridges the two systems' completely different authentication and transport models, polls both on a schedule you control, and maintains a full audit trail of every record.
What moves between them
The main flow runs from SAP S/4HANA into Stampli. ml-connector reads supplier invoices, purchase orders, and vendor master records from SAP S/4HANA on a configurable schedule, transforms them into Stampli's CSV format, and uploads them to Stampli's SFTP inbox. Stampli processes invoices through its approval and matching workflows. After approval, ml-connector polls Stampli's outbound SFTP directory for payment execution files and GL posting files, then posts the GL entries back into SAP S/4HANA's journal entry API, keeping the ledger in sync with the approved payments.
How ml-connector handles it
ml-connector manages two completely separate authentication and transport pathways. On the SAP S/4HANA side, it refreshes OAuth2 tokens on a schedule, caches them, and reads supplier invoices and purchase orders from the OData API using LastChangeDateTime filters to capture only new or changed records. It maps SAP cost centers and GL accounts from the read-only reference APIs. On the Stampli side, it stores SFTP credentials encrypted and uploads CSV invoice batches to Stampli's inbound directory. It then polls Stampli's outbound directory on a defined interval to retrieve payment and GL posting files. Every invoice is tagged with the SAP invoice number to ensure approved payments are matched back to the original SAP record when posting GL entries. Because both systems are pull-only (SAP has no outgoing webhooks and Stampli has no API webhooks), ml-connector orchestrates the sync on a schedule you control, typically aligned with your payroll and month-end close calendar.
A real-world example
A mid-sized distributor runs SAP S/4HANA for procurement and finance across three regional warehouses. Invoices arrive at a central AP team, but before Stampli was connected, the AP team manually typed supplier invoices from email and EDI into Stampli, then waited for approval and payment, and finally re-entered the GL posting into SAP by hand. Cycle time was 8 to 12 days, and reconciliation took a full week because payment dates in SAP never matched AP execution dates in Stampli. With SAP S/4HANA and Stampli connected, supplier invoices flow automatically into Stampli from SAP, approved payments flow back and post into SAP's GL in real time, and the AP team focuses only on invoice exceptions and vendor disputes. Month-end close now starts with the AP GL accounts already reconciled.
What you can do
- Read supplier invoices and purchase orders from SAP S/4HANA and upload them to Stampli's SFTP inbox in CSV format for approval and processing.
- Retrieve approved payments and GL posting files from Stampli's outbound SFTP directory and post the GL entries back into SAP S/4HANA's general ledger.
- Maintain a mapping between SAP invoice numbers and Stampli payment records so that GL postings reconcile with source invoices.
- Authenticate SAP S/4HANA with OAuth2 Client Credentials and Stampli with SFTP credentials, managing token refresh and credential encryption separately.
- Poll both systems on a schedule aligned with your payroll and month-end calendar, with retries and a complete audit trail of every invoice and payment record.
Questions
- Which direction does data flow between SAP S/4HANA and Stampli?
- Invoices, purchase orders, and vendor records flow from SAP S/4HANA into Stampli for approval and payment processing. After approval, payments and GL posting files flow from Stampli back into SAP S/4HANA's journal entry API. Cost centers and GL accounts are mapped from SAP but remain read-only in the API.
- How does the integration handle the fact that Stampli does not have a public REST API?
- ml-connector uses Stampli's file-based SFTP integration exclusively. It transforms invoices and POs from SAP's OData format into CSV, uploads them to Stampli's inbound SFTP directory, and polls the outbound directory for payment and GL files on your defined schedule. This avoids the need for a direct Stampli partnership agreement and works within Stampli's current third-party integration model.
- How does the integration track invoices from SAP to approved payments in Stampli?
- Every invoice uploaded to Stampli is tagged with its SAP invoice number in the CSV. When ml-connector retrieves approved payment files from Stampli's outbound directory, it matches payment records back to the original SAP invoice by this tag, ensuring that GL postings are allocated to the correct cost center and GL account in SAP's ledger.
Related integrations
More SAP S/4HANA integrations
Other systems that connect to Stampli
Connect SAP S/4HANA and Stampli
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started