ml-connector
Zoho BooksGoogle BigQuery

Zoho Books and Google BigQuery integration

Zoho Books handles invoicing, bills, and expense tracking for your SMB. Google BigQuery stores the data so your finance team can analyze trends, audit trails, and multi-currency reconciliation without leaving a spreadsheet. ml-connector watches Zoho Books for new invoices, bills, purchase orders, and payments, streams them into BigQuery as they arrive, and replays any missed events if a connection drops.

How Zoho Books works

Zoho Books exposes invoices, bills, purchase orders, vendor payments, customer payments, contacts, chart of accounts, journals, and expenses through REST APIs served from region-specific base URLs (US, EU, India, Australia, Japan, Canada, China, Saudi Arabia). Authentication uses OAuth2 Authorization Code flow with a user-delegated refresh token that does not expire; access tokens last 1 hour. Every API call requires an organization ID query parameter. Zoho Books supports outgoing webhooks that push events for invoices, bills, purchase orders, contacts, payments, and expenses; webhook history is queryable by date range. Polling is also available via offset-based pagination with per_page and page parameters. The rate limit is 100 requests per minute across all plans, with daily limits ranging from 1,000 to 10,000 per organization.

How Google BigQuery works

Google BigQuery is a fully-managed serverless data warehouse on Google Cloud Platform that acts as a structured data sink and source. It uses Service Account OAuth2 (JWT Bearer flow) with a private key to authenticate and exposes datasets, tables, and rows via REST. BigQuery has no native webhook push or event subscriptions; it is polling-only. Streaming inserts use insertId for best-effort deduplication on the connector side. Access tokens expire after 1 hour and must be refreshed. The service account requires bigquery.dataEditor and bigquery.jobUser roles minimum for read-write access. Storage Read API is preferred for large-volume reads. BigQuery has no pre-defined vendor or invoice schema; the connector defines custom tables per customer.

What moves between them

Zoho Books invoices, bills, purchase orders, and payments flow one direction: into BigQuery. ml-connector subscribes to Zoho Books webhook events (invoice.created, invoice.updated, bill.created, bill.updated, purchaseorder.created, purchaseorder.updated, invoice.unpaid, bill.overdue) and streams them into BigQuery tables. If webhooks are unavailable, ml-connector polls the Zoho Books list endpoints on a cadence you set (typically daily or every 4 hours). Because BigQuery is read-only for this integration, no data flows backward into Zoho Books. All records are immutable inserts into BigQuery; updates are appended as new rows with a later timestamp.

How ml-connector handles it

ml-connector stores both credential sets encrypted. On the Zoho Books side, it parses the OAuth2 refresh token, routes all calls to the correct regional base URL (resolved from the region field in the token response), and appends the organization_id query parameter. Access token expiry is tracked proactively so refresh happens before a call fails. When a webhook fires, ml-connector verifies the HMAC signature against the configured secret, parses the JSON payload, maps Zoho Books fields to BigQuery column names, and inserts the row with insertId for deduplication. If the webhook delivery succeeds but BigQuery insert fails, ml-connector queues a retry. If webhook delivery fails (5xx, timeout), Zoho Books retries at its own cadence; ml-connector polls the webhook history endpoint periodically to catch any events that were never delivered. On the BigQuery side, the service account JWT is signed locally and exchanged for an access token that is cached until 5 minutes before expiry, preventing token-fetch delays on hot paths. Streaming inserts use the insertId to prevent duplicates if the same event arrives twice. Every record carries a full audit trail (source event ID, arrival timestamp, BigQuery row ID) and can be replayed if needed.

A real-world example

A growing e-commerce SMB uses Zoho Books for accounting across US and EU operations. The finance team needs to track customer and vendor payments in real time, build custom dashboards in Data Studio, and audit invoice-to-payment timelines across both regions. Before the integration, they exported reports from Zoho Books weekly and uploaded them to Google Sheets for pivot analysis, a manual process that made late payment discovery slow. With Zoho Books and BigQuery connected, each invoice and payment lands in BigQuery automatically, the regional base URL routing is handled transparently, and the finance team runs daily SQL queries to identify overdue invoices and payment patterns. Month-end reporting is now self-serve; the manual export step is gone.

What you can do

  • Stream Zoho Books invoices, bills, purchase orders, and payments into BigQuery via webhook push or polling fallback.
  • Handle Zoho Books OAuth2 with region-specific routing so US, EU, and other regional instances work transparently.
  • Verify webhook signatures and deduplicate events using Zoho Books event IDs and BigQuery insertId.
  • Refresh OAuth2 access tokens proactively and track token expiry so no call fails due to stale credentials.
  • Replay missed webhook events by querying Zoho Books webhook history and backfilling BigQuery.

Questions

How does ml-connector handle Zoho Books' region-specific base URLs?
Zoho Books returns the region (or api_domain) in the OAuth2 token response. ml-connector stores this region credential and routes all API calls to the matching regional base URL (US, EU, India, Australia, Japan, Canada, China, or Saudi Arabia). Each customer organization lives in exactly one region, so routing is transparent and per-customer.
What happens if a webhook delivery fails or the event is never received?
If Zoho Books fails to deliver a webhook, it retries at its own cadence. ml-connector periodically queries the Zoho Books webhook history endpoint (filtered by from_date and to_date) to discover any events that were never delivered to ml-connector. Those events are backfilled into BigQuery so no invoice or payment is ever missed, even if a connection drops.
How does ml-connector prevent duplicate records in BigQuery?
Zoho Books webhooks include a unique event ID that ml-connector stores and uses as the BigQuery insertId. BigQuery's streaming inserts use insertId for best-effort deduplication; if the same event arrives twice, only one row is inserted. The full audit trail (event ID, arrival timestamp) is logged so duplicates can be detected and replayed if needed.

Related integrations

Connect Zoho Books and Google BigQuery

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

Get started