ml-connector
Sage 50Square

Sage 50 and Square integration

Sage 50 runs the accounting on your Windows machine. Square runs your point-of-sale and payment processing. Connecting them keeps your sales and customer records in sync across both systems. Orders in Sage 50 become invoices in Square, customers match between systems, and payments Square collects flow back into Sage 50 as receipts so your ledgers agree without manual reconciliation.

How Sage 50 works

Sage 50 (US and UK editions) is a desktop-installed application on Windows that exposes vendors, customers, purchase and sales invoices, purchase and sales orders, payments, receipts, accounts, general journal entries, employees, and inventory items. Integration happens via the local .NET SDK (US edition) or Sage Data Objects COM layer (UK edition), both requiring a Windows process with direct access to company data files. There is no REST API or cloud integration surface. The application uses Windows-local username and password authentication against its internal user database, keyed by ApplicationID and CompanyPath (US) or DataPath (UK). Sage 50 does not support webhooks or event streams; integration must poll for changes using LastModifiedDate or TransactionDate queries, with a recommended minimum poll interval of 5 to 15 minutes for near-real-time sync.

How Square works

Square exposes payments, invoices, orders, vendors, customers, catalog items, inventory, and team members through a versioned REST API at https://connect.squareup.com/v2. Authentication uses OAuth 2.0 bearer tokens that expire in 30 days, requiring refresh-token handling. Square supports webhook push notifications for payment, refund, invoice, order, customer, and inventory events with HMAC-SHA256 signature verification. The Vendors API and Orders update endpoint are in beta. Square has no Chart of Accounts or GL Accounts API and no Purchase Orders API; PO workflows must be modeled via Orders with Vendor references.

What moves between them

Sales orders and customers flow from Sage 50 into Square as invoices and customers. Payments and refunds collected in Square flow back into Sage 50 as customer receipts and adjustments. The sync runs on a schedule set by the user, polling Sage 50 for modified sales orders and customers, then posting or updating their equivalents in Square. Refunds and payments from Square are read on every cycle and reconciled against open Sage 50 invoices. Customer records are aligned in both directions so invoice line items reference the same customer in both systems.

How ml-connector handles it

ml-connector runs a Windows process with direct access to the Sage 50 company data files and holds the local SDK connection open across polling cycles. It queries Sage 50 for sales orders and customers modified since the last sync using LastModifiedDate and caches the ApplicationID, CompanyPath, Username, and Password to reconnect if the session expires. On the Square side, it stores the OAuth 2.0 access and refresh tokens encrypted and tracks their 30-day expiry, refreshing proactively before they expire. Sales orders from Sage 50 map to Square invoices with line items and totals preserved, and customers map to Square customers by name and contact matching. Payments and refunds from Square are read via the Payments and Refunds APIs and matched against Sage 50 invoices by order number or invoice reference. Because Sage 50 has no webhooks and requires polling, ml-connector cannot accept push notifications from Square; instead it polls both systems on a user-defined cadence (typically hourly) and reconciles any drift. The desktop-only nature of Sage 50 means the integration process must run on a Windows machine with Sage 50 installed, and the integration user account cannot be logged in interactively while the SDK session is active.

A real-world example

A small-to-medium retail business runs Sage 50 for accounting and Square for payments and point-of-sale across three locations. Before the integration, the store manager entered each day's Square transactions into Sage 50 by hand, matching payments to invoices and reconciling customer records weekly. With Sage 50 and Square connected, sales orders placed in Sage 50 flow automatically to Square as invoices customers can pay online, and when payments arrive in Square the manager's reconciliation reports show the transactions already posted to the ledger. The daily data entry step is eliminated and month-end close is faster because customer balances in Sage 50 match Square's payment records.

What you can do

  • Sync sales orders from Sage 50 to Square as invoices with line items and customer references.
  • Keep customers aligned between Sage 50 and Square so invoices reference the correct customer in both systems.
  • Pull payments and refunds from Square and post them to Sage 50 as customer receipts and adjustments.
  • Manage the local Sage 50 SDK connection and query for modified records on a polling schedule you set.
  • Refresh Square OAuth 2.0 access tokens automatically before the 30-day expiry and handle token expiration gracefully.

Questions

Which direction does data move between Sage 50 and Square?
Sales orders and customers move from Sage 50 into Square as invoices and customers. Payments and refunds collected in Square flow back into Sage 50 as receipts and adjustments. Customer records are kept in sync in both directions so line items reference the correct customer in both systems.
Does the Sage 50 SDK require a Windows machine, and can it run as a scheduled service?
Yes, the Sage 50 .NET SDK and COM layer both require a Windows machine with Sage 50 installed and direct access to the company data files. The integration process must run on that machine and cannot be fully automated as a Windows Service without a workaround; it requires an interactive desktop session or a scheduled task running under a user account that has exclusive access to Sage 50 (the integration user cannot be logged in interactively while the SDK is open).
How does ml-connector handle Square's 30-day access token expiry?
ml-connector stores the OAuth 2.0 access and refresh tokens encrypted and proactively refreshes the access token before it expires every 30 days. If a token has already expired, ml-connector detects the 401 response from Square and refreshes it immediately, then retries the request. This ensures the integration does not lose connectivity due to token expiry.

Related integrations

Connect Sage 50 and Square

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

Get started