npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cafeasp/n8n-nodes-netsuite-restlet-suiteql

v1.1.0

Published

n8n node for NetSuite RESTlet and SuiteQL operations with OAuth 1.0a authentication

Readme

n8n-nodes-netsuite-restlet-suiteql

This is an n8n community node that lets you interact with NetSuite using OAuth 1.0a authentication. It supports both RESTlet operations and SuiteQL queries.

n8n is a fair-code licensed workflow automation platform.

Features

  • OAuth 1.0a Authentication: Secure authentication using NetSuite's OAuth 1.0a standard
  • SuiteQL Support: Execute SQL-like queries against your NetSuite data
    • Automatic Pagination: Fetch all pages of results automatically
    • Configurable Limits: Control the number of results per page
    • Smart OAuth Handling: Proper signature generation for paginated requests
  • RESTlet Operations: Call custom NetSuite RESTlet scripts
    • Automatic Pagination: Fetch all pages of results with configurable start/end indices
    • Flexible Configuration: Customize field names for pagination and results
    • Custom Company URL: Support for different RESTlet domains
    • File Upload: Upload PDF, Excel, and CSV files to NetSuite via RESTlet
  • Record Operations: Full CRUD operations on NetSuite records
    • Create records with optional Duplicate Detection
    • Get records by ID
    • Update records (PUT and PATCH)
    • Post actions to records
    • Transform records (e.g., Sales Order to Invoice)

Installation

Follow the installation guide in the n8n community nodes documentation.

npm

npm install n8n-nodes-netsuite-restlet-suiteql

n8n

  1. Go to Settings > Community Nodes
  2. Select Install
  3. Enter n8n-nodes-netsuite-restlet-suiteql in the Package Name field
  4. Click Install

Configuration

Prerequisites

Before using this node, you need to set up OAuth 1.0a authentication in NetSuite:

  1. Create an Integration Record:

    • Navigate to Setup > Integration > Manage Integrations > New
    • Check "Token-Based Authentication"
    • Save and note down the Consumer Key and Consumer Secret
  2. Create an Access Token:

    • Navigate to Setup > Users/Roles > Access Tokens > New
    • Select your Integration, User, and Role
    • Save and note down the Token ID and Token Secret

Credentials

When setting up the NetSuite OAuth1 API credentials in n8n, you'll need:

  • Account ID: Your NetSuite account ID
  • Company URL: Your NetSuite SuiteTalk API URL (e.g., 1234567.suitetalk.api.netsuite.com)
  • RESTlet Company URL (optional): Your NetSuite RESTlet API URL (e.g., 1234567.restlets.api.netsuite.com). Leave empty to use the Company URL above.
  • Consumer Key: From your Integration record
  • Consumer Secret: From your Integration record
  • Token Key: Token ID from your Access Token
  • Token Secret: Token Secret from your Access Token

Operations

SuiteQL

Execute SQL-like queries against your NetSuite data with automatic pagination support.

Parameters

  • Query: The SuiteQL query to execute
  • Return All Pages: Toggle to automatically fetch all pages of results
    • When enabled: Automatically follows pagination links until all data is retrieved
    • When disabled: Returns only the specified number of results
  • Limit: Maximum number of results per page (1-1000, only visible when "Return All Pages" is disabled)

Pagination

When "Return All Pages" is enabled, the node will:

  • Execute your query and retrieve the first page of results
  • Automatically detect if more data is available (via hasMore field)
  • Follow the next link in the response to fetch subsequent pages
  • Combine all items from all pages into a single result
  • Return the complete dataset with proper OAuth authentication for each request

This eliminates the need to manually handle pagination when working with large datasets.

Example Query:

SELECT id, companyName, email FROM customer WHERE subsidiary = '1' LIMIT 10

Example Query with Pagination:

SELECT
    Item.id,
    Item.itemId as sku,
    SUM(InventoryBalance.quantityAvailable) as total_quantity
FROM
    Item
LEFT JOIN
    InventoryBalance ON InventoryBalance.item = Item.id
WHERE
    BUILTIN.DF(Item.itemType) IN ('Assembly/Bill of Materials','Inventory Item')
    AND Item.isinactive = 'F'
GROUP BY
    Item.id, Item.itemId
ORDER BY
    Item.id ASC

With "Return All Pages" enabled, this query will automatically fetch all inventory items across multiple pages.

RESTlet Operations

Call custom NetSuite RESTlet scripts with automatic pagination support and file upload capabilities.

Call RESTlet

Execute a custom RESTlet script with optional automatic pagination.

Parameters

  • Script ID: The Script ID of your RESTlet (e.g., customscript_my_restlet)
  • Deploy ID: The Deploy ID of your RESTlet (e.g., customdeploy_my_restlet)
  • Body: JSON body to send to the RESTlet
  • Return All: Toggle to automatically paginate through all results
    • When enabled: Additional pagination options appear
  • Page Size: Number of records to fetch per page (default: 1000)
  • Start Index Field: Field name in the request body for the start index (default: start)
  • End Index Field: Field name in the request body for the end index (default: end)
  • Results Field: Field name in the response containing the results array (default: results)

Pagination

When "Return All" is enabled, the node will:

  • Automatically increment the start/end index fields in your request body
  • Make multiple requests to fetch all pages of data
  • Stop when it receives fewer results than the page size (indicating the last page)
  • Combine all results into a single response with a total count

Example Body (without pagination):

{
  "id": "19405",
  "type": "savesearchdata",
  "start": 0,
  "end": 1000
}

Example with Pagination Enabled:

  • Set "Return All" to true
  • Set "Page Size" to 1000
  • Set "Start Index Field" to start
  • Set "End Index Field" to end
  • Set "Results Field" to results
  • The node will automatically update start and end values in each request

The response will contain:

{
  "results": [...all items from all pages...],
  "total": 5432
}

Upload File

Upload PDF, Excel, or CSV files to NetSuite via a RESTlet endpoint. The node automatically converts the file to base64 and determines the file type from the extension.

Parameters:

  • RESTlet Script ID: The numeric Script ID of your upload RESTlet (e.g., 123)
  • RESTlet Deployment ID: The numeric Deployment ID (e.g., 1)
  • Folder ID: The internal ID of the destination folder in NetSuite
  • File Name: The name for the uploaded file (defaults to {{ $binary.data.fileName }})

Supported File Types:

  • PDF files (.pdf) - Automatically detected as PDF type
  • Excel files (.xlsx, .xls) - Automatically detected as EXCEL type
  • CSV files (.csv) - Automatically detected as CSV type

Request Body Sent:

{
  "postType": "uploadFile",
  "folderId": "12345",
  "name": "document.pdf",
  "base64Content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iai...",
  "fileType": "PDF"
}

Prerequisites:

  • Your RESTlet must accept file upload requests with the structure above
  • The RESTlet should create a file record in NetSuite using the base64 content
  • Input data must contain binary data (use Read/Download Binary File node before this)

Example Workflow:

  1. Use "HTTP Request" or "Read Binary File" node to get a file
  2. Connect to the NetSuite node
  3. Select Resource: RESTlet
  4. Select Operation: Upload File
  5. Configure the RESTlet IDs and folder ID
  6. The file will be uploaded automatically

Record Operations

Create

Create a new record in NetSuite. Returns the newly created record's ID and location.

Duplicate Detection (optional): Enable to check for existing duplicates before creating a record. When enabled, the node runs a SuiteQL query to look up matching field values. If a duplicate is found, the creation is skipped and a marker is output instead.

  • Duplicate Detection: Toggle on/off (default: off)
  • SuiteQL Table Name: The SuiteQL table to query (e.g., transaction for salesOrder, entity for customer). Note: SuiteQL table names differ from REST API record types.
  • Duplicate Check Fields: One or more field mappings (combined with AND logic):
    • NetSuite Field: The internal field name to check (e.g., otherrefnum)
    • Match Value: The value to match against (supports expressions, e.g., ={{ $json.poNumber }})

When a duplicate is found, the node outputs:

{
  "skipped": true,
  "reason": "duplicate",
  "duplicateId": "12345",
  "recordType": "salesOrder",
  "matchedFields": { "otherrefnum": "PO-1234", "entity": "42" }
}

Example Body:

{
  "entity": "12345",
  "trandate": "2024-12-04",
  "item": {
    "items": [
      {
        "item": "123",
        "quantity": 1,
        "rate": 100
      }
    ]
  }
}

Response:

{
  "id": "54321",
  "location": "/services/rest/record/v1/salesOrder/54321"
}

The node automatically extracts the record ID from the Location header returned by NetSuite.

Get

Retrieve a record by its internal ID.

Update (PUT)

Replace an entire record with new data.

Update (PATCH)

Update specific fields of a record without replacing the entire record.

Post Action

Post a specific action to a record.

Transform

Transform one record type into another (e.g., Sales Order to Invoice).

Parameters:

  • Record Type: The source record type (e.g., salesOrder)
  • Target Record Type: The destination record type (e.g., invoice)
  • Record ID: The ID of the source record
  • Body: Optional JSON to override fields in the transformed record

Delete

Delete a record by internal ID.

| Parameter | Description | |------------|------------------------------------------------| | Record Type | The record type (e.g., salesOrder, customer) | | Record ID | The internal ID of the record to delete |

Output:

{
  "deleted": true,
  "recordType": "salesOrder",
  "recordId": "12345"
}

Resources

Version History

1.0.13

  • Added Duplicate Detection for Record > Create operation
    • Optional SuiteQL-based pre-check before creating records
    • Configurable field mappings with AND logic for matching
    • Skips duplicate creation with informative output marker
    • Input validation and SQL injection prevention

1.0.3

  • Added file upload capability to RESTlet operations
  • Support for uploading PDF and Excel files to NetSuite
  • Automatic file type detection based on extension
  • Base64 encoding handled automatically

1.0.0

  • Initial release
  • SuiteQL query execution with automatic pagination support
  • Return All Pages feature for fetching complete datasets
  • Configurable limit per page (1-1000 results)
  • RESTlet operations with automatic pagination
    • Configurable start/end index fields
    • Configurable results field name
    • Custom RESTlet Company URL support
  • Full Record CRUD operations
  • OAuth 1.0a authentication with proper signature handling for paginated requests
  • Record transformation support

License

MIT

Support

For issues, questions, or contributions, please visit the GitHub repository.

Author

cafeasp


Note: This is a community-maintained node and is not officially supported by n8n or Oracle NetSuite.