ml-connector
SAP Business OneSquare

SAP Business One and Square integration

SAP Business One runs your financials, purchasing, and inventory. Square runs your payments and point-of-sale. Connecting the two keeps your cash position and your order book synchronized. Payments and orders from Square flow into SAP Business One as customer invoices and revenue journals, mapped to the correct customer records and GL accounts. Inventory adjustments stay aligned in both directions so your stock levels reflect actual Square sales and vendor receipts.

How SAP Business One works

SAP Business One is deployed on-premise or partner-hosted, with each customer providing their own Service Layer base URL and port (default 50000 HTTP or 50001 HTTPS). Authentication uses session tokens obtained via POST /Login with a 30-minute inactivity timeout, or OAuth 2.0 if the customer has IAM configured. The OData v4 REST API exposes invoices, purchase orders, incoming and outgoing payments, journal entries, chart of accounts, dimensions, profit centers, business partners, and items. Webhooks are supported in SAP Business One v10.0 FP 2602 and later if the Webhook Messenger Service is activated, but polling is the default and safest approach since webhook setup requires SAP administrator configuration on the customer instance.

How Square works

Square uses OAuth 2.0 authorization code flow for multi-seller access or personal access tokens for single-account integrations, with bearer tokens that expire in 30 days and refresh tokens that do not. The production REST endpoint is https://connect.squareup.com/v2, with a sandbox environment for testing. Square exposes payments, refunds, invoices, orders, customers, inventory, vendors, catalog items, and team members, with webhooks available for payment.created, payment.updated, refund.created, order.created, order.updated, customer.created, and inventory.count.updated events. Webhook signatures are verified via HMAC-SHA256. Square is commerce-layer only; there is no GL accounts or chart of accounts API, so financial postings must map to an external accounting system.

What moves between them

Payments and orders flow from Square into SAP Business One. When a Square payment is received, ml-connector creates a corresponding invoice or journal entry in SAP Business One, mapped to the Square customer and the GL account designated for point-of-sale revenue. When inventory is adjusted in Square, the corresponding item transaction is posted to SAP Business One. In the reverse direction, purchase orders and vendor master data from SAP Business One can be synced to Square so vendors remain aligned on both sides. The integration runs on a schedule you define, typically hourly for payments and daily for order reconciliation.

How ml-connector handles it

ml-connector maintains two credential sets: the SAP Business One session token (refreshed every 25 minutes to avoid the 30-minute timeout) and the Square OAuth bearer token (refreshed when it approaches 30-day expiry or when Square returns a 401). For each Square payment, it queries SAP Business One to verify the customer record exists (via BusinessPartner endpoint) and the GL account is valid (via ChartOfAccounts), then posts a journal entry or invoice to SAP Business One. Square locations are mapped to SAP profit centers and dimensions so revenue lands on the correct cost center. Inventory adjustments are synced via Square's inventory.count.updated webhook if enabled, or via polling the Inventory endpoint and comparing transaction counts. Because SAP Business One on-premise instances often use self-signed TLS certificates, ml-connector accepts custom certificate validation per customer. Square enforces HTTP 429 rate limits, so ml-connector backs off and retries with exponential jitter. Every record carries a full audit trail and is idempotent - if a posting fails mid-way, replaying the same Square payment ID will not create duplicate invoices because ml-connector checks for existing invoices by external reference ID before posting.

A real-world example

A regional restaurant chain with 15 locations runs Square point-of-sale at each site and uses SAP Business One for accounting and inventory management. Before the integration, each day's sales manager exported transaction reports from Square and re-entered the totals into SAP Business One by location, taking one to two hours per day and introducing manual entry errors during month-end close. With Square and SAP Business One connected, each point-of-sale payment flows directly into the corresponding SAP profit center as a revenue journal, and inventory shrinkage from sales is automatically deducted from the stock ledger. The accounting team receives a daily reconciliation report showing what posted, and month-end close now begins with cash and inventory already aligned to actual Square transactions.

What you can do

  • Post Square payments into SAP Business One as invoices or journal entries, mapped to the correct customer, location, and GL account.
  • Sync inventory adjustments from Square back into SAP Business One so stock levels stay current with actual point-of-sale transactions.
  • Map Square locations to SAP profit centers and dimensions so every posting lands on the correct cost center.
  • Authenticate SAP Business One with session tokens that auto-refresh before timeout, and Square with OAuth bearer tokens that never expire.
  • Handle SAP on-premise network access, custom TLS certificates, and Square rate limits with automatic retries and a full audit trail on every record.

Questions

Which direction does data move between SAP Business One and Square?
The main flow is from Square into SAP Business One. Payments and orders flow in from Square as invoices and journal entries, while inventory adjustments sync in both directions. Reference data such as customers and vendors can be synced in either direction depending on your workflow.
How does the integration handle SAP Business One session timeouts and Square OAuth expiry?
ml-connector refreshes the SAP Business One session token every 25 minutes - before the 30-minute inactivity timeout - so the session never expires mid-flow. It tracks Square OAuth token expiry at 30 days and requests a refresh token proactively, and if a call returns 401, it immediately refreshes before retrying.
What happens if SAP Business One is on-premise with a firewall or custom SSL certificate?
ml-connector accepts the customer's full Service Layer base URL and port and can validate custom or self-signed TLS certificates per deployment. It does not require SAP Business One to be exposed to the public internet; it works with on-premise instances behind a firewall or VPN, as long as the connector network can reach the Service Layer endpoint.

Related integrations

Connect SAP Business One and Square

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

Get started