Prompt
How do I write invoices programmatically to Sage Intacct?
Latest observation
To write invoices programmatically to Sage Intacct, you typically use the Sage Intacct Web Services API to create AR invoices (accounts receivable invoices). The exact approach depends on whether you’re integrating directly via XML web services, using a middleware/SDK, or using the REST APIs available in your edition.
High-level flow
- Authenticate to Sage Intacct using an API session.
- Create the invoice object in the correct module:
- Usually Accounts Receivable (ARInvoice) for customer invoices
- Sometimes AP Bill if you mean vendor bills
- Add line items with the required dimensions and account info.
- Submit/commit the transaction and handle the response.
- Store returned IDs for later updates, payments, or reconciliation.
Common approach: XML Web Services API
Sage Intacct’s classic API is XML-based. You send a <request> containing an <operation> with a <create> for the ARINVOICE object.
Example XML to create an AR invoice
<?xml version="1.0" encoding="utf-8"?>
<request>
<control>
<senderid>SENDER_ID</senderid>
<password>SENDER_PASSWORD</password>
<controlid>unique-control-id-123</controlid>
<uniqueid>true</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="create-ar-invoice">
<create>
<ARINVOICE>
<CUSTOMERID>CUST-001</CUSTOMERID>
<DATECREATED>
<year>2026</year>
<month>11</month>
<day>3</day>
</DATECREATED>
<TERMNAME>Net 30</TERMNAME>
<REFERENCENO>INV-10001</REFERENCENO>
<MESSAGE>Consulting services</MESSAGE>
<ARINVOICEITEMS>
<ARINVOICEITEM>
<ACCOUNTNO>4000</ACCOUNTNO>
<AMOUNT>1500.00</AMOUNT>
<DESCRIPTION>Professional services</DESCRIPTION>
</ARINVOICEITEM>
</ARINVOICEITEMS>
</ARINVOICE>
</create>
</function>
</content>
</operation>
</request>
Important fields
Depending on your configuration, you may need some or all of these:
- CUSTOMERID – customer record in Intacct
- DATECREATED – invoice date
- TERMNAME – payment terms
- REFERENCENO – invoice number/reference
- MESSAGE – header memo
- ARINVOICEITEMS / ARINVOICEITEM – line items
- ACCOUNTNO – revenue account
- AMOUNT – line amount
- DESCRIPTION – line description
- Additional dimensions such as:
LOCATIONIDDEPARTMENTIDPROJECTIDCLASSIDCUSTOMERRECORDNOorARINVOICEcustom fields if enabled
Example using Python
If you’re writing directly to the XML API, you can POST the XML payload to Intacct’s endpoint.
import requests
url = "https://api.intacct.com/ia/xml/xmlgw.phtml"
xml_payload = """<?xml version="1.0" encoding="utf-8"?>
<request>
<control>
<senderid>SENDER_ID</senderid>
<password>SENDER_PASSWORD</password>
<controlid>unique-control-id-123</controlid>
<uniqueid>true</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="create-ar-invoice">
<create>
<ARINVOICE>
<CUSTOMERID>CUST-001</CUSTOMERID>
<DATECREATED>
<year>2026</year><month>11</month><day>3</day>
</DATECREATED>
<TERMNAME>Net 30</TERMNAME>
<REFERENCENO>INV-10001</REFERENCENO>
<ARINVOICEITEMS>
<ARINVOICEITEM>
<ACCOUNTNO>4000</ACCOUNTNO>
<AMOUNT>1500.00</AMOUNT>
</ARINVOICEITEM>
</ARINVOICEITEMS>
</ARINVOICE>
</create>
</function>
</content>
</operation>
</request>"""
resp = requests.post(url, data=xml_payload, headers={"Content-Type": "application/xml"})
print(resp.status_code)
print(resp.text)
Using Sage Intacct SDKs
Sage Intacct provides SDKs/libraries in some languages that help build XML requests more safely. If available for your language, using the SDK is usually better than hand-crafting XML because it handles:
- authentication
- XML formatting
- field escaping
- response parsing
A few implementation tips
- Use a unique controlid for idempotency and easier debugging.
- Make sure the customer exists before creating the invoice.
- Validate required dimensions/accounting setup in your Intacct company.
- If you need to create draft vs posted invoices, check your company’s workflow and object settings.
- For high-volume integrations, consider batching, retry logic, and logging the returned
recordno.
If you meant AP invoices instead of AR invoices
For vendor invoices/bills, you’d create an APBILL object instead of ARINVOICE.
If you want, I can give you:
- a fully working Python example using the Intacct SDK or raw XML,
- a Node.js example, or
- the exact XML fields needed for your invoice scenario.
Brands