CloseCore
Back to blog
ERP Integrations

How to Export a NetSuite Trial Balance: Excel, Google Sheets & API

Get a NetSuite trial balance into Excel or Google Sheets, from a one-time export to an automated refresh. Includes CSV steps, API examples, and checks to make sure balances match NetSuite.

Albert Lo
Albert Lo
May 29, 2026•2 min read

To export a NetSuite trial balance to Excel, run the Trial Balance report and download it as Excel or CSV. For Google Sheets, import that file. For recurring refreshes, use an API integration or spreadsheet connector.

NetSuite's SOAP getPostingTransactionSummary is particularly useful for automated extraction: it returns summarized posting amounts, and Oracle documents no direct REST equivalent. This guide covers the export steps, SOAP request, and SuiteQL alternative.

Export a NetSuite trial balance to Excel or Google Sheets

  1. Open Reports > Financial > Trial Balance.
  2. Choose the reporting date or period and, in OneWorld, Subsidiary Context.
  3. Click Refresh, then use the Excel or CSV export icon in the report footer.
  4. Save the file with its subsidiary and reporting period so you can identify it later.

Your role needs Export Lists permission. Oracle documents the report filters and export controls.

For Google Sheets, select File > Import > Upload, choose the file and import location, check the separator, then select Import data, following Google's instructions. Check that account numbers retain leading zeros and balances are numeric. Both downloads and imports are snapshots, so repeat them when the source balances change.

Use NetSuite APIs for automated trial balance exports

For programmatic extraction, the two methods covered here are:

  • SOAP getPostingTransactionSummary: server-side posting summaries by account, period, and other supported dimensions.
  • SuiteQL on transactionaccountingline: SQL-like aggregation with custom filters and transaction-detail access.

There is no trial balance record in the REST Record API. Oracle's operation mapping also lists no REST equivalent of getPostingTransactionSummary. SuiteQL through REST reconstructs balances rather than providing that summary operation.

Once extracted, a script can join account IDs to numbers and names, export balances to CSV for Excel, or write rows through the Google Sheets API. Keep subsidiary, period, currency, and refresh time with the output. A connector can handle this recurring work without a custom script.

Before you begin: permissions and authentication

The integration role needs both the Financial Statements and SOAP Web Services permissions. It also needs access to the subsidiaries being queried. For SuiteQL over REST, enable REST Web Services and the required query permissions.

The samples assume authentication is already configured. SOAP can use Token-Based Authentication with the appropriate SOAP authentication header. Oracle recommends OAuth 2.0 for REST, which does not authenticate the SOAP sample.

Option 1: SOAP getPostingTransactionSummary

Use getPostingTransactionSummary when you primarily need summarized GL balances. Specify the grouping fields and filters rather than downloading every underlying posting.

Oracle describes summaries similar to financial reports, not guaranteed copies of every UI calculation. Parent-currency consolidation requires programmatic exchange-rate calculation.

Lifecycle, October 22, 2026: Oracle lists 2025.2 as the last planned SOAP endpoint, limits support to it from 2027.1, and plans SOAP removal in 2028.2. SOAP remains useful today, but integrations need a migration plan. See Oracle's timeline.

We hope Oracle will add a REST equivalent of getPostingTransactionSummary before SOAP deprecation.

Build the SOAP request

Group by account, filter by subsidiary and periods, and supply pageIndex. Add the authentication header and enclosing envelope, declaring platformCore with the matching urn:core_2025_2.platform.webservices.netsuite.com namespace.

The sample includes the opening-balance period internalId="-1" for balance sheet accounts. Confirm its treatment against your report alongside the selected real periods.

typescript
const body = `
  <getPostingTransactionSummary xmlns="urn:messages_2025_2.platform.webservices.netsuite.com">
    <fields>
      <platformCore:account>true</platformCore:account>
    </fields>
    <filters>
      <platformCore:period>
        ${includeOpeningBalance ? '<platformCore:recordRef internalId="-1" type="accountingPeriod"/>' : ''}
        ${periodIds.map((id) => `<platformCore:recordRef internalId="${id}" type="accountingPeriod"/>`).join('')}
      </platformCore:period>
      <platformCore:subsidiary>
        <platformCore:recordRef internalId="${subsidiaryId}" type="subsidiary"/>
      </platformCore:subsidiary>
      ${accountIds?.length
        ? `<platformCore:account>
             ${accountIds.map((id) => `<platformCore:recordRef internalId="${id}" type="account"/>`).join('')}
           </platformCore:account>`
        : ''}
    </filters>
    <pageIndex>${pageIndex}</pageIndex>
  </getPostingTransactionSummary>
`;

Read the first response's totals, retrieve every remaining page using pageIndex, and concatenate the rows. Join account internal IDs to your account list for account numbers and names. Reject failed or incomplete responses.

Separate balance sheet and P&L periods

Balance sheet accounts carry balances forward, so include history through period end. P&L requires a defined reporting range. Oracle's standard Trial Balance describes calendar-year-to-date P&L behavior and calculated cumulative net income in retained earnings. September-only activity is not automatically the September trial balance.

This pattern assumes account and period lookup helpers. Set periodStart to the reporting basis you intend to reproduce.

typescript
const balanceSheetAccounts   = await getAllAccounts({ type: 'balance_sheet' })     || [];
const incomeStatementAccounts = await getAllAccounts({ type: 'income_statement' }) || [];

const periodsThroughEnd  = await getAllPeriods({ to: periodEnd });
const periodsInRange     = await getAllPeriods({ from: periodStart, to: periodEnd });

const results = [];

if (balanceSheetAccounts.length) {
  results.push(
    ...(await getPostingTransactionSummary({
      subsidiaryId,
      periodIds: periodsThroughEnd.map((p) => p.id),
      accountIds: balanceSheetAccounts.map((a) => a.id),
      includeOpeningBalance: true,
    })),
  );
}

if (incomeStatementAccounts.length) {
  results.push(
    ...(await getPostingTransactionSummary({
      subsidiaryId,
      periodIds: periodsInRange.map((p) => p.id),
      accountIds: incomeStatementAccounts.map((a) => a.id),
      includeOpeningBalance: false,
    })),
  );
}

return results;

Option 2: SuiteQL on transactionaccountingline

SuiteQL runs through REST's query/v1/suiteql endpoint. transactionaccountingline holds accounting amounts, while the joined transaction and line records supply period and subsidiary context.

This minimal call needs your account-specific URL and REST authentication:

typescript
await fetch('/services/rest/query/v1/suiteql?limit=1000', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', Prefer: 'transient' },
  body: JSON.stringify({ q: query }),
});

Check the response and follow its pagination information to retrieve all results. The SQL placeholders below are illustrative.

Income statement accounts

Sum the selected P&L account types within your reporting range for one subsidiary:

sql
SELECT SUM(TAL.amount)  AS glamount,
       A.acctnumber     AS acctnumber,
       A.id             AS id
FROM   transactionaccountingline TAL
       LEFT JOIN transaction       T  ON T.id  = TAL.transaction
       LEFT JOIN account           A  ON A.id  = TAL.account
       LEFT JOIN transactionline   TL ON TL.transaction = TAL.transaction
                                     AND TL.id = TAL.transactionline
       LEFT JOIN accountingperiod  AP ON AP.id = T.postingperiod
WHERE  TL.subsidiary = :subsidiaryId
  AND  TAL.posting   = 'T'
  AND  A.accttype IN ('Income', 'Expense', 'OthIncome', 'OthExpense', 'COGS')
  AND  AP.startdate >= TO_DATE(:periodStart, 'YYYYMMDD')
  AND  AP.enddate   <= TO_DATE(:periodEnd,   'YYYYMMDD')
GROUP BY A.id, A.acctnumber

Balance sheet accounts

Remove the start-date filter to include history through period end:

sql
SELECT SUM(TAL.amount)  AS glamount,
       A.acctnumber     AS acctnumber,
       A.id             AS id
FROM   transactionaccountingline TAL
       LEFT JOIN transaction       T  ON T.id  = TAL.transaction
       LEFT JOIN account           A  ON A.id  = TAL.account
       LEFT JOIN transactionline   TL ON TL.transaction = TAL.transaction
                                     AND TL.id = TAL.transactionline
       LEFT JOIN accountingperiod  AP ON AP.id = T.postingperiod
WHERE  TL.subsidiary = :subsidiaryId
  AND  TAL.posting   = 'T'
  AND  A.accttype NOT IN ('Income', 'Expense', 'OthIncome', 'OthExpense',
                          'COGS', 'NonPosting')
  AND  AP.enddate   <= TO_DATE(:periodEnd, 'YYYYMMDD')
GROUP BY A.id, A.acctnumber

Keep the join on transaction-line ID to avoid multiplying amounts across unrelated lines. TAL.posting = 'T' excludes non-posting lines. These examples assume one accounting book and subsidiary-base-currency reporting. Add the appropriate book filter for Multi-Book accounts, and handle retained earnings and report-calculated values separately.

SOAP versus SuiteQL

Concern

SOAP summary

SuiteQL

Main use

Summarized GL balances

Custom aggregation and detail

Report matching

Check settings, calculated values, and currency

Implement reporting rules yourself

Performance

Very fast. Server-side summaries

Very slow. Server-side SQL aggregation

Custom filters

Operation-supported fields

Available query schema

Authentication

SOAP-supported authentication, such as TBA

REST, preferably OAuth 2.0

Recommendation: Use SOAP for summarized balance extraction today. SOAP is much faster. Use SuiteQL when you need the actual underlying transaction detail and filters not covered by SOAP query options.

Using a trial balance to tie-out account reconciliations

During month-end close, many teams use a trial balance export from NetSuite as the source of truth for tying out reconciliation workpapers.

It's very useful to have an automated process for extracting the trial balance rather than manually exporting the trial balance from the NetSuite web interface and pasting it into a month-end close schedule.

You can use the code examples from this article to build your own automated trial balance extraction process.

If you want a tool that can extract the trial balance on an automated schedule and tie-out against reconciliation workpapers, look at close management tools like CloseCore.

Close management tools can help you catch late-posting entries and reconciliation errors and drill down to the transactions that cause the difference.

Refresh your NetSuite trial balance directly from Excel

CloseCore's add-in for Excel connects ERP data to spreadsheets with one-click collection, scheduled refreshes, and transaction drill-down.

Start with one recurring reconciliation: refresh its NetSuite balance after late journals and compare it with the matching report. The Excel setup guide covers connecting the workbook.

How to Export a NetSuite Trial Balance: Excel, Google Sheets & API | CloseCore