SAC-API: A NetSuite Web API Powered by SuiteAnalytics Connect

Published on September 2, 2024.

For me, Summer 2024 was an interesting balance of relaxation and productivity. I somehow managed to take time off, work on a few client projects, and make headway on some of my side projects (including Suite.js and SuiteBrowser).

While working on those projects, a new project emerged. I'm calling it SAC-API, short for "SuiteAnalytics Connect Web API." It's essentially an alternative Web API for NetSuite, and it's powered by SuiteAnalytics Connect.

To use SAC-API, you send simple HTTP requests. Behind the scenes, the Web API uses SuiteAnalytics Connect to run SuiteQL queries and return the results.

Opening A Connection

You start by opening a connection to NetSuite, and giving the connection a name.

SAC-API supports multiple simultaneous open connections, and you can connect to multiple NetSuite instances. For example, you might have connections open to production and sandbox instances, and run queries to compare the instances.

When opening a connection, you authenticate using a NetSuite username and password, or by using an access (token based authentication).

Here's an example of a SAC-API call that opens a connection.

{
  "procedure": "OpenConnection",
  "name": "Connection1",
  "authMethod": "TBA",
  "nsAccountNumber": "9999999",
  "nsConsumerKey": "d1eee9f174db228a1f867248a9d2fd684321a12de693693300f3619a1c49990",
  "nsConsumerSecret": "207b2ea32d48e313ce1cee1a78bbea10051eb26537d144a88791901b69b51eb9",
  "nsRoleID": 57,
  "nsServiceHost": "9999999.connect.api.netsuite.com",
  "nsServicePort": 1708,
  "nsTokenID": "030460af6857a298acb0e089c2311583b445e65ecb2508f3c4021ff676a64367",
  "nsTokenSecret": "6c4fa0f83a58d9b5f9ab890121d2ca06e15d8428df3390429bfd344cb0b0b323e1"
}

In the example above, token based authentication (TBA) is being used. One of the really nice things about SAC-API's support for TBA is that you can use the special Data Warehouse Integrator role, which provides access to all of the tables.

Running A Query and Fetching the Results

Next, you use the "RunQuery" procedure to specify the SuiteQL query that you want to run. You can set the "returnRows" value to True to have all of the resulting rows returned immediately, or you can set it to False to iterate through the rows one by one.

{
  "procedure": "RunQuery",
  "connectionName": "Connection1",
  "returnRows": false,
  "queryName": "Employees",
  "query": "SELECT ID, Email FROM Employee"
}

In the example above, I'm requesting the ID and Email values for all records in the Employee table. Notice that I've indicated that I want to fetch the rows individually.

To retrieve the resulting rows, you use the "GetNextRow" procedure, like this.

{
  "procedure": "GetNextRow",
  "connectionName": "Connection1",
  "queryName": "Employees"
}

In this example, the response would look something like this.

{
  "id": "13703791",
  "email": "timdietrich@me.com"
}

You'd continue to use the "GetNextRow" procedure until the API response indicates that no additional rows are available.

Wrapping Up

SAC-API runs on macOS, Windows, and Linux.

SAC-API is available for $995.00 USD per year. That covers a NetSuite production instance, and all related sandbox and release preview instances.

Email-based technical support is included free of charge. Live, one-on-one, Zoom-based support sessions are also available, and the cost is $250 / hour.

SAC-API requires that NetSuite SuiteAnalytics Connect be enabled. If you don't already have SuiteAnalytics Connect enabled, you should talk to your NetSuite sales representative to get pricing.

If you're interested in SAC-API, please drop me a line.

About Me

Hello, I'm Tim Dietrich. I develop custom software for businesses that are running on NetSuite, including mobile apps, Web portals, Web APIs, and more.

I'm the developer of several popular NetSuite open source solutions, including the SuiteQL Query Tool, SuiteAPI, and more.

I founded SuiteStep, a NetSuite development studio, to provide custom software and AI solutions - and continue pushing the boundaries of what's possible on the NetSuite platform.

Copyright © 2025 Tim Dietrich.