NetSuite SuiteScript and REST Error Codes Reference
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.
| Error name or status | Where you see it | Usual cause | First thing to check |
|---|---|---|---|
SSS_USAGE_LIMIT_EXCEEDED | SuiteScript | Script used more governance units than its type allows | Move heavy loops to Map/Reduce, use runPaged, avoid record.load inside loops |
SSS_TIME_LIMIT_EXCEEDED | SuiteScript | Script ran longer than the maximum execution time | Reduce work per run or split across a queued or Map/Reduce task |
SSS_MISSING_REQD_ARGUMENT | SuiteScript | An API call was made without a required argument | Read the message for the argument name and check the options object keys |
SSS_INVALID_TYPE_ARG | SuiteScript | Record or search type string is not valid | Use the lowercase record type id and confirm the feature is enabled |
SSS_INVALID_API_USAGE | SuiteScript | API called in a context where it is not allowed | Check the script type and mode, for example client versus server |
SSS_INVALID_URL | SuiteScript | URL passed to N/https or N/http is malformed | Include the scheme and a full host, and encode query parameters |
SSS_FILE_CONTENT_SIZE_EXCEEDED | SuiteScript | File content is larger than the allowed size | Split the file or reduce the payload before saving |
INVALID_FLD_VALUE | SuiteScript and REST | Value is not valid for the field, such as a bad list id or date format | Check the field type and use internal ids for list fields |
INVALID_KEY_OR_REF | SuiteScript and REST | Reference points to a record or key that does not exist or is inactive | Verify the internal id and that the target record is active |
RCRD_DSNT_EXIST | SuiteScript and REST | The record does not exist or the role cannot see it | Confirm the id, record type and the role used by the script or token |
RCRD_HAS_BEEN_CHANGED | SuiteScript | Record was edited by another user or process after you loaded it | Reload, reapply the change and save, or use submitFields for small edits |
INSUFFICIENT_PERMISSION | SuiteScript and REST | The role does not have the permission level required | Check role permissions for the record type and script execute-as role |
USER_ERROR | SuiteScript and UI | A validation or custom error was raised on purpose | Read the message text, which is usually written by a script or workflow |
UNEXPECTED_ERROR | SuiteScript and REST | Server hit an error it could not classify | Check the Execution Log and System Notes, then retry with a simpler payload |
INVALID_LOGIN_ATTEMPT | Web services | Authentication failed for the supplied credentials or token | Check account id, token values, role and that the integration is enabled |
HTTP 400 | REST | Request body or query is invalid | Validate the JSON shape and field names against the record metadata |
HTTP 401 | REST and RESTlet | Authentication missing or invalid | Check the signature, timestamp, token and account id in the Authorization header |
HTTP 403 | REST and RESTlet | Authenticated but not allowed | Check role permissions and the REST web services permission |
HTTP 404 | REST | Record or endpoint not found | Check the URL path, record type, internal id and account domain |
HTTP 429 | REST and SOAP | Too many concurrent requests for the account | Reduce parallel calls, add retry with backoff, review concurrency limits |
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.
Integration health review
Optional: share how your NetSuite integrations run today and we will suggest logging and retry improvements.
Optional. The tool and every export work without this. No spam.
How to use the list
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
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.
- 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
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.
Frequently Asked Questions
Where do I see SuiteScript errors?
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?
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?
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?
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.
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.
Related Tools
SuiteScript Script Types and Entry Points Reference
Every SuiteScript 2.x script type with its entry point functions, typical use and governance guidance in one searchable table.
NetSuiteSuiteScript 2.1 RESTlet Skeleton Generator
Fill in a few fields and get a SuiteScript 2.1 RESTlet starter with all four handlers, logging and structured error responses.
NetSuiteSuiteScript Code Review Checklist
A practical review checklist for SuiteScript 2.x covering structure, governance, error handling, security and deployment.
NetSuiteSuiteScript 2.x Modules Reference
A searchable table of the SuiteScript 2.x N/ modules, what each one is for and the methods you reach for most.
More NetSuite tools
See all- NetSuite Saved Search Formula Generator
- NetSuite CSV Import Template Guide
- NetSuite Role Permission Matrix Worksheet
- NetSuite Inventory Costing Method Reference
- NetSuite Month End Close Checklist
- NetSuite License Cost Estimator
- NetSuite User Access Request Form Template
- NetSuite Custom Record Design Spec Template
- NetSuite SuiteScript Deployment Handover Template
New to NetSuite? Start with the NetSuite guide and toolkit, or plan with NetSuite Cost Calculator, Training Path Builder, ERP Certification Study Planner.
Keep exploring
Free tools
- NetSuite Script Deployment Fields and Status ReferenceWhat each field on a Script Deployment record does, which script types have it, and the setting to use for testing and for production.
- NetSuite Transaction Type Codes ReferenceLook up the short type code stored in transaction.type for common NetSuite transactions, with the matching record id.
- NetSuite Script Deployment Inventory WorksheetKeep an inventory of every SuiteScript and deployment with its owner, status and review date, and export it to Excel.
ERP fixes and how-tos
- Fix NetSuite INSUFFICIENT_PERMISSION ErrorINSUFFICIENT_PERMISSION means the role or script deployment lacks a needed permission. Learn how to find the exact missing permission and fix it fast.
- Fix NetSuite SSS_USAGE_LIMIT_EXCEEDED ErrorSSS_USAGE_LIMIT_EXCEEDED means your SuiteScript ran out of governance units. Learn the cause, how to check usage, and fixes using submitFields and Map/Reduce.
- Fix NetSuite INVALID_KEY_OR_REF ErrorINVALID_KEY_OR_REF means NetSuite could not resolve a reference key, such as a parent, join, or foreign record id. Common causes and how to fix each.
Runs with your ERP
- NetSuite Quality Management SuiteApp: inspections and nonconformanceWhat the NetSuite Quality Management SuiteApp does: inspection specs, queues, sampling and nonconformance workflows. Setup, pitfalls, alternatives and AI uses.
- NetSuite Manufacturing Mobile and Tablet MES for Shop Floor DataOracle's NetSuite Manufacturing Mobile gives operators a scanner and tablet interface for labor, completions, material moves and receipts. Setup and limits.
- NetSuite AI Connector Service (MCP) and SuiteAgents with Oracle NetSuiteHow the NetSuite AI Connector Service (MCP) and SuiteAgents work: what external AI assistants can do, setup, pitfalls and where a private AI layer fits.
AI on your ERP
- AI agents for NetSuite manufacturing operationsAI agents for NetSuite manufacturing: WIP tracking, routing exceptions, and work order status grounded in SuiteQL, with human approval on anything that writes back.
- AI for NetSuite, Beyond the Built-In Text ToolsNetSuite's built-in AI covers text generation, not grounded answers on your own data. See how a private LLM over SuiteQL adds real Q&A and controls.
Integrations
- How to add AI agents to Oracle NetSuiteHow to add AI agents to Oracle NetSuite: SuiteQL and REST tool layer, RESTlet writes, role-scoped tokens, human approval, and where a private model fits.
- How to use ChatGPT with Oracle NetSuiteConnect ChatGPT to Oracle NetSuite: custom GPT actions, exports versus live access, enterprise data controls, and when a private model is the safer choice.