ml-connector
Sage 50Tradeshift

Sage 50 and Tradeshift integration

Sage 50 runs accounting on the desktop; Tradeshift runs procurement on the B2B network. Connecting them automates the movement of invoices and purchase orders between your accounting system and your supplier network. Invoices created in Sage 50 can be published to Tradeshift suppliers automatically, and purchase orders received from Tradeshift partners flow back into Sage 50 without manual re-entry. ml-connector handles the different integration surfaces and document formats on each side.

How Sage 50 works

Sage 50 is a Windows desktop accounting application sold in US and UK editions. The US edition exposes data through a .NET SDK and legacy COM/ODBC layer; the UK edition uses Sage Data Objects (SDO) COM/ActiveX DLLs. Both provide access to vendors, customers, purchase invoices, sales invoices, purchase orders, and general journal records through Windows-local interfaces. Authentication is username and password against the Sage 50 user database; an integration user must have exclusive access to the company data files on the Windows machine. Sage 50 has no webhooks or remote API, so data is read by polling transaction LastModifiedDate or date-range audit trails.

How Tradeshift works

Tradeshift exposes invoices, purchase orders, credit notes, and procurement documents through a REST API that accepts both JSON and UBL 2.0/2.2 XML. The platform authenticates with OAuth 1.0a (two-legged for server-to-server integration) and requires the X-Tradeshift-TenantId header on every call. Documents are identified by UBL document profile ID and can be queried using changedAfter timestamp filtering for polling-based sync. Tradeshift also supports an optional event stream API for registered plugins, but traditional outbound webhooks are not available. Sandbox and production environments use separate base URLs.

What moves between them

Purchase invoices created in Sage 50 flow to Tradeshift, where they are converted to UBL 2.0 XML format and posted to the supplier network for visibility and payment collaboration. Purchase orders received from Tradeshift partners are read periodically and written into Sage 50 as purchase orders with matched vendors and line items. The sync runs on a schedule decoupled from user activity, since Sage 50 is polling-only. Vendor master data can be synced in both directions to keep supplier names and details aligned.

How ml-connector handles it

ml-connector runs as a Windows process with local access to the Sage 50 data files, using either the .NET SDK (US edition) or SDO COM layer (UK edition) to read invoices and orders. It maintains an OAuth 1.0a token pair for Tradeshift and includes the tenant ID on every request. Purchase invoices are read from Sage 50 by date range, converted to UBL 2.0 XML with vendor DUNS or name matching, and posted to Tradeshift. Purchase orders are fetched from Tradeshift using changedAfter filtering, parsed from UBL XML, and written into Sage 50 with the matched vendor and line items. The integration user must have exclusive access to Sage 50 (no concurrent interactive login), and the Windows machine must remain online for polling. Vendor reconciliation ensures Sage 50 vendors match Tradeshift company profiles before invoices are sent. Token refresh is automatic before expiry, and failed writes are retried with exponential backoff.

A real-world example

A mid-sized distributor uses Sage 50 for accounting on a Windows workstation and participates in a B2B network via Tradeshift to exchange invoices and purchase orders with 50+ supplier partners. Before the integration, the accounts payable team exported purchase invoices from Sage 50 monthly and manually uploaded them to Tradeshift so partners could see what was owed, then downloaded purchase orders from Tradeshift and re-entered them into Sage 50 line by line. The manual steps consumed 2-3 days of AP time each month and introduced data entry errors. With Sage 50 and Tradeshift connected, every invoice posted to Sage 50 is automatically published to the network within minutes, and inbound purchase orders from suppliers appear in Sage 50 with vendor and line detail pre-filled, cutting AP processing time in half and eliminating re-entry errors.

What you can do

  • Publish purchase invoices from Sage 50 to Tradeshift in UBL 2.0 XML format for supplier visibility and payment collaboration.
  • Receive purchase orders from Tradeshift and write them into Sage 50 with matched vendors and line item detail.
  • Reconcile vendor master data between Sage 50 and Tradeshift to ensure invoices are routed to the correct supplier partners.
  • Handle exclusive Windows SDK session access to Sage 50 and manage OAuth 1.0a token refresh for Tradeshift automatically.
  • Poll both systems on a schedule with retry and audit trail support for failed records.

Questions

Does ml-connector require a Windows machine to run?
Yes. Sage 50 is a Windows desktop application with no cloud or remote API, so ml-connector must run as a process on a Windows machine with local access to the Sage 50 company data files. The integration user must have exclusive access to those files; concurrent interactive login into Sage 50 will break the SDK session.
What document format does ml-connector use to send invoices to Tradeshift?
ml-connector converts Sage 50 purchase invoices to UBL 2.0 XML format and posts them to Tradeshift using the REST API with OAuth 1.0a credentials. Tradeshift handles validation of the UBL structure and document profile ID, and supplier partners receive the invoice through the B2B network.
Can ml-connector sync purchase orders from Tradeshift back to Sage 50?
Yes. ml-connector polls Tradeshift for new and updated purchase orders using changedAfter timestamp filtering, parses the UBL 2.0 XML, and writes the orders into Sage 50 with the matched vendor and line items. Vendor master data must be reconciled first to ensure orders are routed to the correct supplier in Sage 50.

Related integrations

Connect Sage 50 and Tradeshift

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

Get started