# Sage Intacct XML readByQuery Request Generator

> Source: https://netray.co/tools/sage-intacct-xml-readbyquery-request-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Build a ready-to-post XML request for the Sage Intacct web services gateway using readByQuery with your object, fields, query and page size.

## Category

developer

## Erp

Sage Intacct

## Audience

- Sage Intacct developer
- Integration engineer
- Finance systems analyst

## Tool

**Kind:** template

**Output:** code

**Language:** xml

**Fields:**

#### Sender ID

**Key:** sender_id

**Type:** text

**Default:** mysenderid

#### Sender password

**Key:** sender_pw

**Type:** text

**Default:** SENDER_PASSWORD

#### Web services user ID

**Key:** user_id

**Type:** text

**Default:** ws_user

#### Company ID

**Key:** company_id

**Type:** text

**Default:** MYCOMPANY

#### User password

**Key:** user_pw

**Type:** text

**Default:** USER_PASSWORD

#### Object

**Key:** object

**Type:** select

**Options:**

- GLACCOUNT
- VENDOR
- CUSTOMER
- APBILL
- ARINVOICE
- GLENTRY

**Default:** VENDOR

#### Fields (comma separated, or *)

**Key:** fields

**Type:** text

**Default:** VENDORID,NAME,STATUS

#### Query

**Key:** query

**Type:** text

**Default:** STATUS = 'active'

#### Page size

**Key:** pagesize

**Type:** number

**Default:** 100

**Blocks:**

#### POST to https://api.intacct.com/ia/xml/xmlgw.phtml

**Body:** <?xml version="1.0" encoding="UTF-8"?>
<request>
  <control>
    <senderid>{{sender_id}}</senderid>
    <password>{{sender_pw}}</password>
    <controlid>readbyquery-001</controlid>
    <uniqueid>false</uniqueid>
    <dtdversion>3.0</dtdversion>
    <includewhitespace>false</includewhitespace>
  </control>
  <operation>
    <authentication>
      <login>
        <userid>{{user_id}}</userid>
        <companyid>{{company_id}}</companyid>
        <password>{{user_pw}}</password>
      </login>
    </authentication>
    <content>
      <function controlid="f1">
        <readByQuery>
          <object>{{object}}</object>
          <fields>{{fields}}</fields>
          <query>{{query}}</query>
          <pagesize>{{pagesize}}</pagesize>
        </readByQuery>
      </function>
    </content>
  </operation>
</request>

**Notes:** Send with Content-Type text/xml. The sender ID and password are issued to the integration developer and the web services user must be granted API access in Intacct. Field names vary by object, and large result sets are paged with readMore, so check the object reference for your release. Escape ampersands and angle brackets in query values.

## Content

**Intro:** Sage Intacct exposes its data through an XML gateway. The readByQuery function is the workhorse for pulling vendors, customers, bills and accounts, and this generator produces a correct envelope.

**Sections:**

#### How to use the request

**Body:** Enter your sender credentials, your web services user and company ID, then choose the object, the fields and an optional query. Post the output to the gateway URL from Postman, curl or your own code. Start with a small page size and a narrow query to check authentication, then widen the filter once it returns the rows you expect.

#### Structure of the envelope

**Body:** A request has a control block that identifies the sender, and an operation block holding authentication and content. Inside content each function carries its own controlid so responses can be matched. readByQuery returns a result with a numremaining count and a resultId, and you continue with readMore until nothing remains. Sender and user are separate identities, which surprises many first-time developers.

**Bullets:**

- Use unique control IDs in batched requests
- Page with readMore, not a very large pagesize
- Store credentials outside source control

#### Common mistakes

**Body:** Typical errors include confusing the sender ID with the user ID, forgetting to authorize the sender in the company's Web Services authorizations, and using display labels instead of object field names. Unescaped characters in the query cause malformed XML, and a company with multi-entity setup may need a location ID in the login block.

**Cta:** If you pull Intacct data into planning or reporting regularly, we can help design a secure integration. Ask about an integration review.

**Faq:**

#### What is the gateway URL?

**Answer:** Requests are posted to https://api.intacct.com/ia/xml/xmlgw.phtml as XML. The same endpoint accepts all functions, with the operation described inside the document.

#### What is the difference between sender and user?

**Answer:** The sender identifies the developer or application and is authorized per company. The user is the company user whose permissions the request runs under. Both are required.

#### How do I page through large results?

**Answer:** readByQuery returns a result ID and the number of records remaining. Call readMore with that result ID until the remaining count reaches zero.

#### Is there a newer API than XML?

**Answer:** Intacct also offers a REST API in newer releases. The XML gateway remains widely used, so confirm which suits your project and what your version supports.

## Search terms

sage intacct xml api example, sage intacct readbyquery, sage intacct xml gateway, sage intacct api get vendors, sage intacct web services request, intacct api query filter

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
