ml-connector
FreshBooksTrueCommerce

FreshBooks and TrueCommerce integration

FreshBooks manages invoicing and accounting for your business. TrueCommerce connects you to trading partners via EDI and supply chain networks. Integrating them keeps your financial records and your trading partner communications in sync: invoices and bills recorded in FreshBooks are automatically formatted as EDI documents and delivered to your trading partners through TrueCommerce, while purchase orders and confirmations from trading partners flow back into FreshBooks as bill records. ml-connector handles the OAuth handoff to FreshBooks, the SFTP or API credentials for TrueCommerce, and the full transformation from accounting entries into EDI X12 format.

How FreshBooks works

FreshBooks exposes clients, invoices, bills, payments, expenses, and chart of accounts through REST APIs at https://api.freshbooks.com, with separate namespaces for accounting and time tracking. Authentication is OAuth 2.0 Authorization Code grant, user-delegated, issued by https://auth.freshbooks.com/oauth/authorize. FreshBooks notifies ml-connector of new and updated invoices and bills through webhooks via POST to a customer-supplied endpoint with HMAC-SHA256 signatures. Webhook delivery ranges from seconds to several minutes and includes event types for invoice.create, invoice.update, bill.create, bill.update, and related business events. FreshBooks also supports polling via REST read on demand.

How TrueCommerce works

TrueCommerce is a managed Value-Added Network (VAN) platform that does not host user data directly but mediates EDI and file exchange with trading partners. It accepts documents via SFTP at integrationftp.truecommerce.com, managed REST API (Exchange API), or local Windows Integration Service with JSON port. Credentials are provisioned by TrueCommerce during account setup: SFTP username and password, API key per merchant, or service account credentials. TrueCommerce translates documents into EDI X12 (850 Purchase Order, 810 Invoice, 856 Advance Ship Notice, 997 Functional Acknowledgment, 820 Remittance Advice, and others) and delivers them to trading partners on a standard EDI network. There is no public developer API or self-serve token generation; all credentials and integration paths are customer-specific.

What moves between them

The primary flow runs from FreshBooks into TrueCommerce. When an invoice is recorded in FreshBooks, ml-connector converts it to an EDI 810 invoice document and posts it to TrueCommerce's SFTP or Exchange API, which TrueCommerce delivers to the designated trading partners. Bills and bill vendors recorded in FreshBooks can similarly flow to TrueCommerce for distribution. The return flow ingests TrueCommerce purchase orders (EDI 850) and advance ship notices (EDI 856) into FreshBooks as bill vendors and bills, so the accounting record stays in sync with supply chain reality. ml-connector polls FreshBooks via webhook or REST for outbound invoices and polls TrueCommerce's SFTP or managed API for inbound EDI documents on a schedule tied to your trading partner deadlines.

How ml-connector handles it

ml-connector stores FreshBooks OAuth credentials encrypted and refreshes the bearer token as needed per the OAuth 2.0 spec. For TrueCommerce, it stores SFTP username and password, or API key, encrypted and uses the appropriate credential type to connect: SFTP login to integrationftp.truecommerce.com port 22, or bearer token to the TrueCommerce Exchange API. When a FreshBooks webhook arrives, ml-connector parses the invoice or bill, maps the line items to the correct customer and product codes in TrueCommerce's namespace, and encodes the full transaction as EDI X12 810 format (or other applicable EDI documents per your configuration). It then uploads the EDI file to TrueCommerce's SFTP inbox or posts it via Exchange API. For inbound documents, ml-connector polls TrueCommerce's SFTP outbox or Exchange API on a schedule, downloads EDI files (850, 856, 997 Functional Acknowledgments), parses them, and upserts bill vendors and bills in FreshBooks. Every exchange carries a full audit trail so you can see which FreshBooks records triggered which TrueCommerce documents and how trading partners acknowledged them. EDI functional acknowledgments (997) are tracked via ISA control numbers for deduplication.

A real-world example

A mid-sized wholesale distributor uses FreshBooks to invoice customers and record supplier bills, and uses TrueCommerce to exchange purchase orders and invoices with retail chain trading partners on the EDI network. Before the integration, the finance team manually extracted invoices from FreshBooks, formatted them into EDI X12 files, and uploaded them to TrueCommerce by SFTP, while also manually importing TrueCommerce EDI purchase order files back into FreshBooks as bills. With FreshBooks and TrueCommerce connected, each customer invoice in FreshBooks automatically arrives at the trading partner as a TrueCommerce EDI message in the correct format, and purchase orders from trading partners are immediately recorded as payable bills in FreshBooks. The time spent on file conversion and manual uploads is eliminated, and the ledger always reflects current trading partner activity.

What you can do

  • Convert FreshBooks invoices to EDI 810 invoice documents and post them to TrueCommerce for transmission to trading partners.
  • Receive TrueCommerce EDI purchase orders (850) and advance ship notices (856) and create corresponding bills and bill vendors in FreshBooks.
  • Authenticate to FreshBooks via OAuth 2.0 and to TrueCommerce via SFTP or managed API credentials, storing all credentials encrypted.
  • Track EDI functional acknowledgments (997) from trading partners using ISA control numbers for deduplication and audit compliance.
  • Maintain a complete audit trail of every FreshBooks record that entered TrueCommerce and every EDI document that returned, with full transformation history for troubleshooting.

Questions

Which direction does data move between FreshBooks and TrueCommerce?
The primary flow is FreshBooks invoices and bills out to TrueCommerce for transmission to trading partners. Inbound, ml-connector receives EDI purchase orders and advance ship notices from TrueCommerce and creates corresponding bill records in FreshBooks. Both directions run on a schedule tuned to your trading partner deadlines and FreshBooks invoice cadence.
How does ml-connector handle the different authentication paths that TrueCommerce offers?
ml-connector stores SFTP credentials (username and password) encrypted or stores a TrueCommerce API key encrypted, depending on your chosen transport path. You specify which credentials to use during setup, and ml-connector will authenticate accordingly on every exchange.
Does FreshBooks' webhook timeout requirement pose a risk?
FreshBooks webhooks timeout after 10 seconds and can range from seconds to several minutes in delivery. ml-connector queues all incoming webhooks immediately and processes them asynchronously, so FreshBooks receives a 2xx response within the timeout, and transformations into EDI documents happen in the background without risk of webhook retries or callback disabling.

Related integrations

Connect FreshBooks and TrueCommerce

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

Get started