ml-connector
Sage X3Tradeshift

Sage X3 and Tradeshift integration

Sage X3 runs manufacturing, procurement, and finance for mid-market companies. Tradeshift networks buyers and suppliers to exchange business documents electronically. Connecting them keeps your purchase orders and supplier invoices synchronized across both systems without manual re-entry. New purchase orders in Sage X3 notify suppliers on Tradeshift, and invoice receipts flow back to reconcile Sage X3 records, speeding up AP and buyer-supplier collaboration.

How Sage X3 works

Sage X3 is available on-premise or as a cloud SaaS product, exposing suppliers, customers, purchase orders, supplier invoices, sales invoices, GL accounts, and GL entries through REST (api1) with HTTP Basic Authentication or GraphQL (Xtrem) with OAuth2 client credentials via Connected Application. Sage X3 does not support outbound webhooks or push notifications, so records are read by polling with delta detection using updatedDate and modifiedDateTime fields. Access tokens expire in 5 minutes and must be refreshed using a 30-day refresh token. The X3 server URL, port, and folder are customer-specific with no central tenant registry. The REST api1 path has a default page size of 20 records, and entity class names must be looked up in the X3 metadata browser.

How Tradeshift works

Tradeshift is a cloud-based B2B network for electronic document exchange, reachable via REST HTTPS at https://api.tradeshift.com/tradeshift/rest/external/ in production or the sandbox environment. It authenticates with OAuth 1.0a two-legged server-to-server using consumer_key, consumer_secret, token, and token_secret, with all calls requiring the X-Tradeshift-TenantId header. Business documents are formatted in UBL 2.0/2.2 XML, identified by documentProfileId. Tradeshift supports polling via GET documents/v2/ with a changedAfter timestamp filter, and optionally provides a continuous event stream for registered plugins. Tradeshift has no native GL account or dimension API, so those fields are embedded in UBL line items.

What moves between them

The main flow is Sage X3 to Tradeshift. ml-connector polls Sage X3 for new and modified purchase orders and supplier invoices using the REST api1 delta detection. It maps each purchase order to a UBL Purchase Order document and supplier invoices to UBL Invoice documents, then posts them to Tradeshift under the registered tenant. Supplier information and invoice receipt confirmations are read from Tradeshift and written back to Sage X3 to update supplier records and receipt status. The sync runs on a schedule you define, typically once per business day or more frequently during peak procurement cycles.

How ml-connector handles it

ml-connector stores Sage X3 credentials (server URL, folder, OAuth client credentials or Basic Auth username/password) encrypted and manages the 5-minute token expiry by refreshing before each poll. It uses the REST api1 updatedDate fields to retrieve only changed records since the last run, paginating through results with the count parameter. For Tradeshift, ml-connector constructs OAuth 1.0a signatures for each call using the stored consumer and token secrets, includes the X-Tradeshift-TenantId header, and maps Sage X3 purchase order and invoice fields to UBL 2.0 XML line items. Supplier master data is retrieved from Sage X3 and matched to Tradeshift company profiles by business registration number or name. Because both systems are pull-based, ml-connector handles retries on rate limits and transient failures, tracks which documents have been sent to avoid duplicates, and maintains a full audit trail of every document transformation and API call for troubleshooting.

A real-world example

A mid-market industrial distributor uses Sage X3 on-premise for finance, procurement, and inventory across three regional warehouses. They send 500 to 1,000 purchase orders per month to 80 supplier companies across their Tradeshift network. Before the integration, the purchasing team created purchase orders in Sage X3, then logged into Tradeshift separately to notify each supplier electronically, and later manually marked invoices as received in Sage X3 when they arrived in Tradeshift. With Sage X3 and Tradeshift connected, each purchase order is automatically notified to the supplier on Tradeshift, and supplier invoices and receipts flow back to Sage X3 without manual steps. The purchasing team eliminates duplicate data entry, suppliers receive notifications faster, and the AP team can reconcile invoices against receipts in a single system.

What you can do

  • Sync purchase orders from Sage X3 to Tradeshift as UBL 2.0 XML documents and notify suppliers electronically.
  • Map supplier invoices from Tradeshift back to Sage X3 with receipt status and line-item details.
  • Handle Sage X3 REST api1 polling with delta detection using updatedDate fields and automatic token refresh.
  • Construct OAuth 1.0a signatures for Tradeshift API calls and manage the X-Tradeshift-TenantId header on every request.
  • Maintain a full audit trail of every document sent and received, with retries and replay on failure.

Questions

Which direction does data move between Sage X3 and Tradeshift?
Purchase orders and supplier master data move from Sage X3 to Tradeshift. Supplier invoices, receipts, and dispatch advice flow from Tradeshift back to Sage X3 to update invoice status and line-item receipts. The sync is bidirectional, with Sage X3 as the source of truth for purchase orders and Tradeshift as the source for supplier-initiated documents.
How does ml-connector handle Sage X3 token expiry and Tradeshift OAuth 1.0a?
Sage X3 access tokens expire in 5 minutes, so ml-connector refreshes the token before each poll cycle using the 30-day refresh token stored encrypted. For Tradeshift, ml-connector calculates the OAuth 1.0a signature for each request using the stored consumer and token secrets, includes the X-Tradeshift-TenantId header, and constructs UBL documents with the required documentProfileId parameter.
Does ml-connector support Sage X3 GraphQL or REST api1?
ml-connector supports the REST api1 endpoint because it is available on Sage X3 V6 and later, covers procurement entities directly, and works with HTTP Basic Authentication or OAuth2 Connected Application credentials. GraphQL (Xtrem) is supported for V12 and later if you prefer that transport.

Related integrations

Connect Sage X3 and Tradeshift

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

Get started