Connect Exact Online to AI Agents: Automate Finance, Payroll & HR
Give your AI agent Exact Online tools.
Connect Exact Online to AI Agents using Truto's unified tools. Learn how to fetch API schemas dynamically, handle HTTP 429 rate limits, and build multi-step ERP workflows in LangChain.
In this guide
- 01Initialize the Truto Tool Manager
- 02Fetch AI-Ready Tools
- 03Define Agent Rules for API Quirks
- 04Bind Tools to the LLM Framework
- 05Implement Explicit Rate Limit Handling
The guide
Learn how to connect Exact Online to AI Agents using Truto's /tools endpoint. Build autonomous workflows for finance, payroll, and HR without writing custom API integrations.
You want to connect Exact Online to an AI agent so your system can autonomously query financial records, process purchase entries, retrieve stock positions, and manage human resources data. Here is exactly how to do it using Truto's /tools endpoint and SDK, bypassing the need to build and maintain a custom Exact Online integration from scratch.
Giving a Large Language Model (LLM) read and write access to a monolithic ERP like Exact Online is a serious engineering challenge. You either spend sprints building, authenticating, and maintaining a custom integration layer, or you utilize a managed infrastructure layer that provides agent-ready tools out of the box. If your team uses ChatGPT, check out our guide on connecting Exact Online to ChatGPT, or if you are building on Anthropic's models, read our guide on connecting Exact Online to Claude. For developers building custom autonomous workflows, you need a programmatic way to fetch these tools and bind them to your agent framework.
This guide breaks down how to fetch AI-ready tools for Exact Online, bind them natively to an LLM using frameworks like LangChain, LangGraph, CrewAI, or the Vercel AI SDK, and execute complex ERP workflows. For a deeper look at the architecture behind this approach, refer to our research on architecting AI agents and the SaaS integration bottleneck.
The Engineering Reality of the Exact Online API
Giving an AI agent access to a massive ERP sounds straightforward until you confront the API's constraints. Exact Online handles everything from CRM and accounting to manufacturing and payroll. Its API is incredibly powerful but strictly adheres to its own relational data models and routing rules. If you hardcode these interactions into your agent, you will spend your time writing defensive data parsers instead of improving your model's reasoning capabilities.
Division-Centric Routing
Unlike many modern SaaS platforms where an API token inherently scopes the request to an account, Exact Online relies heavily on a division code for routing. Nearly every API endpoint requires the division ID in the URI path (e.g., /api/v1/{division}/financial/GLAccounts). If your agent attempts to construct URLs dynamically and hallucinates the division ID, or forgets to include it, the request will immediately fail. A unified tool layer handles this routing logic behind the scenes, allowing the agent to focus purely on the business logic of the function call.
Compound Transaction Structures
Standard LLMs are trained to expect flat, intuitive JSON objects. When an agent wants to create a sales invoice, it naturally attempts to send a payload like {"customer": "Acme Corp", "total": 500}.
Exact Online rejects this. The API requires a strict separation between headers and lines. A purchase entry requires a PurchaseEntries header object, followed by associated PurchaseEntryLines linked by the EntryID. By exposing these operations as distinct, strongly typed tools (create_a_exact_online_purchase_entry, create_a_exact_online_purchase_entry_line), you force the LLM to follow the relational schema. It creates the header, retrieves the ID, and then creates the lines, significantly reducing the attack surface for hallucinations.
Transparent Rate Limit Handling
Exact Online enforces strict rate limits to protect its multi-tenant infrastructure. It is critical to understand that Truto acts as a transparent proxy here. Truto does not retry, throttle, or apply backoff on rate limit errors.
When the upstream Exact Online API returns an HTTP 429 (Too Many Requests), Truto passes that error directly back to your caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. This design choice ensures that your application state remains deterministic. The caller - your agent orchestration framework - is entirely responsible for reading these headers and executing the appropriate retry or exponential backoff logic.
Core Exact Online AI Agent Tools
Truto provides a comprehensive suite of proxy APIs that are automatically converted into highly descriptive tools via the /integrated-account/:id/tools endpoint. Here are the highest-leverage tools for automating Exact Online workflows.
1. Retrieve Sales Invoices
Tool Name: list_all_exact_online_sales_invoices
This tool retrieves a paginated list of sales invoices. The agent can filter by customer, journal, or date range to pull precise billing data. Truto handles the underlying __next pagination links automatically, serving clean data pages to the model.
"Fetch all unpaid sales invoices created in the last 30 days for customer account ID 104859 and summarize the total outstanding balance."
2. Create Purchase Entries
Tool Name: create_a_exact_online_purchase_entry
Used to initiate the creation of a purchase transaction in the financial ledger. The agent must provide the supplier ID and the correct journal code. This acts as the header record, which the agent will follow up with line-item creation.
"Create a new purchase entry in the main supplier journal for Vendor ID 99382 to log their latest SaaS subscription bill."
3. Retrieve Stock Positions
Tool Name: list_all_exact_online_stock_position
Essential for supply chain and logistics agents. This tool reads the current and projected stock levels of specific items across your warehouses, preventing agents from promising inventory that doesn't exist.
"Check the current stock position for item 'Industrial Router X1' (ID 4059) and tell me how many units are currently available for immediate dispatch."
4. Analyze Aging Payables
Tool Name: list_all_exact_online_aging_payables_list
Provides a direct overview of outstanding supplier balances grouped by age. Financial AI agents use this tool to prioritize cash flow management and decide which bills need immediate payment to avoid late fees.
"Retrieve our aging payables list and flag any supplier accounts that have outstanding balances older than 60 days."
5. Access Employee Directory
Tool Name: list_all_exact_online_employees
Retrieves active employee data from the HR/Payroll module. This is heavily used by internal IT and HR support bots to verify employee statuses, managers, or department structures before taking action in other systems.
"Look up the employee record for Jane Doe to verify her current department and direct manager before I provision her software licenses."
6. Log Time Transactions
Tool Name: create_a_exact_online_time_transaction
Enables AI agents to automatically log billable hours against specific projects. The agent provides the project ID, the item (hour type), and the quantity of hours worked.
"Log 4.5 hours of development time to Project Alpha (ID 2049) under the standard engineering hour type for today's date."
To view the complete inventory of available Exact Online tools, schemas, and resource parameters, visit the Exact Online integration page.
Workflows in Action
Exposing individual endpoints to an LLM is only the first step. The real value unlocks when the agent orchestrates these tools to complete complex business processes autonomously. Here are two real-world examples.
Scenario 1: Autonomous Accounts Payable Processing
Finance teams spend hours manually entering vendor bills into the ERP. An AI agent can automate the entire ingestion and validation pipeline.
"Process the attached AWS invoice for last month. Find the vendor account, verify they are in our system, create a new purchase entry, and add the line item for the $4,500 hosting cost."
Execution Flow:
- The agent calls a native vision/document tool (outside of Exact Online) to parse the PDF invoice and extract the vendor name, date, and total amount.
- The agent calls
list_all_exact_online_accountsto search for the "Amazon Web Services" supplier account and retrieves its Account ID. - The agent calls
create_a_exact_online_purchase_entryusing the Account ID and the default purchase journal code to generate the invoice header. - The agent extracts the
EntryIDfrom the response and callscreate_a_exact_online_purchase_entry_lineto log the $4,500 expense against the appropriate G/L account.
Scenario 2: Project Time & Billing Reconciliation
Project managers need to ensure that billable hours don't exceed budgets. An agent can monitor time entries and proactively invoice customers.
"Check the time logged against the 'Website Redesign' project this week. If the total unbilled hours exceed 20, generate a new sales invoice for the client."
Execution Flow:
- The agent calls
list_all_exact_online_projectsto find the ID for the "Website Redesign" project. - The agent calls
list_all_exact_online_time_transactionsfiltering by the project ID and the current week's date range to calculate total hours. - Recognizing the threshold is met, the agent calls
create_a_exact_online_sales_invoiceto generate an invoice header for the linked customer account. - The agent iterates through the unbilled time, calling
create_a_exact_online_sales_invoice_lineto add the billable hours to the invoice.
Building Multi-Step Workflows
To build these systems in production, you need an orchestration layer that handles tool binding, execution, and critical error handling - particularly HTTP 429 rate limits. Truto's /tools endpoint dynamically provides JSON Schema definitions for every API method, making it compatible with any major framework (LangChain, LangGraph, Vercel AI SDK, etc.).
Below is an architectural sequence demonstrating how an agent handles rate limits transparently passed through from Exact Online.
sequenceDiagram
participant LLM as LLM Agent
participant Truto as Truto /tools Proxy
participant Exact as Exact Online API
LLM->>Truto: call list_all_exact_online_aging_payables_list
Truto->>Exact: GET /api/v1/{division}/read/financial/AgingPayablesList
Exact-->>Truto: HTTP 429 (Rate Limited)
Truto-->>LLM: HTTP 429 + ratelimit-reset header
Note over LLM: Agent orchestration pauses<br>and applies exponential backoff
LLM->>Truto: retry list_all_exact_online_aging_payables_list
Truto->>Exact: GET /api/v1/{division}/read/financial/AgingPayablesList
Exact-->>Truto: 200 OK (JSON Data)
Truto-->>LLM: JSON Payables DataTypeScript Implementation with LangChain
Here is a complete, runnable example using Node.js, LangChain, and the truto-langchainjs-toolset. This script fetches the Exact Online tools, binds them to OpenAI's gpt-4o, and explicitly implements a wrapper to catch the 429 errors that Truto passes through, ensuring the agent pauses and retries.
import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { TrutoToolManager } from "truto-langchainjs-toolset";
// 1. Initialize the Truto Tool Manager
// We filter for 'read' and 'write' methods to keep the context window optimized.
const toolManager = new TrutoToolManager({
trutoApiKey: process.env.TRUTO_API_KEY,
integratedAccountId: process.env.EXACT_ONLINE_ACCOUNT_ID,
methods: ["read", "write"]
});
async function runAgent() {
// 2. Fetch the tools dynamically from Truto's API
const tools = await toolManager.getTools();
console.log(`Loaded ${tools.length} Exact Online tools.`);
// 3. Initialize the LLM
const llm = new ChatOpenAI({
modelName: "gpt-4o",
temperature: 0,
});
// 4. Create the prompt instructing the agent on API behavior
const prompt = ChatPromptTemplate.fromMessages([
["system", "You are an autonomous finance assistant. You have access to Exact Online tools.\n" +
"CRITICAL RULES:\n" +
"1. If a tool returns an HTTP 429 rate limit error, you MUST inform the user and pause before retrying.\n" +
"2. When creating transactions, always create the header first, then use the returned ID to create the lines."],
["human", "{input}"],
["placeholder", "{agent_scratchpad}"]
]);
// 5. Bind tools and create the executor
const agent = createToolCallingAgent({
llm,
tools,
prompt,
});
const executor = new AgentExecutor({
agent,
tools,
maxIterations: 10,
});
// 6. Execute the workflow
try {
const result = await executor.invoke({
input: "Retrieve our aging payables list. If any account owes us money for more than 60 days, log a time transaction of 1 hour to project ID 'INTERNAL-AUDIT' for review time."
});
console.log("Agent Result:", result.output);
} catch (error: any) {
// 7. Explicitly handle rate limits passed through by Truto
if (error.response && error.response.status === 429) {
const resetTime = error.response.headers['ratelimit-reset'];
console.error(`Rate limited by Exact Online. Must wait until ${resetTime} before retrying.`);
// Implement your exponential backoff/retry queue here
} else {
console.error("Workflow failed:", error);
}
}
}
runAgent();By fetching schemas dynamically and catching the standardized ratelimit headers, your application remains robust against schema drift and infrastructure constraints without hardcoding Exact Online's specific rate-limiting quirks into your core business logic.
Summary
Connecting an AI agent to Exact Online requires strict adherence to its relational data models and respect for its infrastructure limits. By utilizing a unified tool layer, you abstract away the OAuth boilerplate, division routing, and pagination loops, presenting your LLM with a clean, deterministic set of actions. Because Truto acts as a transparent proxy - passing standard HTTP 429s directly to your system - your engineers retain full control over agent execution state and retry mechanisms.
Stop writing defensive API parsers and start building autonomous workflows.
FAQ
- How does Truto handle Exact Online rate limits?
- Truto does not retry, throttle, or apply backoff on rate limit errors. When Exact Online returns an HTTP 429, Truto passes the error to your application along with standardized IETF headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`). Your agent orchestration layer is responsible for handling the retry logic.
- How do AI agents handle Exact Online's division routing?
- Exact Online requires a division ID in almost every API path. Truto abstracts this complexity at the proxy layer, allowing the LLM to call standard tools (like `list_all_exact_online_sales_invoices`) without hallucinating or constructing complex URI paths.
- Can I use frameworks other than LangChain to connect to Exact Online?
- Yes. Truto's `/integrated-account/:id/tools` endpoint returns standard JSON Schema definitions, making it framework-agnostic. You can bind these tools to LangChain, LangGraph, CrewAI, the Vercel AI SDK, or custom orchestration layers.
- How do AI agents create compound transactions like sales invoices?
- Exact Online requires separate header and line-item creation. Truto exposes these as distinct tools (e.g., `create_a_exact_online_sales_invoice` and `create_a_exact_online_sales_invoice_line`). The agent creates the header, retrieves the ID, and then iterates to create the associated lines.