Prompt
How do I get ledger data out of Sage Intacct via API?
Latest observation
To get ledger data out of Sage Intacct via API, you typically use the XML API (sometimes called the “Web Services API”), not a REST API. Intacct’s API is request/response XML over HTTPS.
1) What you can extract
For “ledger data,” you usually mean one or more of these:
- GL account balances
- Journal entries / GL detail
- Trial balance
- Ledger transactions
- Dimensions linked to entries, such as department, location, class, project, etc.
The exact object depends on whether you want:
- summary balances (
GLBALANCE/ report-style data) - transaction-level detail (
GLBATCH,GLENTRY, etc.) - report output via Intacct reporting endpoints
2) Basic approach
You’ll:
- Authenticate with API credentials
- Send an XML request for the object/report you need
- Parse the XML response
- Paginate through results if needed
3) API setup
You need:
- An Intacct sender ID / sender password or other API credentials
- A company/account id
- A user with permissions to the relevant GL data
- Endpoint access enabled in Intacct
4) Example: pull GL entries
A typical XML request looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<request>
<control>
<senderid>SENDER_ID</senderid>
<password>SENDER_PASSWORD</password>
<controlid>unique-control-id-123</controlid>
<uniqueid>false</uniqueid>
<dtdversion>3.0</dtdversion>
<includewhitespace>false</includewhitespace>
</control>
<operation>
<authentication>
<login>
<userid>API_USER</userid>
<companyid>COMPANY_ID</companyid>
<password>USER_PASSWORD</password>
</login>
</authentication>
<content>
<function controlid="get-gl-entries">
<readByQuery>
<object>GLBATCH</object>
<fields>*</fields>
<query>POSTED = 'T'</query>
<pagesize>100</pagesize>
</readByQuery>
</function>
</content>
</operation>
</request>
Notes:
GLBATCHmay not be the only object you need; sometimes you queryGLENTRYor use report endpoints.- Use
pagesizeand response pagination to handle larger datasets.
5) Example: pull ledger detail
If you want line-level postings, query the relevant object and include the fields you need, for example:
<readByQuery>
<object>GLENTRY</object>
<fields>RECORDNO,ACCOUNTNO,ACCOUNTTITLE,AMOUNT,TR_TYPE,ENTRYNO,POSTEDDATE,DESCRIPTION</fields>
<query>POSTED = 'T'</query>
<pagesize>100</pagesize>
</readByQuery>
Field names vary by Intacct object and your configuration, so you may need to inspect the object schema or use lookup/metadata-style calls.
6) Example: trial balance / balances
If you want ledger balances rather than transactions, use a balance object/report if available in your tenant, or a reporting API call that returns trial balance data. This is often better than summing transactions yourself.
7) Python example
Here’s a simple outline using requests:
import requests
url = "https://api.intacct.com/ia/xml/xmlgw.phtml"
xml = """<?xml version="1.0" encoding="UTF-8"?>
<request>
<control>
<senderid>SENDER_ID</senderid>
<password>SENDER_PASSWORD</password>
<controlid>test-001</controlid>
<uniqueid>false</uniqueid>
<dtdversion>3.0</dtdversion>
<includewhitespace>false</includewhitespace>
</control>
<operation>
<authentication>
<login>
<userid>API_USER</userid>
<companyid>COMPANY_ID</companyid>
<password>USER_PASSWORD</password>
</login>
</authentication>
<content>
<function controlid="get-gl">
<readByQuery>
<object>GLENTRY</object>
<fields>RECORDNO,ACCOUNTNO,AMOUNT,DESCRIPTION</fields>
<query>POSTED = 'T'</query>
<pagesize>100</pagesize>
</readByQuery>
</function>
</content>
</operation>
</request>"""
headers = {"Content-Type": "application/xml"}
resp = requests.post(url, data=xml, headers=headers, timeout=60)
print(resp.status_code)
print(resp.text)
8) Pagination
Intacct responses often include:
numremainingresult/data- page information
You usually loop until all pages are fetched, increasing offset or using page numbers depending on the call style.
9) Practical tips
- Use posted-only data unless you explicitly need drafts
- Determine whether you need:
- journal entry lines
- account balances
- trial balance
- full financial reports
- Be aware of dimension fields if you need segment reporting
- Test in a sandbox first
- Check permissions if results are empty
10) Best next step
If you tell me which ledger output you want:
- trial balance
- account balances
- journal entry detail
- general ledger transactions
- by period / by dimensions
…I can give you the exact Intacct XML request and a working Python example for that specific data.
Brands