# NetSuite SuiteScript and REST Error Codes Reference

> Source: https://netray.co/tools/netsuite-script-and-rest-error-codes-reference
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Common NetSuite error names and HTTP status codes with the usual cause and the first thing to check.

## Category

netsuite

## Erp

NetSuite

## Audience

- NetSuite developer
- Integration engineer
- Support analyst

## Tool

**Kind:** worksheet

**Mode:** reference

**Columns:**

#### Error name or status

**Key:** code

**Type:** text

#### Where you see it

**Key:** where

**Type:** text

#### Usual cause

**Key:** cause

**Type:** text

#### First thing to check

**Key:** fix

**Type:** text

**Rows:**

#### Script used more governance units than its type allows

**Code:** SSS_USAGE_LIMIT_EXCEEDED

**Where:** SuiteScript

**Fix:** Move heavy loops to Map/Reduce, use runPaged, avoid record.load inside loops

#### Script ran longer than the maximum execution time

**Code:** SSS_TIME_LIMIT_EXCEEDED

**Where:** SuiteScript

**Fix:** Reduce work per run or split across a queued or Map/Reduce task

#### An API call was made without a required argument

**Code:** SSS_MISSING_REQD_ARGUMENT

**Where:** SuiteScript

**Fix:** Read the message for the argument name and check the options object keys

#### Record or search type string is not valid

**Code:** SSS_INVALID_TYPE_ARG

**Where:** SuiteScript

**Fix:** Use the lowercase record type id and confirm the feature is enabled

#### API called in a context where it is not allowed

**Code:** SSS_INVALID_API_USAGE

**Where:** SuiteScript

**Fix:** Check the script type and mode, for example client versus server

#### URL passed to N/https or N/http is malformed

**Code:** SSS_INVALID_URL

**Where:** SuiteScript

**Fix:** Include the scheme and a full host, and encode query parameters

#### File content is larger than the allowed size

**Code:** SSS_FILE_CONTENT_SIZE_EXCEEDED

**Where:** SuiteScript

**Fix:** Split the file or reduce the payload before saving

#### Value is not valid for the field, such as a bad list id or date format

**Code:** INVALID_FLD_VALUE

**Where:** SuiteScript and REST

**Fix:** Check the field type and use internal ids for list fields

#### Reference points to a record or key that does not exist or is inactive

**Code:** INVALID_KEY_OR_REF

**Where:** SuiteScript and REST

**Fix:** Verify the internal id and that the target record is active

#### The record does not exist or the role cannot see it

**Code:** RCRD_DSNT_EXIST

**Where:** SuiteScript and REST

**Fix:** Confirm the id, record type and the role used by the script or token

#### Record was edited by another user or process after you loaded it

**Code:** RCRD_HAS_BEEN_CHANGED

**Where:** SuiteScript

**Fix:** Reload, reapply the change and save, or use submitFields for small edits

#### The role does not have the permission level required

**Code:** INSUFFICIENT_PERMISSION

**Where:** SuiteScript and REST

**Fix:** Check role permissions for the record type and script execute-as role

#### A validation or custom error was raised on purpose

**Code:** USER_ERROR

**Where:** SuiteScript and UI

**Fix:** Read the message text, which is usually written by a script or workflow

#### Server hit an error it could not classify

**Code:** UNEXPECTED_ERROR

**Where:** SuiteScript and REST

**Fix:** Check the Execution Log and System Notes, then retry with a simpler payload

#### Authentication failed for the supplied credentials or token

**Code:** INVALID_LOGIN_ATTEMPT

**Where:** Web services

**Fix:** Check account id, token values, role and that the integration is enabled

#### Request body or query is invalid

**Code:** HTTP 400

**Where:** REST

**Fix:** Validate the JSON shape and field names against the record metadata

#### Authentication missing or invalid

**Code:** HTTP 401

**Where:** REST and RESTlet

**Fix:** Check the signature, timestamp, token and account id in the Authorization header

#### Authenticated but not allowed

**Code:** HTTP 403

**Where:** REST and RESTlet

**Fix:** Check role permissions and the REST web services permission

#### Record or endpoint not found

**Code:** HTTP 404

**Where:** REST

**Fix:** Check the URL path, record type, internal id and account domain

#### Too many concurrent requests for the account

**Code:** HTTP 429

**Where:** REST and SOAP

**Fix:** Reduce parallel calls, add retry with backoff, review concurrency limits

**Notes:** Names and wording can vary by release and endpoint. Use this as a first-pass troubleshooting aid and confirm in the Execution Log, the response body and the Help Center.

## Content

**Intro:** When a script or an integration fails, the error name usually tells you where to look. This table lists common NetSuite SuiteScript error names and REST status codes with the likely cause and the first thing to check, so you can triage faster.

**Sections:**

#### How to use the list

**Body:** Search with the exact error name from the Execution Log, the script notification email or the REST response body. Read the cause column to confirm it fits, then work through the first check. The list is a triage aid, not a full catalog, and the message text on your own error often carries the field or argument name you need.

#### Governance and time errors

**Body:** The SSS_USAGE_LIMIT_EXCEEDED and SSS_TIME_LIMIT_EXCEEDED errors almost always point to design rather than a bug. Loading full records in a loop, running searches per line and doing network calls inside a save are the usual culprits. Switch to submitFields for small edits, page your searches, and move large jobs to Map/Reduce where NetSuite manages yielding and restarts.

**Bullets:**

- Log remaining usage with runtime.getCurrentScript().getRemainingUsage().
- Avoid record.load when a lookupFields call is enough.
- Batch outbound HTTP calls outside the save path.

#### Authentication and permission errors

**Body:** A 401 means the request was not authenticated, and a 403 or INSUFFICIENT_PERMISSION means the identity was recognised but lacks rights. With token-based authentication, the most common causes are a clock skew in the timestamp, a wrong account id format for sandbox, and a role missing the web services or log in using access tokens permission. Test with a role that has full rights on a sandbox to separate permission issues from signature issues.

**Cta:** If integration failures keep landing on your team, Netray can help review how your NetSuite integrations authenticate, retry and log, and suggest a monitoring approach.

**Faq:**

#### Where do I see SuiteScript errors?

**Answer:** Check the script deployment Execution Log, the script notification emails and, for web services, the response body. The Execution Log includes the error name, message and often a stack trace.

#### What does RCRD_HAS_BEEN_CHANGED mean?

**Answer:** It means the record was modified after your script loaded it, so saving would overwrite someone else's edit. Reload the record and reapply the change, or use submitFields for small targeted updates.

#### Why do I get 401 only in sandbox?

**Answer:** Sandbox account ids use a different format in the realm and URL than production. Using the production id with sandbox credentials is a very common cause of authentication failures.

#### Can I catch these errors in code?

**Answer:** Yes. Wrap calls in try and catch, read the name and message properties on the caught error, log them with N/log, and decide whether to retry or fail. Do not swallow errors without logging.

## Search terms

SSS_USAGE_LIMIT_EXCEEDED fix, INVALID_FLD_VALUE netsuite, netsuite RCRD_DSNT_EXIST, netsuite rest api 401 403 error, INSUFFICIENT_PERMISSION netsuite, suitescript error codes list, netsuite integration error troubleshooting

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
