ml-connector
SAP Business OneTradeshift

SAP Business One and Tradeshift integration

SAP Business One manages financials and procurement for small-to-midsize manufacturing and distribution companies. Tradeshift connects you to a B2B network where suppliers send invoices electronically. Integrating the two keeps your purchase orders and supplier invoices synchronized across both systems without manual re-entry. New POs created in SAP Business One flow to Tradeshift so suppliers see what you ordered, and inbound supplier invoices from Tradeshift land in SAP Business One as vendor bills ready to match and pay.

How SAP Business One works

SAP Business One is an on-premise ERP deployed on a customer-specific Service Layer instance at a unique base URL and port (typically port 50000 or 50001). It authenticates with a session token obtained via POST /Login that returns a B1SESSION cookie, which expires after 30 minutes of inactivity and must be refreshed on a -5002 error code. SAP Business One exposes business documents via OData v4 REST, including purchase orders, purchase invoices, incoming payments, chart of accounts, and profit centers. Webhooks are supported in v10.0 FP 2602 and later if the customer enables the Webhook Messenger Service, but polling is the default because not all instances have webhooks active. Pagination defaults to 20 records per request and is controlled by $top/$skip parameters. OData v3 is deprecated in favor of v4. Customers often use self-signed TLS certificates on their instances.

How Tradeshift works

Tradeshift is a cloud platform accessed at https://api.tradeshift.com/tradeshift/rest/external/ for production or the sandbox environment. It authenticates via OAuth 1.0a server-to-server with consumer key, consumer secret, token, and token secret, and all requests require the X-Tradeshift-TenantId header. Tradeshift accepts invoices, purchase orders, credit notes, receipts, and other business documents in REST JSON format or as UBL 2.0 and 2.2 XML. Documents are identified by documentProfileId, and the platform has no native GL account or dimension API; financial dimensions are embedded within UBL line items. Polling via GET documents/v2/ with changedAfter timestamp filtering is the primary integration pattern. Tradeshift offers an optional event stream API using protobuf for plugins, but it requires app registration and custom client code.

What moves between them

The main flow runs from SAP Business One outbound to Tradeshift. Purchase orders created in SAP Business One are transformed to Tradeshift PO documents and posted to the network so suppliers see commitment. Purchase invoices from Tradeshift are polled on a schedule and posted into SAP Business One as incoming vendor bills. Inbound remittance advice and payment notifications from Tradeshift are mapped to SAP Business One incoming payment records. The flow is scheduled to run after PO creation and before invoice receipt, typically nightly or on-demand per customer procurement calendar.

How ml-connector handles it

ml-connector maintains a persistent session with SAP Business One and caches the session token to avoid the 5-second cold-start overhead of logging in on each request. The session is refreshed automatically when the token expires (30-minute inactivity timeout or a -5002 error). OAuth 1.0a credentials for Tradeshift are stored encrypted and used on every request along with the required X-Tradeshift-TenantId header. SAP Business One documents are fetched using OData $filter with UpdateDate to detect changes since the last run, then transformed from OData JSON to UBL 2.0 XML for posting to Tradeshift. Inbound Tradeshift documents are fetched via changedAfter timestamp, converted back to OData format, and posted to SAP Business One as purchase invoices or incoming payment records. Because SAP Business One check for duplicates uses DocNum rather than idempotency keys, ml-connector deduplicates on re-entry by querying for existing DocNum in the same run. Rate limits on both sides are handled with exponential backoff. Every record carries an audit trail and is tagged with the source system identifier (Tradeshift document ID) for traceability.

A real-world example

A mid-sized distribution company buys goods from dozens of suppliers worldwide and manages all purchase orders in SAP Business One. Suppliers send invoices via the Tradeshift network, but the invoices arrived as email attachments that the AP team had to manually re-enter into SAP Business One, matching them to POs by inspection. With SAP Business One and Tradeshift connected, each PO is automatically published to Tradeshift, suppliers see the commitment, and their invoices flow directly into the system as vendor bills linked to the originating PO. The AP team now spends time validating and approving the invoices rather than typing them in, and invoice-to-PO matching happens automatically in both systems.

What you can do

  • Publish SAP Business One purchase orders to Tradeshift so suppliers see the full list of commitments.
  • Receive supplier invoices from Tradeshift and post them into SAP Business One as vendor bills matched to the originating purchase orders.
  • Map Tradeshift remittance advice and payment notifications into SAP Business One incoming payment records.
  • Transform documents between OData v4 JSON and UBL 2.0/2.2 XML formats with profile-aware routing.
  • Cache SAP Business One session tokens, refresh on timeout, manage OAuth 1.0a encryption, and maintain a full audit trail of every document posted.

Questions

How does the integration handle SAP Business One's on-premise deployment and self-signed certificates?
SAP Business One requires each customer to provide their unique Service Layer base URL and port. ml-connector accepts the full instance URL per customer and caches the session token to reduce the overhead of logging in on each request. Self-signed TLS certificates are supported; customers configure trusted roots or skip validation in non-production environments.
What happens when the session token expires or Tradeshift rate limits the connection?
SAP Business One session tokens expire after 30 minutes of inactivity or return a -5002 error code. ml-connector handles this by catching the error and re-authenticating transparently. Tradeshift rate limits return HTTP 429 and are handled with exponential backoff and retry. Both systems are backed by a full audit log so failed requests can be replayed.
How are documents matched between SAP Business One and Tradeshift when they use different formats?
SAP Business One documents are in OData v4 JSON format; Tradeshift uses REST JSON and UBL 2.0/2.2 XML. ml-connector transforms between the two formats and enriches documents with profile identifiers (documentProfileId) so Tradeshift routes them correctly. SAP Business One PO numbers are embedded in the Tradeshift document so inbound invoices can be matched back to the originating order.

Related integrations

Connect SAP Business One and Tradeshift

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

Get started