NetSuite (Apps step)

Updated Nov 23, 2026
DataMagik Automate

NetSuite

Runs SuiteQL queries and reads, creates and updates NetSuite records (customers, sales orders, items…) through the SuiteTalk REST web services.

Use it to read NetSuite data for the plant and write back what happens there: query open sales orders with SuiteQL, read a customer or item, create a record when a shipment leaves, or update a field when a job finishes.

Beta. This step has not yet been checked against a live NetSuite account, so treat its first runs as a test, and tell us if an operation does not answer as described.

Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.

Set it up

  1. In NetSuite, open Setup › Company › Enable Features › SuiteCloud and tick REST Web Services and Token-Based Authentication.
  2. Make a role for the integration with the permissions REST Web Services, Log in using Access Tokens and SuiteAnalytics Workbook (for SuiteQL), plus view or edit on the records the workflow uses, and give it to the integration user.
  3. Open Setup › Integration › Manage Integrations › New, tick Token-Based Authentication (and untick the authorization code grant), save, and copy the Consumer Key and Consumer Secret (shown once).
  4. Open Setup › Users/Roles › Access Tokens › New, choose that integration, user and role, save, and copy the Token ID and Token Secret (shown once).
  5. In DataMagik, open Script Engine › Credentials and add an "OAuth 1.0 token (NetSuite TBA)" credential with the consumer key and secret, the token ID and secret, signature method HMAC-SHA256, and as Realm your account ID in capitals with an underscore, such as 1234567 or 1234567_SB1.
  6. Add your account's host (such as 1234567.suitetalk.api.netsuite.com) to Allowed Domains in the workflow's Script settings.

Credential: An "OAuth 1.0 token (NetSuite TBA)" credential: the integration record's consumer key and secret, an access token's token ID and secret, signature method HMAC-SHA256, and the realm, which is the account ID in capitals with an underscore (1234567_SB1, unlike the 1234567-sb1 in the address).

Hosts it calls: *.suitetalk.api.netsuite.com

Connection

FieldRequiredWhat to put
Account IDYesYour NetSuite account ID as it appears in the address, in lower case with - instead of _: 1234567 for production, 1234567-sb1 for the sandbox whose account ID is 1234567_SB1 (Setup › Company › Company Information shows it). For example 1234567-sb1.

Operations

OperationWhat it does
SuiteQL › QueryRuns a SuiteQL query (NetSuite's SQL) and returns its rows, 1000 per request, following every page up to the step's page limit.
Record › GetReads one record by its type and internal id.
Record › CreateCreates a record of a type.
Record › UpdateChanges fields on one record; fields you leave out keep their values.

SuiteQL › Query

Runs a SuiteQL query (NetSuite's SQL) and returns its rows, 1000 per request, following every page up to the step's page limit.

Calls POST /query/v1/suiteql. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
QueryYesA SuiteQL SELECT statement. Text values go in single quotes; checkbox columns hold 'T' or 'F'. For example SELECT id, companyname, email FROM customer WHERE isinactive = 'F'.
Prefer headerNoLeave as transient: NetSuite asks for it on SuiteQL queries.

What comes out: One item per row, 1000 rows per page and up to 10 pages: each selected column under its name in lower case, such as {{ $json.id }} and {{ $json.companyname }}, plus an empty {{ $json.links }}.

Example: SELECT id, tranid, shipdate FROM transaction WHERE type = 'SalesOrd' AND shipdate = TO_DATE('{{ $json.date }}', 'YYYY-MM-DD') lists the orders due to ship that day.

Record › Get

Reads one record by its type and internal id.

Calls GET /record/v1/{recordType}/{id}.

FieldRequiredWhat to put
Record typeYesThe record's REST name, in camel case: customer, salesOrder, inventoryItem, vendor. For example salesOrder.
Internal IDYesThe record's internal id (a number, not its document number such as SO1042), or eid: followed by its external id, such as eid:PO-77. For example 1042.
Include sublistsNoInclude sublists (such as a sales order's item lines) and subrecords in full, instead of as links.

What comes out: One item: the record, with {{ $json.id }} and its fields by their REST names, such as {{ $json.tranId }} or {{ $json.companyName }}. A reference field comes as an object with {{ $json.entity.id }} and {{ $json.entity.refName }}; sublists come as links unless Include sublists is on, then {{ $json.item.items }} holds the lines.

Example: Read salesOrder {{ $json.ns_id }} with sublists included and pass {{ $json.item.items }} to a packing list document.

Record › Create

Creates a record of a type.

Calls POST /record/v1/{recordType}.

FieldRequiredWhat to put
Record typeYesThe record's REST name, in camel case: customer, salesOrder, inventoryItem, vendor. For example salesOrder.
Record fieldsYesA JSON object of the record's fields by their REST names. Reference fields take {"id": "…"}; a sublist takes {"items": [ … ]}. Setting externalId lets you read the record back afterwards. For example {"externalId": "{{ $json.po }}", "entity": {"id": "1042"}, "item": {"items": [{"item": {"id": "88"}, "quantity": 5}]}}.

What comes out: NetSuite answers 204 No Content, so the step puts out one item with {{ $json.status }} (204) and an empty {{ $json.body }}. The new record's id is not put out: read it back with Get record and the id eid:<the externalId you set>, or find it with SuiteQL.

Example: Create a salesOrder with externalId {{ $json.po }}, then Get record salesOrder eid:{{ $json.po }} to learn its internal id and tranId.

Record › Update

Changes fields on one record; fields you leave out keep their values.

Calls PATCH /record/v1/{recordType}/{id}.

FieldRequiredWhat to put
Record typeYesThe record's REST name, in camel case: customer, salesOrder, inventoryItem, vendor. For example salesOrder.
Internal IDYesThe record's internal id (a number, not its document number such as SO1042), or eid: followed by its external id, such as eid:PO-77. For example 1042.
Record fieldsYesA JSON object of the fields to change and their new values, by their REST names; only these fields change. For example {"memo": "Shipped {{ $json.shipped_at }}"}.

What comes out: NetSuite answers 204 No Content, so the step puts out one item with {{ $json.status }} (204) and an empty {{ $json.body }} when the record was updated. Use Get record to see it as it now is.

Example: When the truck leaves, update salesOrder {{ $json.ns_id }} with {"memo": "Shipped on BOL {{ $json.bol }}"}.

Example

Each morning NetSuite › SuiteQL runs SELECT id, tranid, entity, shipdate FROM transaction WHERE type = 'SalesOrd' AND status = 'SalesOrd:B', and the workflow emails the list of orders to ship to the shipping lead.

Tips

  • The account ID is written two ways: lower case with - in the address (1234567-sb1) and capitals with _ in the credential's Realm (1234567_SB1). A 401 with INVALID_LOGIN usually means the realm or the role's permissions are wrong.
  • SuiteQL returns column names in lower case, whatever case the query uses: SELECT companyName gives {{ $json.companyname }}.
  • Record types use their REST names, which are camel case: customer, salesOrder, inventoryItem, vendorBill. Open the REST API Browser in NetSuite's help to see each record's fields.
  • Create and Update answer 204 with no body, so the step cannot see the new record's id. Set an externalId when you create it, then read it with Get record using the id eid:<your external id>, or find it with SuiteQL.
  • It reads and writes the real account on test runs too, so use a sandbox account while building.

Settings every Apps step has

  • More query parameters: any query parameter the fields do not offer, sent as is.
  • More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
  • Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
  • Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
  • Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.

NetSuite's own API documentation: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html

Was this page helpful?