ml-connector
FreshBooksMicrosoft Power BI

FreshBooks and Microsoft Power BI integration

FreshBooks is the accounting and invoicing foundation for small business finance. Microsoft Power BI turns raw accounting data into live dashboards and reports. Connecting the two brings FreshBooks transactions into Power BI in near-real time so your finance team can track cash flow, expense trends, and bill aging without exporting and re-importing. ml-connector listens for invoice, payment, bill, and expense changes in FreshBooks and pushes them into your Power BI dataset, keeping your dashboards fresh as your accounting changes.

How FreshBooks works

FreshBooks is a cloud accounting platform that manages invoices, expenses, bills, payments, clients, chart of accounts, and time tracking via REST API. It uses OAuth 2.0 user-delegated authorization, meaning each connection requires a user to approve access on their FreshBooks account. FreshBooks publishes events via webhooks to a customer-supplied endpoint whenever invoices, payments, bills, expenses, or clients are created, updated, or deleted. Webhook payloads arrive as form-encoded data signed with an HMAC-SHA256 header. FreshBooks does not support client credentials OAuth, so each integration requires a specific user context.

How Microsoft Power BI works

Microsoft Power BI is a cloud analytics service that ingests data through a REST API and renders it in interactive dashboards and reports. Power BI uses OAuth 2.0 service principal authentication (client credentials), where a service principal is a non-user identity that authenticates with a client ID and client secret. Data is pushed into Power BI via push datasets, which require a predefined table schema with column names and data types. Power BI does not push events outbound, so the connector is purely ingestion-oriented. The service principal must be enabled in the Power BI admin portal and added as a member or admin on each workspace it needs to access.

What moves between them

Financial records flow from FreshBooks into Microsoft Power BI. When an invoice, payment, bill, or expense is created or updated in FreshBooks, the webhook notifies ml-connector, which transforms the record to match your Power BI dataset schema and pushes it into a push dataset. Each FreshBooks record includes invoice number, amount, date, client name, and account coding, all of which map to columns in Power BI. Expense and bill payment records flow the same way. Client and chart of accounts reference data can also be pushed on a scheduled sync to keep dimension tables current. Power BI does not push data back to FreshBooks, so the flow is one-way: FreshBooks to Power BI.

How ml-connector handles it

ml-connector stores the service principal client ID and secret encrypted and requests a fresh OAuth 2.0 token before the first push. FreshBooks webhooks are registered on your account to point to ml-connector's endpoint, and each webhook signature is verified with the HMAC-SHA256 header to prevent spoofing. When FreshBooks posts an event, ml-connector validates the signature, extracts the transaction ID, fetches the full record from FreshBooks using the user-delegated token, and then transforms it to match your Power BI push dataset schema. The transformed record is posted to Power BI, and if a 429 rate limit response is received, ml-connector backs off and retries. The service principal token expires after one hour, so ml-connector refreshes it before each push. If the push dataset does not exist or its schema does not match, the connector surfaces the schema error so it can be aligned before data is posted. Every record carries a transaction ID and timestamp for deduplication and audit.

A real-world example

A small accounting firm manages payables and receivables for a dozen SMB clients using FreshBooks. The firm's accountants need to monitor cash flow across all clients and flag invoices that are aging beyond terms. Before the integration, accountants exported reports from FreshBooks weekly and copied invoice and payment data into Excel to track aging and cash position across the client base. With FreshBooks connected to Power BI, a shared dashboard displays invoices by aging bucket, payment totals by week, and expenses by client in near-real time. When a payment arrives or an invoice is issued, it appears in the dashboard within minutes, so the accountants always know the current cash position without re-exporting data.

What you can do

  • Push FreshBooks invoices and payments into Power BI as they are created or updated, keeping cash flow dashboards current.
  • Map FreshBooks invoice line items, amounts, dates, and client names to Power BI table columns without manual schema alignment.
  • Subscribe to FreshBooks webhooks for invoices, payments, bills, and expenses, and post them to Power BI on arrival.
  • Authenticate FreshBooks with user-delegated OAuth 2.0 and Power BI with a service principal, managing token refresh and expiry.
  • Handle Power BI rate limits with exponential backoff, verify FreshBooks webhook signatures, and deduplicate records by transaction ID.

Questions

Which direction does data move between FreshBooks and Microsoft Power BI?
Data flows from FreshBooks into Microsoft Power BI only. Invoices, payments, bills, expenses, and clients from FreshBooks are pushed into Power BI push datasets so they can be visualized in dashboards and reports. Power BI does not push data back to FreshBooks, and the integration does not modify FreshBooks records.
Does the integration require special setup in Power BI or FreshBooks?
Yes. In Power BI, a service principal must be enabled in the admin portal and added as a member or admin on each workspace that will receive data. In FreshBooks, webhooks must be registered to point to ml-connector's endpoint so that events trigger the push to Power BI. Both connections are configured when you set up the integration.
What happens if a FreshBooks webhook is missed or Power BI is temporarily unavailable?
If a FreshBooks webhook does not reach ml-connector or Power BI is temporarily unavailable, ml-connector retries with exponential backoff. The integration tracks the FreshBooks webhook signature so replayed events are deduplicated by transaction ID. If the schema in Power BI does not match the incoming FreshBooks record, the connector surfaces the schema mismatch so it can be corrected before data is lost.

Related integrations

Connect FreshBooks and Microsoft Power BI

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

Get started