ml-connector
SAP Business OneAvalara

SAP Business One and Avalara integration

SAP Business One runs financials, sales, and purchasing for small and midsize businesses. Avalara AvaTax calculates sales and use tax across jurisdictions but stores none of your accounting records. Connecting the two means every invoice gets accurate, address-based tax without anyone looking up rates by hand. ml-connector sends each SAP Business One document to Avalara for calculation, writes the result back into the document, and keeps the customers, items, and tax codes Avalara needs in step with SAP B1. The calculation is synchronous, so tax is ready before the document posts.

How SAP Business One works

SAP Business One exposes business partners (customers and vendors), A/R invoices, A/P purchase invoices, purchase orders, items, journal entries, and the chart of accounts through its OData v4 REST Service Layer. Each customer runs their own instance, so the base URL is customer-specific and must be supplied as a credential rather than derived. Authentication is a session login that returns a B1SESSION cookie carried on every request, expiring after about 30 minutes of inactivity with error code -5002. Webhooks exist only in very recent versions and need on-premise admin setup, so most reliable integrations read by polling with $filter on update dates.

How Avalara works

Avalara AvaTax is a tax calculation service, not an ERP, so it has no native vendor, purchase order, payment, or GL account objects. Its central object is the transaction, created with POST /api/v2/transactions, which returns the calculated tax inline. It also stores companies, customers, items, and tax codes used to resolve taxability and exemptions. Authentication is HTTP Basic using an account ID and license key sent on every request. AvaTax does not push events; it is pull-only, with a Notifications resource for system messages, so the ERP is what triggers each calculation.

What moves between them

The primary flow runs from SAP Business One into Avalara and back. When an A/R invoice or A/P purchase invoice is created or updated in SAP B1, ml-connector reads it from the Service Layer, sends it to Avalara as a SalesInvoice or PurchaseInvoice transaction, and writes the returned jurisdiction tax onto the document lines before it is committed. Master data flows the same direction on a schedule: customers from BusinessPartners, products from Items, and the tax code each item maps to are pushed into Avalara so calculations resolve. Once a SAP B1 document is committed, ml-connector commits the matching Avalara transaction so the tax is recorded for filing.

How ml-connector handles it

ml-connector stores both credential sets encrypted, logs in to the SAP B1 Service Layer to obtain the B1SESSION cookie, and reuses that session across requests rather than re-authenticating per call, since the first login is slow. When SAP B1 returns -5002 on session expiry it re-logs in and replays the request. Avalara calls carry HTTP Basic auth on every request. Because SAP B1 webhooks need server-side setup, ml-connector polls invoices with an update-date filter on a schedule you control. Each SAP B1 DocNum becomes the Avalara document code, which acts as the idempotency key: re-sending an uncommitted transaction updates it in place, so a retry is safe, but a committed code cannot be reused. Addresses are validated through Avalara before calculation, and each SAP B1 item maps to an Avalara tax code so taxable goods are not treated as exempt. AvaTax returns HTTP 429 when rate limited, so ml-connector backs off with jitter and retries. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A regional industrial supply distributor with roughly 90 staff runs SAP Business One for sales, purchasing, and finance, and ships to customers across several states. Before the integration, the billing team looked up tax rates by destination and keyed them onto each invoice, which slowed billing and produced rate errors that surfaced later as exposure during a state audit. With SAP Business One and Avalara connected, each invoice is sent to Avalara at creation, tax is calculated from the validated ship-to address, and the result is written back before the document posts. Rate lookups stop, exempt customers are handled through their certificates, and committed transactions sit ready in Avalara for return filing.

What you can do

  • Calculate sales and use tax on SAP Business One A/R invoices and A/P purchase invoices through Avalara and write the result back before commit.
  • Sync SAP Business One customers and items into Avalara so calculations and exemptions resolve correctly.
  • Map each SAP Business One item to an Avalara tax code so taxable goods are not treated as exempt.
  • Use the SAP Business One document number as the Avalara document code so a retried calculation never double-records tax.
  • Validate ship-to addresses through Avalara and commit the Avalara transaction once the SAP B1 document is committed.

Questions

Which direction does data move between SAP Business One and Avalara?
The main flow is SAP Business One into Avalara and back. Invoices, customers, and items move from SAP B1 to Avalara, and the calculated tax returns to SAP B1 and is written onto the document. Avalara holds no vendors, purchase orders, or GL accounts, so those records stay in SAP Business One and are passed to Avalara only as code references on a transaction.
How does the integration avoid double-recording tax when a calculation is retried?
Each SAP Business One document number is used as the Avalara document code, which is Avalara's idempotency mechanism. Re-sending an uncommitted transaction with the same code updates it in place, so a retry is safe, while a committed code is reserved and cannot be reused. ml-connector commits the Avalara transaction only after the matching SAP B1 document is committed.
Does the connector rely on SAP Business One webhooks?
No. SAP Business One webhooks exist only in recent versions and require an administrator to set up the Webhook Messenger Service on the customer's server. ml-connector instead polls the Service Layer for new and changed invoices on a schedule using an update-date filter, and it can use webhooks where a customer has them enabled. Avalara is pull-only, so it never triggers the flow itself.

Related integrations

Connect SAP Business One and Avalara

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

Get started