ml-connector
VismaTwilio

Visma and Twilio integration

Visma handles financial management and AP/AR. Twilio sends SMS, voice, and email across any channel. Connecting them routes critical finance events to the right people at the right time. When a supplier invoice arrives in Visma, a text goes to the AP team. When a payment clears, a notification confirms it. Finance teams stay in sync with what matters most.

How Visma works

Visma.net ERP is a cloud-based financial platform serving the Nordic region, covering AP/AR, purchasing, payroll, and project accounting. It exposes suppliers, invoices, purchase orders, payments, GL accounts, and transactions through REST APIs at https://api.finance.visma.net, secured with OAuth2 client credentials via Visma Connect. Authentication requires client_id, client_secret, and tenant_id, and every API call includes an ipp-company-id header. Visma publishes entity events through webhooks and supports polling via delta queries with lastModifiedDateTime filters. Webhook delivery is one-time only with no automatic retry, so ml-connector supplements webhooks with scheduled polling to ensure no events are missed.

How Twilio works

Twilio is a cloud communications platform exposing REST APIs for SMS, voice calls, email, and identity verification across multiple endpoints. Core SMS endpoints live at https://api.twilio.com/2010-04-01, while messaging services and email use https://messaging.twilio.com/v1. Authentication uses HTTP Basic Auth with Account SID and Auth Token, and can also accept API Keys with fine-grained scope. Twilio sends status callbacks for every message event: queued, sending, sent, delivered, undelivered, failed, and read. Webhook payloads use application/x-www-form-urlencoded encoding, and webhook handlers must be idempotent because delivery is not guaranteed exactly-once.

What moves between them

Finance events flow from Visma into Twilio. When a supplier invoice, purchase order, payment, or GL transaction reaches a change state in Visma, ml-connector reads that event and triggers a Twilio SMS or email notification to the designated recipient. The notification includes the event type, entity ID, and a summary of the change. Twilio returns a message SID and status on each send, and ml-connector records the outcome in its audit trail. No data flows back from Twilio to Visma; Twilio is strictly outbound for alerting.

How ml-connector handles it

ml-connector polls Visma at a configured interval using lastModifiedDateTime delta queries to catch invoice, payment, and purchase order changes since the last poll. For each new or modified entity, it matches the entity type and amount against configurable rules to decide whether to send an alert. It then calls Twilio's SMS or Messaging endpoint with the recipient phone number or email address, the message content, and the account SID and auth token via HTTP Basic Auth. Twilio returns immediately with a message SID; ml-connector records the SID, recipient, Visma entity ID, and timestamp in its audit log. Twilio's webhook callbacks eventually post the message status (sent, delivered, failed), and ml-connector logs those too. Visma's webhook delivery is unreliable, so polling is the primary mechanism; webhooks are accepted if the customer enables them, but not relied upon. Rate limits apply on the Visma side (500 calls per hour for test clients), so ml-connector batches alerts and respects backoff signals. Auth token refresh happens on expiry; ml-connector caches the Visma access token and requests a new one when calls return 401.

A real-world example

A mid-market Nordic manufacturing company uses Visma for AP and GL accounting. The finance and operations teams need to know when large supplier invoices land, when purchase orders reach approval thresholds, and when payments complete. Before Twilio integration, the AP team checked Visma manually multiple times a day and often missed time-sensitive invoices. With Twilio connected, an SMS goes to the AP manager and supervisor whenever an invoice over 50,000 SEK arrives, and a Slack-styled email message confirms each day's payments. The team stays responsive without constant manual checking, and escalations on high-value orders happen within minutes.

What you can do

  • Send SMS and email alerts from Visma when supplier invoices, purchase orders, and payments change state.
  • Map Visma entity types and amounts to Twilio message templates, keeping alert logic outside code.
  • Authenticate Visma with OAuth2 via Visma Connect and handle tenant headers and token refresh.
  • Present Twilio Auth Token via HTTP Basic Auth and record message SIDs and delivery status in audit logs.
  • Poll Visma on a schedule using delta queries with lastModifiedDateTime to catch all finance events.

Questions

Does this integration sync financial data from Twilio back into Visma?
No. Twilio is a messaging platform, not a financial system, and has no invoices, accounts, or payment records. The integration sends alerts one way: from Visma financial events out to Twilio for SMS and email notification. Twilio status callbacks are logged for audit purposes but do not modify Visma data.
How does ml-connector handle Visma's unreliable webhooks and lack of automatic retry?
ml-connector does not rely on Visma webhooks alone. It polls Visma on a schedule using delta queries (lastModifiedDateTime parameter) to pull all new and modified invoices, orders, and payments since the last poll. If webhooks are enabled at the company level, they are accepted as a supplement, but polling is the primary guarantee that no events are missed.
What happens if a Twilio message fails to send?
ml-connector records the Twilio API response and message SID in its audit trail. If the send fails (wrong number, carrier block, insufficient credits), the SID and error reason are logged. The alert is not retried automatically; the operator reviews the audit log and can manually resend or correct the recipient number and try again.

Related integrations

Connect Visma and Twilio

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

Get started