SAP S/4HANA and ServiceTitan integration
SAP S/4HANA runs finance and procurement for the enterprise. ServiceTitan runs field service operations for HVAC, plumbing, and electrical contractors. Connecting the two keeps procurement and AP synchronized across the two systems. Purchase requisitions raised in ServiceTitan flow into SAP S/4HANA as purchase orders, and vendor invoices in SAP S/4HANA post into ServiceTitan's AP bills so the service business sees its true vendor costs. Vendor master data and cost centers stay aligned in both directions without manual re-entry.
What moves between them
The main flow is from SAP S/4HANA into ServiceTitan. Purchase orders and supplier invoices are read from SAP S/4HANA via OData polling on a schedule you define and written into ServiceTitan as purchase orders and AP bills. Vendor master data, business partners, and cost centers are synced in both directions so that service dispatch and costing in ServiceTitan always reference vendors and cost allocations that exist in SAP S/4HANA. AP bills are read-only in ServiceTitan, so ml-connector does not write financial records back into SAP S/4HANA's GL; instead, the service business reads the bills and posts them into SAP through its normal AP workflow.
How ml-connector handles it
ml-connector stores SAP OAuth credentials and manages the long-lived token per the Communication Arrangement configuration, refreshing before the 12-hour window expires. On the ServiceTitan side, it caches the short-lived 15-minute OAuth token and refreshes it on every call that returns 401, and it includes the required ST-App-Key header on every request. It accepts the tenant-specific URL paths for both systems and validates API entity keys against those instances. Because SAP S/4HANA is pull-only, ml-connector polls purchase orders and invoices on a schedule you define, filtering by LastChangeDateTime to detect changes since the last run. ServiceTitan can also push events to a registered endpoint if webhooks are enabled; ml-connector verifies the HMAC-SHA256 signature on each webhook and deduplicates based on the event ID. Vendor records are synced first so that every purchase order references a vendor that already exists in ServiceTitan. Both systems enforce rate limits and timeouts; ml-connector backs off on HTTP 429 and respects the 100-second server timeout on ServiceTitan requests. Every record carries a full audit trail and can be replayed if a downstream call fails.
A real-world example
A mid-size HVAC and plumbing contractor runs SAP S/4HANA for corporate finance and procurement across multiple branches, and uses ServiceTitan for field dispatch, job costing, and service invoicing. Before integration, the procurement team managed vendor contracts and issued purchase orders in SAP S/4HANA, but the field supervisors in ServiceTitan ordered materials independently or re-entered purchase orders by hand, creating duplicate vendor records and cost tracking gaps. When an invoice arrived from a supplier, the finance team had to track which ServiceTitan jobs had received materials against which SAP purchase orders, slowing reconciliation and creating audit risk. After connecting SAP S/4HANA and ServiceTitan, all purchase orders flow from SAP into ServiceTitan in real time, vendors are synchronized automatically, and incoming supplier invoices post into ServiceTitan's AP bills without manual re-entry. Field supervisors see the full purchase order lifecycle in ServiceTitan, and the finance team closes out AP with data already aligned between the two systems.
What you can do
- Sync purchase orders and purchase requisitions from SAP S/4HANA into ServiceTitan as purchase orders, aligned to vendor master data.
- Read supplier invoices from SAP S/4HANA and write them into ServiceTitan as AP bills, with cost allocations and job references mapped correctly.
- Keep vendor records and master data synchronized in both directions between SAP S/4HANA and ServiceTitan so procurement references consistent vendor IDs.
- Bridge SAP S/4HANA's long-lived OAuth tokens and Communication Arrangement configuration with ServiceTitan's 15-minute token expiry and ST-App-Key header requirements.
- Poll SAP S/4HANA on a schedule you control with LastChangeDateTime filtering, and optionally receive ServiceTitan webhook events with HMAC-SHA256 signature verification.
Questions
- How does ml-connector handle the difference between SAP S/4HANA's long-lived tokens and ServiceTitan's 15-minute token expiry?
- ml-connector caches SAP S/4HANA's long-lived OAuth token (typically 12 hours) per the Communication Arrangement configuration and refreshes it before expiry to avoid repeated token requests. For ServiceTitan, it caches the 15-minute token and refreshes it on every call that returns 401, ensuring fresh credentials without blocking on token latency. Both caches are encrypted and stored per-customer.
- Can SAP S/4HANA push purchase order changes to ServiceTitan in real time?
- SAP S/4HANA has no native webhooks, so ml-connector polls OData APIs on a schedule you define, filtering by LastChangeDateTime to detect changes. ServiceTitan can push events via webhooks if enabled; ml-connector verifies the HMAC-SHA256 signature on each webhook and deduplicates by event ID. The two systems can be configured to sync on different cadences depending on your procurement cycle.
- Are GL accounts and cost centers synced between SAP S/4HANA and ServiceTitan?
- Cost centers and business units are synced in both directions so that purchase orders and AP bills reference cost allocations that exist in SAP S/4HANA. GL accounts are not exposed by ServiceTitan's API; gl mapping is done in the ServiceTitan UI or via native QuickBooks and Intacct connectors, so ml-connector aligns at the cost-center and vendor level only.
Related integrations
More SAP S/4HANA integrations
Other systems that connect to ServiceTitan
Connect SAP S/4HANA and ServiceTitan
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started