This documentation covers the NetSuite integration APIs that provide access to financial data and SQL query execution capabilities. All APIs require proper authentication and return JSON responses.
https://api.eaconnect.io
All endpoints require two levels of authentication:
token_id
: NetSuite access token IDclient_id
: NetSuite consumer/integration keyclient_secret
: NetSuite consumer/integration secrettoken_secret
: NetSuite access token secretaccount
: NetSuite account IDRetrieves and processes balance sheet data including income statement calculations and retained earnings.
Endpoint
POST /api/netsuite/balance-sheet
Headers
ea-api-key: <your-api-key>
Content-Type: application/json
Request Body
json
{ "target_period": "2024-03-31", // Target period end date (YYYY-MM-DD) "target_subsidiary_id": "1", // NetSuite subsidiary ID "re_accounts": "3000,3010", // Comma-separated retained earnings account numbers "token_id": "xxxxx", // NetSuite token ID "client_id": "xxxxx", // NetSuite client key "client_secret": "xxxxx", // NetSuite client secret "token_secret": "xxxxx", // NetSuite token secret "account": "123456" // NetSuite account ID }
Response
json
[ { "account": "1000", "account_name": "Cash", "subsidiary": "Main Company", "amount": 150000.50, "currency": "USD" }, { "account": "RE", "account_name": "Retained Earnings", "subsidiary": "Main Company", "amount": 250000.00, "currency": "USD" }, { "account": "NE", "account_name": "Net Income", "subsidiary": "Main Company", "amount": 50000.00, "currency": "USD" } ]
Processing Logic
Executes SuiteQL queries against NetSuite with automatic pagination support.
Endpoint
POST /api/netsuite/sql
Headers
ea-api-key: <your-api-key>
Content-Type: application/json
Request Body
json
{ "sql": "SELECT id, name, currency FROM subsidiary WHERE isinactive = 'F'", "url": "custom-url", // Optional: custom endpoint URL "token_id": "xxxxx", // NetSuite token ID "client_id": "xxxxx", // NetSuite client key "client_secret": "xxxxx", // NetSuite client secret "token_secret": "xxxxx", // NetSuite token secret "account": "123456" // NetSuite account ID }
Response
json
[ { "id": "1", "name": "Main Company", "currency": "USD" }, { "id": "2", "name": "European Branch", "currency": "EUR" } ]
Invalid or missing API key
json
{ "statusCode": 401, "message": "Invalid API key", "error": "Unauthorized" }
NetSuite connection or query execution failure
json
{ "statusCode": 500, "message": "Error message details", "error": "Internal Server Error" }
bash
curl -X POST https://api.eaconnect.io/api/netsuite/balance-sheet \ -H "ea-api-key: your-api-key" \ -H "Content-Type: application/json" \ -d '{
"target_period": "2024-03-31",
"target_subsidiary_id": "1",
"re_accounts": "3000",
"token_id": "your-token-id",
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"token_secret": "your-token-secret",
"account": "123456"
}'
bash
curl -X POST https://api.eaconnect.io/api/netsuite/sql \ -H "ea-api-key: your-api-key" \ -H "Content-Type: application/json" \ -d '{
"sql": "SELECT * FROM account WHERE accttype = '\''Bank'\''",
"token_id": "your-token-id",
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"token_secret": "your-token-secret",
"account": "123456"
}'
sql
SELECT id, name, currency
FROM subsidiary
WHERE isinactive = 'F'
sql
SELECT a.acctnumber, a.fullname, ab.balance, ab.subsidiary, ab.postingperiod
FROM account a
JOIN AccountBalance ab ON a.id = ab.account
WHERE ab.postingperiod = '123'
sql
SELECT fromcurrency, tocurrency, currentrate, averagerate, historicalrate, postingperiod
FROM consolidatedexchangerate
WHERE postingperiod = '123'
For issues or questions:
ea-api-key: <your-api-key>