ml-connector
Sage X3Salesforce

Sage X3 and Salesforce integration

Sage X3 runs manufacturing and distribution finance. Salesforce runs sales and customer engagement. Connecting the two keeps your customer records, pricing, and order history aligned across sales and operations. New customers and sales orders in Salesforce sync back into Sage X3 for fulfillment and billing, while Sage X3 purchase orders and supplier invoices feed into Salesforce for procurement visibility. ml-connector handles the authentication and polling differences between the two platforms and moves the data on a schedule you control.

How Sage X3 works

Sage X3 is an on-premise and cloud ERP for mid-market manufacturers and distributors. It exposes customers, suppliers, purchase orders, sales invoices, GL accounts, products, and inventory records through GraphQL (Xtrem API recommended for V12+) and legacy REST endpoints, both secured with OAuth2 client credentials (JWT bearer) or HTTP Basic Authentication. Sage X3 has no native webhooks or event push system, so records are discovered by polling with delta detection using updatedDate and modifiedDateTime fields. Access tokens expire in 5 minutes and must be refreshed from stored refresh tokens (valid 30 days). Server URLs, ports, and folder names are customer-specific with no central registry.

How Salesforce works

Salesforce is a cloud CRM platform exposing Accounts, Contacts, Opportunities, Orders, Invoices, and other objects through REST APIs secured with OAuth2 client credentials. Salesforce can push real-time events via Change Data Capture (CDC) on Account, Contact, Opportunity, Order, and Invoice objects, with 3-day event retention. It also supports polling via datetime-range queries. Tokens expire after 2 hours by default with no refresh tokens in the client credentials flow. All calls route through a customer-specific My Domain URL. Rate limits vary by org and license type but are not published.

What moves between them

The main flow is bidirectional. Customer and supplier records flow from Sage X3 into Salesforce Accounts and related objects on a polling schedule. Sales orders and opportunities in Salesforce sync back to Sage X3 as sales orders for fulfillment. Purchase orders from Sage X3 flow into Salesforce for procurement visibility. Invoices generated in Sage X3 sync to Salesforce Invoice objects linked to the corresponding Accounts. GL account mappings from Sage X3 custom configurations are stored and applied on both sides so financial dimensions align.

How ml-connector handles it

ml-connector stores OAuth2 credentials for both systems encrypted and refreshes Sage X3 tokens every 4 minutes to stay ahead of the 5-minute expiry. It polls Sage X3 via GraphQL on a schedule you set (typically daily or per your sales cycle), using the updatedDate field to find new and changed records since the last poll. Salesforce CDC events are received on a separate listener thread and trigger immediate syncs for Accounts, Orders, and Invoices. When a Salesforce record is created or updated, ml-connector posts it to Sage X3 as a new customer or sales order record, mapping Salesforce fields to X3 custom fields based on your configuration. GL account allocations are validated against Sage X3's per-customer analytical dimension structure before posting. Every record carries a full audit trail and can be replayed if a downstream call fails. Rate limit retries use exponential backoff on both sides.

A real-world example

A mid-sized B2B distributor runs Sage X3 for inventory, procurement, and finance, and uses Salesforce for sales and customer management. Before the integration, the sales team entered orders into Salesforce and emailed them to operations, who re-entered the data into Sage X3 for fulfillment and invoicing. Purchase orders from suppliers were tracked only in Sage X3 and invisible to sales. With Sage X3 and Salesforce connected, sales orders flow automatically from Salesforce to Sage X3 for fulfillment, and Sage X3 customer master records sync into Salesforce so the sales team always sees current pricing, discounts, and payment status. Purchase orders are visible in Salesforce Opportunities, and invoices post into Salesforce automatically after fulfillment, eliminating re-entry and sync delays.

What you can do

  • Sync Sage X3 customers and suppliers into Salesforce Accounts with pricing and discount tiers mapped to custom fields.
  • Flow sales orders from Salesforce back to Sage X3 for fulfillment and billing, with line-item allocation to GL accounts.
  • Mirror Sage X3 purchase orders into Salesforce for procurement visibility and spend analysis.
  • Receive real-time Salesforce CDC events for Accounts and Orders, triggering immediate updates back to Sage X3.
  • Handle Sage X3 token refresh (5-minute expiry), GraphQL polling, and Salesforce OAuth2 client credentials with retries and a full audit trail.

Questions

Which direction does data move between Sage X3 and Salesforce?
The flow is bidirectional. Customers and suppliers flow from Sage X3 into Salesforce Accounts on a polling schedule. Sales orders and customer changes in Salesforce sync back to Sage X3 for fulfillment and billing. Purchase orders from Sage X3 flow into Salesforce for visibility. Invoices are read-only from Sage X3 and sync into Salesforce after fulfillment.
How does ml-connector handle Sage X3's lack of webhooks and the 5-minute token expiry?
ml-connector polls Sage X3 on a schedule you define (typically daily), using the updatedDate field to find changes since the last poll. It refreshes Sage X3 OAuth2 tokens every 4 minutes to avoid expiry during a request. Salesforce CDC events are received separately on a push listener, so Salesforce-to-X3 updates are immediate while X3-to-Salesforce remains polling-based.
How are Sage X3 GL accounts and analytical dimensions handled in Salesforce?
Sage X3 GL account structures and cost allocations are customer-specific and stored in ml-connector's configuration. When a sales order syncs from Salesforce to Sage X3, ml-connector validates the requested GL account and cost center against your Sage X3 setup and applies the correct analytical dimensions before posting. If a dimension is missing or invalid, the record is logged and can be corrected and replayed.

Related integrations

Connect Sage X3 and Salesforce

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

Get started