ml-connector
Oracle NetSuiteSFTP / Flat Files

Oracle NetSuite and SFTP / Flat Files integration

Oracle NetSuite is a cloud ERP that runs finance, procurement, and order-to-cash processes. SFTP / Flat Files is a common bridge to legacy EDI trading partners and older systems without REST APIs. Connecting NetSuite to SFTP allows you to export vendors and GL accounts to trading partners in EDI or CSV format, and ingest supplier invoices and cost center master data from SFTP-based file feeds. ml-connector handles the very different auth models and turns polling-based file discovery into reliable, audited data movement.

How Oracle NetSuite works

Oracle NetSuite exposes vendors, purchase orders, invoices, GL accounts, employees, departments, and locations through REST APIs at https://<accountId>.suitetalk.api.netsuite.com/services/rest/record/v1/. Authentication uses OAuth 2.0 Client Credentials with an X.509 certificate or Token-Based Authentication (deprecated 2026.1). NetSuite can push real-time record changes via Event Subscriptions for supported types like Sales Orders, Invoices, and Vendor Bills, but events lack HMAC signatures and require IP allowlist protection. For bulk or historical reads, SuiteQL queries are pulled on demand. OAuth tokens are valid 60 minutes with no refresh token in M2M flows, and Sandbox accounts require '_SB' suffix in the account ID.

How SFTP / Flat Files works

SFTP / Flat Files transfers data as structured text files (CSV, X12 EDI, EDIFACT, XML, fixed-width) over SSH File Transfer Protocol on port 22. Each trading partner provides their own host address and folder structure (inbound/, outbound/, processed/, error/, acks/). Authentication uses SSH key pairs (recommended) or username and password, both sent over encrypted SSH channels. SFTP has no push mechanism, so ml-connector must actively poll the inbound folder on a schedule (typically 5 to 60 minutes) to discover new files. X12 and EDIFACT workflows require acknowledgment files (997 or CONTRL) to be written to the acks/ folder after processing.

What moves between them

Data moves in both directions on different cadences. Vendor master records and GL account charts flow from NetSuite to SFTP as periodic CSV or X12 EDI files (daily or weekly), overwriting or appending to a partner-controlled outbound/ folder. Invoice and purchase order data flows the same direction for downstream ERP systems and trading partners. Incoming supplier invoice files (X12 810 format or CSV from SFTP inbound/) are parsed, reconciled against NetSuite vendors by ID or name, and converted to NetSuite vendor bills for processing. Remittance and payment files (X12 820, BAI2) are similarly parsed and matched to NetSuite vendor payments. The flow is not real-time; ml-connector polls SFTP on a schedule you define, discovers new files, processes them, moves processed files to archive folders, and deposits acknowledgments in the acks/ folder.

How ml-connector handles it

ml-connector stores your NetSuite account ID and OAuth certificate encrypted, and refreshes the bearer token every 60 minutes before expiry. It maintains a persistent SFTP connection pool keyed to each partner's host, authenticates with your SSH private key (or username/password if required), and verifies the host key in production to prevent man-in-the-middle attacks. On each poll cycle, it lists the inbound/ folder, detects new files by name and modify time, downloads them to a staging buffer, and parses the format (CSV, X12, EDIFACT, or fixed-width) according to a mapping spec you provide. For incoming invoices, it builds a NetSuite vendor bill payload, looks up the vendor by external ID or name, maps cost centers and GL account codes, and posts the bill via REST. For outgoing vendor or GL exports, it queries NetSuite on schedule, formats the result as X12 or CSV, uploads to the partner's outbound/ folder, and if EDI, deposits a 997 or CONTRL acknowledgment. Retries use exponential backoff; every record carries a full audit trail so failed reconciliations can be replayed after corrections.

A real-world example

A mid-market distributor uses Oracle NetSuite for finance and vendor management but ships orders to a large retail partner that operates a legacy EDI system with only SFTP file delivery. Before the integration, the operations team exported the vendor master from NetSuite weekly as a CSV, manually uploaded it to the partner's SFTP server, then downloaded incoming shipment invoices and re-keyed them into NetSuite. The partner occasionally sent invoices in X12 EDI format, which required a separate EDI translator. With Oracle NetSuite and SFTP / Flat Files connected, vendor changes in NetSuite flow automatically to the partner's SFTP server every night as X12 EDI, complete with X12 997 acknowledgments. Incoming invoices are pulled on a 4-hour cycle, parsed from EDI or CSV, and posted directly to NetSuite as draft bills waiting for approval. The manual upload and re-keying steps are gone, and invoice reconciliation starts with all supplier invoices already in the system.

What you can do

  • Export NetSuite vendor and GL account records to SFTP as CSV, X12 EDI, or EDIFACT files on a schedule you control.
  • Ingest supplier invoices from SFTP (X12 810, CSV) and create NetSuite vendor bills matched to the correct vendor and cost center.
  • Authenticate NetSuite with OAuth 2.0 certificate credentials and SFTP with SSH key or password, storing both encrypted.
  • Poll SFTP inbound folders on a configurable schedule, parse files, reconcile records, and produce EDI acknowledgments.
  • Maintain full audit trail and replay failed reconciliations after corrections.

Questions

How does ml-connector handle NetSuite's 60-minute OAuth token expiry?
ml-connector tracks the token grant time and refreshes the bearer token every 55 minutes, well before the 60-minute expiry. The refresh request uses the same certificate credentials, so no manual intervention is needed. If a call receives a 401, the token is refreshed immediately and the call is retried.
What file formats does SFTP / Flat Files support?
ml-connector handles CSV, X12 EDI, EDIFACT, XML, and fixed-width text files. The format and column layout are specified in a per-partner mapping document you provide. For EDI, ml-connector produces X12 997 or EDIFACT CONTRL acknowledgments and deposits them in the acks/ folder after processing each inbound file.
How are vendors matched between SFTP files and Oracle NetSuite?
Vendors are matched by external ID if present in the file, or by name if IDs are not available. If a match is not found, the record is flagged in the audit log and requires manual review before it can be posted to NetSuite.

Related integrations

Connect Oracle NetSuite and SFTP / Flat Files

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

Get started