Sage X3 and SFTP / Flat Files integration
Sage X3 handles procurement, inventory, and general ledger for mid-market operations. SFTP / Flat Files moves master data and transactions via structured CSV and EDI files to trading partners and legacy systems. Connecting them keeps vendor data, purchase orders, and AP invoices in sync across your supply chain without manual file movement or re-keying. New suppliers in Sage X3 flow to your SFTP partners, and incoming vendor invoices via EDI are automatically posted to Sage X3's AP ledger.
What moves between them
Purchase orders and supplier master data flow from Sage X3 to SFTP outbound folders as CSV or X12 850 files on a daily or weekly schedule. Vendor invoices and remittance advice arrive via SFTP inbound as X12 810 or EDIFACT INVOIC files, and ml-connector parses them, maps supplier and GL account references to Sage X3, and posts them as AP invoices. GL account and cost center master data is synchronized bidirectionally so invoice allocations land on valid Sage X3 dimensions. Acknowledgments (997 or CONTRL) are deposited in the acks folder after each successful inbound file processing.
How ml-connector handles it
ml-connector stores SFTP SSH credentials encrypted and authenticates with either key pairs or username/password; host key verification prevents man-in-the-middle attacks in production. On the Sage X3 side, ml-connector uses either REST API with HTTP Basic Auth (api1 endpoint) or GraphQL with OAuth2 bearer tokens (Xtrem, V12+), and refreshes tokens when they expire after 5 minutes. Because Sage X3 does not publish webhooks, ml-connector polls suppliers, purchase orders, and GL accounts on a schedule and compares updatedDate and modifiedDateTime to detect changes since the last run. On the SFTP side, it polls the inbound folder every 5 to 60 minutes for new files, parses CSV and EDI formats according to the configured mapping, and uses the file naming convention and folder structure (inbound/, outbound/, processed/, error/, acks/) per partner. Supplier and GL account references in incoming invoices are validated against Sage X3 before posting. If a vendor is missing from Sage X3, the invoice is held in the error folder pending manual creation. File acknowledgments are generated and placed in the acks folder so the trading partner knows the file was received and processed.
A real-world example
A mid-sized distributor runs Sage X3 for procurement, inventory, and AP. Three key suppliers send vendor invoices via X12 EDI over SFTP weekly; two others ship purchase orders to the distributor via the same SFTP server. Before integration, the AP team downloaded files manually, looked up supplier IDs in Sage X3, matched PO numbers, and entered invoices by hand, spending two days every week on data entry and resolving mismatches between Sage X3 supplier numbers and the trading partner's vendor codes. With Sage X3 and SFTP / Flat Files connected, incoming X12 810 invoices are mapped to Sage X3 suppliers and GL accounts automatically, posted as AP invoices, and matched to open POs. Outbound purchase orders export from Sage X3 daily and land on partners' SFTP servers so they see what the distributor needs without a phone call. The manual invoicing process is gone, suppliers get visibility into demand, and the AP team focuses on exceptions.
What you can do
- Export Sage X3 suppliers and purchase orders to SFTP as CSV or X12 850 files on a fixed schedule.
- Import vendor invoices from SFTP as X12 810 or EDIFACT INVOIC files and post them to Sage X3 AP with automatic GL account mapping.
- Keep supplier master data, GL accounts, and cost centers synchronized between Sage X3 and SFTP trading partners.
- Authenticate Sage X3 with either HTTP Basic Auth (REST api1) or OAuth2 (GraphQL), and SFTP with SSH keys or password credentials.
- Poll Sage X3 and SFTP on a schedule, detect changes via updatedDate fields, and generate EDI acknowledgments (X12 997 or EDIFACT CONTRL) after processing inbound files.
Questions
- Which direction does data move between Sage X3 and SFTP / Flat Files?
- Both directions. Sage X3 suppliers, purchase orders, and GL accounts are exported to SFTP outbound folders as CSV or X12 850 files. Vendor invoices and payments arrive from SFTP inbound as X12 810, EDIFACT INVOIC, or CSV files and are posted into Sage X3 AP. GL accounts and cost centers are kept in sync so allocations land on valid dimensions.
- How does ml-connector handle Sage X3 token expiry and SFTP host key verification?
- Sage X3 OAuth2 access tokens expire after 5 minutes, so ml-connector automatically refreshes them using the refresh token (valid 30 days). SFTP host key verification is mandatory in production to prevent man-in-the-middle attacks; ml-connector stores the server public key and validates it on every connection.
- What happens if a supplier or GL account in an incoming SFTP invoice does not exist in Sage X3?
- ml-connector validates supplier and GL account references against Sage X3 before posting an invoice. If a reference is missing, the file is moved to the error folder and an alert is raised so the AP team can manually create the missing master record or adjust the mapping.
Related integrations
More Sage X3 integrations
Other systems that connect to SFTP / Flat Files
Connect Sage X3 and SFTP / Flat Files
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started