Test finance agents with Ancha’s QuickBooks Online API mock.
Start with Larchmere Field Services’ customers, invoices and bills. Your agent queries the books and records payments. Check the resulting balances, saved records and calls.
invoice_paidInvoice 2 has Balance 0
one_paymentExactly 1 Payment with CustomerRef.value 1
reminder_sentInvoice sent to accounts@ternwick.example
books_unchangedNo Bill or JournalEntry changed
Starting records
entities / Invoice
- Id
2
entities / Account
- Id
2- Name
Undeposited Funds
entities / Customer
- Id
1- DisplayName
Ternwick Studio
entities / Item
- Id
1- Name
Site review
Connect your agent to the QuickBooks Online mock
When ancha runs your agent, it sets:
QUICKBOOKS_API_URLQUICKBOOKS_REALM_IDQUICKBOOKS_ACCESS_TOKENQUICKBOOKS_REFRESH_TOKENQUICKBOOKS_CLIENT_IDQUICKBOOKS_CLIENT_SECRETQUICKBOOKS_TOKEN_URL
Point the client you already use at them.
const query = new URLSearchParams({ query: "select * from Invoice where Balance > '0'", minorversion: '75' });
const response = await fetch(process.env.QUICKBOOKS_API_URL + '/v3/company/' + process.env.QUICKBOOKS_REALM_ID + '/query?' + query, {
headers: { Authorization: 'Bearer ' + process.env.QUICKBOOKS_ACCESS_TOKEN, Accept: 'application/json' },
});
const { QueryResponse } = await response.json();
const invoices = QueryResponse.Invoice ?? [];Locally, ancha runs your agent as an ordinary process, so keep real QuickBooks Online credentials out of its environment.
See all 16 endpoints
company
/v3/company/{realmId}/{entity}/v3/company/{realmId}/{entity}/{id}/v3/company/{realmId}/{entity}/{id}/pdf/v3/company/{realmId}/{entity}/{id}/send/v3/company/{realmId}/batch/v3/company/{realmId}/cdc/v3/company/{realmId}/download/{id}/v3/company/{realmId}/exchangerate/v3/company/{realmId}/query/v3/company/{realmId}/query/v3/company/{realmId}/reports/{report}/v3/company/{realmId}/taxservice/taxcode/v3/company/{realmId}/uploadoauth2
/oauth2/v1/tokens/bearer/oauth2/v1/tokens/revoke/v2/oauth2/tokens/revokeSeed your own data
The data the QuickBooks Online mock starts with on every run, cut to a few records. ancha twins seed quickbooks prints every field.
Full seed YAML
twins:
- quickbooks
seed:
quickbooks:
companyInfo:
CompanyName: Larchmere Field Services
Country: US
entities:
Account:
- Id: "1"
Name: Operating bank
AccountType: Bank
AccountSubType: Checking
- Id: "2"
Name: Undeposited Funds
AccountType: Other Current Asset
AccountSubType: UndepositedFunds
- Id: "3"
Name: Trade receivables
AccountType: Accounts Receivable
AccountSubType: AccountsReceivable
- Id: "6"
Name: Field service revenue
AccountType: Income
AccountSubType: ServiceFeeIncome
Customer:
- Id: "1"
DisplayName: Ternwick Studio
PrimaryEmailAddr:
Address: accounts@ternwick.example
Item:
- Id: "1"
Name: Site review
Type: Service
IncomeAccountRef:
value: "6"
Invoice:
- Id: "2"
CustomerRef:
value: "1"
TxnDate: -100d
DueDate: -70d
BillEmail:
Address: accounts@ternwick.example
Line:
- Amount: 1200
DetailType: SalesItemLineDetail
SalesItemLineDetail:
ItemRef:
value: "1"
TaxCodeRef:
value: NON
Check what your agent did
Checks YAML
checks:
- id: invoice_paid
state:
quickbooks.entity:
type: Invoice
id: "2"
fields:
Balance: 0
- id: one_payment
state:
quickbooks.count:
type: Payment
where:
CustomerRef.value: "1"
count: 1
- id: reminder_sent
state:
quickbooks.sent:
type: Invoice
to: accounts@ternwick.example
- id: books_unchanged
state:
quickbooks.unchanged:
types:
- Bill
- JournalEntryMore payments and commerce tools
All 43 toolsQuickBooks Online API mock FAQ
How do I connect an agent to Ancha's QuickBooks Online API mock?
Run ancha connect quickbooks --lang ts or --lang py. Build Accounting API URLs from QUICKBOOKS_API_URL and /. Send QUICKBOOKS_ACCESS_TOKEN as a Bearer token. Responses are JSON; Accept: application/ returns XML.
Can an agent that calls QuickBooks through Composio use the mock?
Yes, and it keeps its Composio code. ancha init finds Composio in the project and sets quickbooks: composio under agent.routes in ancha.yaml, with COMPOSIO_API_KEY under agent.pass_env. Store the project's Composio key with ancha secrets set COMPOSIO_API_KEY, then run the tests with ancha run --on cloud. Direct tool executions, Tool Router sessions and the session's MCP endpoint all reach the mock's books.
How does an agent update a record?
Read the record, then POST its Id and current SyncToken with the changed fields. Set sparse: true to keep omitted fields. A stale SyncToken returns fault code 5010; read the latest record before trying again.
Can a test read reports after an agent records a payment?
Yes. Accrual profit and loss, balance sheet, trial balance, general ledger, receivables aging, payables aging, customer balance and vendor balance reports read the same books your agent changes. Use report dates to check balances as of a chosen day.
Can an agent retrieve changed records and submit batches?
GET / with entities and changedSince to retrieve changed records and deletion markers within 30 days. POST BatchItemRequest to / for up to 30 writes and queries. Each item returns its result or fault, and successful writes commit in request order.
Install the CLI and run your agent against the QuickBooks Online mock.
Intuit and QuickBooks are registered trademarks of Intuit Inc. Ancha is not affiliated with or endorsed by Intuit.