docs/integrations/app-integrations/netsuite.mdx
This documentation describes the integration of MindsDB with Oracle NetSuite using the REST Record API and SuiteQL. It lets you query NetSuite data in SQL and run SuiteQL directly when you need full control over filtering and joins.
Before proceeding, ensure the following prerequisites are met:
Establish a connection to NetSuite from MindsDB by executing the following SQL command and providing its handler name as an engine.
CREATE DATABASE netsuite_datasource
WITH
ENGINE = 'netsuite',
PARAMETERS = {
"account_id": "123456_SB1",
"consumer_key": "ck_...",
"consumer_secret": "cs_...",
"token_id": "token_...",
"token_secret": "token_secret_..."
};
Required connection parameters include the following:
account_id: NetSuite account/realm ID (e.g. 123456_SB1)consumer_key: Integration consumer keyconsumer_secret: Integration consumer secrettoken_id: Access token IDtoken_secret: Access token secretOptional connection parameters include the following:
rest_domain: Override REST domain from Company Information (REST Web Services URL)record_types: Comma-separated record types to expose as tables (defaults to this list)To create the required credentials in NetSuite:
Retrieve data from a record table:
SELECT *
FROM netsuite_datasource.salesOrder
WHERE id = 48;
REST record tables:
WHERE id = ... (or internalId) to fetch a full record directly.q where possible; remaining filters are applied locally.Run SuiteQL directly using the native query syntax (recommended for complex filters):
SELECT * FROM netsuite_datasource (
SELECT id, tranid, total
FROM transaction
WHERE type = 'SalesOrd'
FETCH NEXT 5 ROWS ONLY
);