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.

Connect your agent
The test
  • invoice_paid

    Invoice 2 has Balance 0

  • one_payment

    Exactly 1 Payment with CustomerRef.value 1

  • reminder_sent

    Invoice sent to accounts@ternwick.example

  • books_unchanged

    No 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_URL
  • QUICKBOOKS_REALM_ID
  • QUICKBOOKS_ACCESS_TOKEN
  • QUICKBOOKS_REFRESH_TOKEN
  • QUICKBOOKS_CLIENT_ID
  • QUICKBOOKS_CLIENT_SECRET
  • QUICKBOOKS_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

POST/v3/company/{realmId}/{entity}
GET/v3/company/{realmId}/{entity}/{id}
GET/v3/company/{realmId}/{entity}/{id}/pdf
POST/v3/company/{realmId}/{entity}/{id}/send
POST/v3/company/{realmId}/batch
GET/v3/company/{realmId}/cdc
GET/v3/company/{realmId}/download/{id}
GET/v3/company/{realmId}/exchangerate
GET/v3/company/{realmId}/query
POST/v3/company/{realmId}/query
GET/v3/company/{realmId}/reports/{report}
POST/v3/company/{realmId}/taxservice/taxcode
POST/v3/company/{realmId}/upload

oauth2

POST/oauth2/v1/tokens/bearer
POST/oauth2/v1/tokens/revoke
POST/v2/oauth2/tokens/revoke

Seed 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
          - JournalEntry

More payments and commerce tools

All 43 tools

QuickBooks 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 /v3/company/{QUICKBOOKS_REALM_ID}/.... Send QUICKBOOKS_ACCESS_TOKEN as a Bearer token. Responses are JSON; Accept: application/xml 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 /v3/company/{QUICKBOOKS_REALM_ID}/cdc with entities and changedSince to retrieve changed records and deletion markers within 30 days. POST BatchItemRequest to /v3/company/{QUICKBOOKS_REALM_ID}/batch 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.

Book a demo

Intuit and QuickBooks are registered trademarks of Intuit Inc. Ancha is not affiliated with or endorsed by Intuit.