ml-connector
SAP S/4HANAUPS

SAP S/4HANA and UPS integration

SAP S/4HANA runs your procurement, finance, and logistics. UPS handles your shipments. Connecting them keeps your purchase orders, goods receipts, and shipping status in one view. When a purchase order is approved in SAP S/4HANA, ml-connector creates a UPS shipment and tracks it back into your goods receipt process. Inbound supplier deliveries flow the same way, and the receiving team always knows where the shipment stands without leaving SAP S/4HANA.

How SAP S/4HANA works

SAP S/4HANA exposes suppliers, purchase orders, purchase requisitions, supplier invoices, goods receipts, GL accounts, and cost centers through OData V2 and OData V4 REST APIs. Cloud editions authenticate with OAuth 2.0 Client Credentials against tenant-specific token endpoints, while on-premise editions may use Basic Authentication. SAP does not offer native webhooks, so purchase orders and goods receipts are read by polling with timestamp-based filtering or delta tokens. GL Account and Cost Center data are read-only in SAP S/4HANA and maintained through change management processes.

How UPS works

UPS exposes shipments, tracking events, address validation, and pickup scheduling through REST JSON APIs authenticated with OAuth 2.0 Client Credentials. The account number can be passed as an optional x-merchant-id header. Tokens are short-lived, approximately 4 hours, and there is a daily limit of approximately 250 token requests per day. UPS provides real-time tracking through Track Alert subscriptions and polling through the Quantum View feed, though subscriptions expire after 14 days and must be renewed. UPS has no billing or invoice download API.

What moves between them

The main flow runs from SAP S/4HANA into UPS. When a purchase order reaches a confirmed status or when goods are ready to ship, ml-connector reads the purchase order line items and delivery addresses from SAP S/4HANA and creates a UPS shipment. Tracking events from UPS flow back into SAP S/4HANA as goods receipt confirmations and shipping status updates, tied to the original purchase order so receiving and procurement teams see a complete shipment history. Reference data such as supplier addresses are validated against UPS address validation APIs to prevent shipment failures downstream.

How ml-connector handles it

ml-connector stores SAP S/4HANA OAuth credentials and refreshes the token before the 12-hour expiry window, and stores UPS OAuth credentials with the optional account number header. On the SAP side, it polls purchase orders and goods receipt tables on a schedule tied to your procurement processes, using timestamp-based filters to retrieve only changed records. On the UPS side, ml-connector presents the OAuth token on each request and handles the 4-hour token expiry, backing off if UPS returns a 429 rate limit response per gateway node. Addresses from SAP S/4HANA are validated through UPS address validation before shipment creation to prevent failures, and returned tracking events are mapped back to SAP S/4HANA goods receipt records so the receiving team sees the latest status without polling UPS directly. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized manufacturing distributor runs SAP S/4HANA for procurement and finance and uses UPS as the primary carrier for supplier deliveries and customer shipments. Before the integration, the logistics team managed shipments outside SAP S/4HANA, printing bills of lading manually and checking UPS tracking in a separate browser tab, then updating receiving records in SAP by hand. Month-end reconciliation required cross-referencing purchase orders against UPS tracking reports to verify what had arrived. With SAP S/4HANA and UPS connected, each approved purchase order automatically creates a UPS shipment, tracking updates flow into SAP S/4HANA as they occur, and goods receipts match the shipment status. The receiving process is streamlined, and month-end close is faster because inventory and procurement records already reflect actual shipment status.

What you can do

  • Create UPS shipments from approved purchase orders in SAP S/4HANA, including validation of supplier delivery addresses.
  • Sync inbound UPS tracking events back into SAP S/4HANA goods receipt records so receiving teams see live shipment status without leaving SAP.
  • Manage OAuth 2.0 token refresh on both sides to prevent authentication failures due to token expiry.
  • Map purchase order line items to UPS shipment line items and track each item through receipt in SAP S/4HANA.
  • Validate all supplier addresses through UPS address validation APIs before shipment creation to prevent downstream delivery failures.

Questions

Which direction does data move between SAP S/4HANA and UPS?
The main flow is SAP S/4HANA into UPS. Purchase orders and delivery addresses flow out to create UPS shipments, while tracking events and shipment status flow back into SAP S/4HANA goods receipt records. Supplier addresses are validated in both directions to ensure shipments are created with valid addresses.
Does ml-connector handle OAuth token refresh on both sides?
Yes. SAP S/4HANA tokens are typically 12 hours and are refreshed before expiry. UPS tokens are approximately 4 hours and are also refreshed proactively. ml-connector tracks token lifetimes and refreshes on a schedule so neither side experiences authentication failures due to expiry.
What happens if a UPS address validation fails before shipment creation?
ml-connector validates all supplier addresses through UPS address validation APIs before attempting to create a shipment. If validation fails, the record is held in the audit log and flagged for manual review so the address can be corrected in SAP S/4HANA before the shipment is created. This prevents shipment failures downstream and keeps your fulfillment pipeline clean.

Related integrations

Connect SAP S/4HANA and UPS

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

Get started