Skip to main content
Use the NetSuite REST destination component to write records to NetSuite through NetSuite’s REST web services. It can insert new records, update existing records by internal ID or external ID, or upsert records by external ID. It writes standard and custom records, including transactions with lines such as vendor bills, invoices, and journal entries, and it sets standard and custom fields. A field that points to another record (a vendor, an account, a department) can be given as that record’s internal ID or external ID. The component can also upload files, such as invoice PDFs, to the NetSuite File Cabinet and attach each one to a record. See Write to File Cabinet.

Connection Setup

Select an existing NetSuite SOAP or NetSuite OAuth connection, or create a new one. The component works with both connection types: Whichever type you use, NetSuite must allow REST web services for the account and for the role behind the connection:
1
Enable REST web services: go to Setup > Company > Enable Features, open the SuiteCloud subtab, and check REST Web Services in the SuiteTalk (Web Services) section. For a NetSuite OAuth connection, also check OAuth 2.0 under Manage Authentication.
2
On the role’s Permissions > Setup subtab, add REST Web Services, plus Log in using Access Tokens for token-based authentication or Log in using OAuth 2.0 Access Tokens for OAuth 2.0.
3
Give the role permission to create and edit the record types you write, and to view the records they point to, such as vendors, accounts, and items.

Destination Properties

Choosing another record type clears the schema mapping, because the new record type has different fields. An update or upsert keeps an empty row for its key.

Operations

Errors and Result File

Concurrent Requests

The settings are under the component’s advanced settings, next to Maximum errors. They apply when writing records; files for the File Cabinet are uploaded one at a time.

Stopping on Errors with Concurrent Requests

With Concurrent requests above 1, the job does not stop the moment a record fails. It checks results in the order the records arrived, while later records are already being sent. When Maximum errors is exceeded, or NetSuite rejects the connection’s credentials:
  • Records already on their way to NetSuite are still sent. There can be up to 16 times the Concurrent requests setting of them, for example up to 64 at 4. This is most likely when the first failing record is slow, for example while it is retried. After Maximum errors is exceeded, NetSuite applies or rejects each of them as usual. After rejected credentials, NetSuite rejects them the same way, so they are failed, not written.
  • Records not yet started are not sent.
  • Every record that was sent has its row in the result file, written or failed, so you can see which ones NetSuite applied. The one exception is the record whose rejected credentials stopped the job: it has no row, and the job’s error names the rejection.
With Concurrent requests at 1, the job stops at the first record past the limit, as before. If a job must write nothing after its first failure, for example Maximum errors at 0 on data you would have to clean up by hand, keep Concurrent requests at 1.

Schema Mapping

Map each input field to a NetSuite field. The NetSuite field list holds the record type’s writable fields:
  • Header fields, by field ID, for example memo, tranDate, or entity. Custom body fields appear by their script ID, for example custbody_project_code.
  • Line fields, as sublist.field, for example expense.account, expense.amount, or item.quantity. Custom column fields appear the same way, for example expense.custcol_cost_center.
Read-only fields are not listed, except id. Subrecords (such as addresses) and multi-select fields are not listed either. The list is read from NetSuite each time you open the component. If a custom field is missing, check that the connection’s role can see it, then open the component again. For an update or an upsert, the grid starts with a row for the key field (externalId or id). Its NetSuite field is fixed, and the row cannot be removed: pick the input field that holds each record’s key. Reference type appears for fields that point to another record. It tells NetSuite whether the input value is the other record’s internal ID or its external ID: Internal ID means NetSuite’s internal ID of the record, not an account number or a name. Use External ID when your source data carries the external IDs of the records you point to. Auto-fill maps input fields to header fields with the same name, keeping the rows already mapped. Clear unmapped removes rows that do not map an input field to a NetSuite field. How values are sent:
  • Empty values are not sent, so they never clear a value that is already in NetSuite.
  • Date fields take YYYY-MM-DD strings. A Datetime value sent to a date field is sent as its date.
  • A numeric internal ID such as 42.0 is sent as 42.
  • A value that cannot be written to NetSuite, such as a map or a bag, fails its record.
  • NetSuite stores < and > in text fields as &lt; and &gt;, so reading such a value back from NetSuite returns the entities. Other characters, including &, quotes, and non-ASCII letters, are stored as sent.

Transactions with Lines

Mapping a line field changes how input rows become records. The rows that share the same record key value become one NetSuite record:
  • The header fields come from the first row of the group.
  • Every row adds one line to each sublist it has values for, in input order. A row with no values for a sublist adds no line to it, so one input can carry, for example, expense lines and item lines side by side.
  • Rows with an empty record key cannot be grouped. Each one fails as a record of its own and counts against Maximum errors.
Which input field is the record key depends on the operation: For an update or an upsert, Existing lines decides what happens to the lines a record already has:

Example: A Vendor Bill with Expense Lines

Input rows: Settings and mapping:
  • Record type: vendorbill. Operation type: Upsert. Existing lines: Replace.
  • bill_number to externalId (the upsert key row), vendor_code to entity with reference type External ID, memo to memo, tran_date to tranDate, account_id to expense.account with reference type Internal ID, amount to expense.amount.
  • No record key to choose: an upsert groups the rows by bill_number, the input field mapped to its key.
The two rows become one vendor bill with the external ID INV-1001 and two expense lines. NetSuite creates the bill on the first run, and a later run with the same rows updates it and replaces its expense lines instead of adding them again.

Result File

The result file has a row for each record the job processed, written or failed: The file is written even when the job fails, so it is available after a run stopped by Maximum errors. If NetSuite rejects the connection’s credentials, the job stops: the file has the records processed before that, but no row for the record that was rejected. With Concurrent requests above 1, it also has the records that were already on their way, which NetSuite rejects the same way. A following package can read it to post each record’s result back to the source system.

How Records Are Written

  • One request per record. Each record is one request to NetSuite. By default records are sent one at a time; with Concurrent requests above 1, up to that many are sent at once. See Expected rate.
  • The result file keeps the input order. With several requests at once, NetSuite may answer them in any order, but the result file still lists the records in the order the component received them.
  • Writes to one record never overlap. With Concurrent requests above 1, records are not written in input order, but two records that update or upsert the same NetSuite record (the same internal or external ID) are never sent at once: the second waits for the first. If a record depends on another one the same component inserts, for example a customer whose parent customer is in the same load, keep Concurrent requests at 1.
  • Rate limits are retried. A request NetSuite turns away for its rate or concurrency limits (HTTP 429, or CONCURRENCY_LIMIT_EXCEEDED or SSS_REQUEST_LIMIT_EXCEEDED) is retried. Each record is retried on its own, up to 3 times after 5, 15, and 45 seconds, on top of quicker retries a few seconds apart. A retry never sends any other record again. With Concurrent requests above 1 and Send fewer requests at once when NetSuite is at its limit on, each such request also lowers the number sent at once by one, for the rest of the run, down to 1.
  • Requests NetSuite holds count as well. NetSuite does not always turn extra requests away. It can hold concurrent saves that wait on each other, for example several bills of one vendor, until the earlier ones finish. A request held over 60 seconds is sent again, up to twice, only if it is an update or upsert that replaces every sublist it sends. An insert, or a write that appends lines, is reported as failed with REQUEST_FAILED instead, because NetSuite may still apply it. With Send fewer requests at once when NetSuite is at its limit on, any request that takes 55 seconds or more, just under that 60-second timeout, also lowers the number sent at once by one, whatever the cause. Writes that finish sooner, even slow ones such as records with many lines or heavy scripts, do not count.
  • Server errors are retried only when that is safe. A server error (HTTP 5xx) is retried for an update or upsert that replaces every sublist it sends. An insert, or a write that appends lines, is reported as failed instead, because NetSuite may already have applied it and a retry could duplicate the record or its lines.
  • Rejected credentials stop the job. NetSuite would reject every other record the same way. Test the connection, and reconnect it if it is a NetSuite OAuth connection.
  • Rejected records do not stop the job until Maximum errors is exceeded. Each one is in the result file with the status failed. With Concurrent requests above 1, records already being sent at that point are still written. See Stopping on errors with concurrent requests.
  • Failed tasks are not retried. Task retries are turned off for this component, so a task that fails partway is not run again and its records are not written twice.

Expected Rate

A record write usually takes NetSuite a second or a few seconds. Records with many lines, and record types with scripts or workflows that run on save, can take 10 seconds or more. One at a time, the job writes roughly one record per that time; with Concurrent requests set to N, roughly N records per that time, until NetSuite starts turning requests away. For example, at 10 seconds per record, 6,000 records take about 17 hours one at a time, and about 4 hours with 4 concurrent requests.

Choosing a Concurrency Level

NetSuite limits how many requests an account handles at once. The limit depends on the account’s service tier and on how many SuiteCloud Plus licenses it has, and it is shared by every integration that uses the account, including other Integrate.io jobs that run at the same time. In NetSuite, Setup > Integration > Integration Management > Integration Governance shows the account’s limit and how much of it is in use.
  • Start at 2 to 4, run a job, and raise the setting only if it stays well below the account’s limit.
  • Leave room for everything else that uses the account at the same time, such as other integrations and other Integrate.io jobs.
  • Keep Send fewer requests at once when NetSuite is at its limit on. Above what NetSuite takes, every request waits out its retries or is held, and a job can run many times slower than one at a time. In a test, 22 updates to bills of one vendor took 24 seconds one at a time and over 6 minutes four at a time without this setting: NetSuite held the concurrent saves. With it on, the component drops to what NetSuite takes after the first requests are turned away or held.
  • Load records that share a parent at 1. Several transactions of the same vendor or customer can wait for each other in NetSuite however many are sent at once, so a higher setting does not speed them up.
  • Lower it if the job gets slower. A setting above the limit still costs a stall at the start of each run, and a record NetSuite still turns away after its last retry fails.

Write to File Cabinet

With Write to set to File Cabinet, the component uploads files to the NetSuite File Cabinet instead of writing records. Each input row becomes one file in a File Cabinet folder, and each file can be attached to a record, for example the vendor bill an invoice PDF belongs to. Attached files appear on the record’s Communication subtab, under Files. NetSuite’s REST web services cannot create files, so the upload goes through a RESTlet: a small SuiteScript that a NetSuite administrator deploys in your account once, called the Integrate.io File Cabinet RESTlet. The job calls it with the NetSuite connection’s credentials, one request per file. The RESTlet saves the file and, when asked, attaches it to the record. Both connection types (NetSuite SOAP with token-based authentication, and NetSuite OAuth) work. A typical package reads whole files with a file storage source, such as Amazon S3 or SFTP, and sends them to this component. See Reading Files for Upload.

Deploy the RESTlet

A NetSuite administrator does this once per NetSuite account. A sandbox account needs its own deployment.
1
Check that Server SuiteScript is enabled: go to Setup > Company > Enable Features, open the SuiteCloud subtab, and check Server SuiteScript in the SuiteScript section.
2
Save the script below to a file whose name ends in .js, for example integrateio_file_cabinet_restlet.js. Keep the .js extension: if the script file is saved in NetSuite without it, every upload fails with Unsupported file extension.
3
Go to Customization > Scripting > Scripts > New. Next to Script File, click +, upload the .js file, then click Create Script Record. NetSuite reads from the file that this is a RESTlet. Give the script a name, such as Integrate.io File Cabinet RESTlet, and click Save.
4
Click Deploy Script. Set Status to Released and Log Level to Error. On the Audience subtab, select the role the Integrate.io NetSuite connection uses. Click Save.
5
Copy the deployment’s External URL, for example https://1234567.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=1057&deploy=1. You enter it in the component’s RESTlet URL setting.
When a new version of the script is released, update your deployment: open the script record, replace its script file with the new script (keep the .js name), and save. The deployment and its External URL stay the same. A job that uploads a file through an older script logs a warning that the deployment runs an older version. A re-run against a script older than version 2 may not get that far: that script fails every file an earlier run saved with INTEGRATEIO_FILE_EXISTS, identical ones included, so update the script when re-runs fail that way. The role the connection uses needs these permissions, on top of those in Connection Setup: The role must also be in the deployment’s audience, or NetSuite refuses the calls.

File Cabinet Settings

The collapsed Advanced settings section holds: NetSuite stores the text file types (CSV, PLAINTEXT, XMLDOC, JSON, HTMLDOC) as UTF-8 text. A text file in another encoding, such as UTF-16 or Windows-1252, does not keep its non-ASCII characters. The other file types are stored byte for byte.

File Fields

In File Cabinet mode, the File fields step replaces the schema mapping. Choose the input field that holds each part of the file: The editor warns when File content is a typed field that is not Binary. A file read into a string field has already lost every byte that is not valid UTF-8, so a row whose content arrives as a string fails, unless its file type is a text type.

Reading Files for Upload

Read each whole file as one record with a file storage source:
1
Add the source for the storage that holds the files, and set its source path to the files to upload, for example /invoices/*.pdf.
2
Set Record type to Raw and Record delimiter to End of file, so each file is one record. See Source File Format.
3
In the source schema, set the data type of the raw field to Binary, and add the file_path meta data field.
4
Connect the source to the NetSuite REST destination. Set Write to to File Cabinet, fill in the settings, and in File fields choose file_path as File name and the raw field as File content.
To attach the files to records, the input also needs each record’s internal ID. It can come from part of the file name, or from a join with data that maps each file to its record.

Files with the Same Name

If the file exists decides what happens when the folder already has a file with the same name: Overwrite is not the default because files often share a name. If two vendor bills each come with an invoice.pdf, overwriting leaves the first bill showing the second bill’s invoice. Use Overwrite to replace files on purpose, for example to re-send corrected versions, and give each file a unique name either way. With Fail the file, a re-run after a failed run picks up where it stopped. The files the failed run already saved are in the folder with the same contents, so the re-run counts them as uploaded, attaching any that were saved but not attached, and uploads the rest. Within one run, two rows with the same file name for the same folder are never both sent, since they would become one file. The first is uploaded, and the second fails with DUPLICATE_FILE_NAME. Names that differ only in letter case count as the same name.

File Result File

The result file has a row for each file the job processed, uploaded or failed: The file is written even when the job fails, so it is available after a run stopped by Maximum errors.

How Files Are Uploaded

  • One request per file, one at a time. Throughput depends on how fast NetSuite answers.
  • Rate limits are retried. A request NetSuite turns away for its rate or concurrency limits (HTTP 429 or SSS_REQUEST_LIMIT_EXCEEDED) is retried up to 3 times, after 5, 15, and 45 seconds.
  • Other failures are not retried. The file is reported as failed.
  • Rejected credentials stop the job. NetSuite would reject every other file the same way. Test the connection, and check that the deployment’s audience includes the connection’s role.
  • Failed tasks are not retried, so a task that fails partway does not upload its files twice.
  • Re-runs finish what a failed run started. With Fail the file, files already in the folder with the same contents count as uploaded. See Files with the Same Name.

Best Practices

  • Prefer upsert by external ID for loads you may re-run. A re-run updates the same records instead of creating duplicates, and with Replace it does not duplicate lines either.
  • Use Append only to add lines on purpose. Running the same append twice adds the lines twice.
  • Turn on the result file, especially when Maximum errors is above 0. It lists each failed record with NetSuite’s reason.
  • Test against a sandbox account first. For a NetSuite SOAP connection, a sandbox account ID carries the _SB<number> suffix.
  • For an insert with lines, choose a stable record key, such as a document number, so rows that belong together always group into the same record.
  • Give every uploaded file a unique name, for example by including the document number, such as INV-1001.pdf. Unique names keep Fail the file from failing files that merely share a name, and keep Overwrite from replacing a file that another record shows.
  • Deploy the RESTlet in your sandbox account too, and test File Cabinet uploads there first, with a connection to the sandbox account.

FAQ

Q: How is NetSuite REST different from the NetSuite SOAP destination? NetSuite REST writes through NetSuite’s REST web services, with the operations, line handling, and references described on this page. The NetSuite SOAP destination writes through NetSuite’s SOAP web services and can also delete records, which NetSuite REST does not do. Q: Why does the record type list show vendorbill instead of “Vendor Bill”? NetSuite lists record type IDs in lowercase, and the list shows them as NetSuite returns them. NetSuite accepts them in any case, so vendorbill and vendorBill name the same record type. Search the list by ID. Q: The record is already found by its external ID. Why do some fields need a reference type? The two settings identify different records. The update or upsert key finds the record being written, for example the vendor bill with the external ID INV-1001. A reference type belongs to a field that points to another record, for example the bill’s vendor (entity) or an expense line’s account. NetSuite needs to know whether the value in that field is the vendor’s internal ID or its external ID. The reference type defaults to Internal ID, so you only change it when your data holds the external IDs of the records you point to. Q: How do I write a custom field? Custom fields of the record type appear in the NetSuite field list by script ID: custbody_... for header fields and sublist.custcol_... for line fields. Map them like any other field. If one is missing, check the field’s access for the connection’s role, then open the component again. Q: What happens when a referenced record does not exist? NetSuite rejects the record, for example with NONEXISTENT_EXTERNAL_ID, and the result file reports it as failed. It is never written without the reference. Q: Can I clear a field in NetSuite? No. Empty values are not sent, so an empty input value leaves the NetSuite field as it is. Q: A large load is slow. How can I speed it up? Raise Concurrent requests, within your account’s concurrency limit. See Expected rate and Choosing a concurrency level. Q: Why did the job stop after the first failed record? Maximum errors defaults to 0. Raise it, or set it to -1, and turn on the result file to see every failure. Q: Every file fails with “Unsupported file extension”. What is wrong? The RESTlet’s script file was saved in NetSuite without the .js extension. Upload the script again under a name that ends in .js, create a script record and deployment from it, and enter the new deployment’s External URL in RESTlet URL. Q: Where do I find the uploaded files in NetSuite? In Documents > Files > File Cabinet, in the folder you set. A file attached to a record also appears on that record’s Communication subtab, under Files. The result file gives each file’s internal ID. Q: A file was saved but the result says ATTACH_FAILED. How do I attach it? The file is in the folder, and File ID has its internal ID. Fix the cause in Error, such as a wrong record internal ID or a missing permission, then run the package again. The file is already in the folder with the same contents, so the re-run does not save it again: it attaches it and reports it as success. Q: Why was my PDF refused because it “reached the destination as text”? The file content field is a string, not Binary, somewhere between the source and this destination. Reading a PDF as text replaces every byte that is not valid UTF-8, so the job refuses the file rather than save a damaged copy. Set the content field’s data type to Binary in the source schema, and in any component in between. Q: Can I upload files larger than 7 MiB? No. A RESTlet request is limited to 10 MB, and base64 encoding makes the content a third longer. A larger file fails with an error that gives its size, and counts against Maximum errors.

NetSuite SOAP Destination

NetSuite Source

REST API Destination

File Storage Options

Destinations Overview

Last modified on November 13, 2026