Loopfour
Integrations

NetSuite actions

Reference for the NetSuite actions: the connection type, each action and what it does, its inputs and outputs, and the live catalog call.

The NetSuite block reads and writes records in Oracle NetSuite through its REST record API and SuiteQL. For the plain-language overview, see NetSuite.

When to use it

Use a NetSuite step to create invoices, vendor bills and journal entries, to look up customers and vendors, or to run a SuiteQL query for aging and reporting. Several system templates use netsuite.suiteql, netsuite.createJournalEntry, netsuite.createVendorBill and netsuite.getRecord.

Connection

ItemValue
Block typenetsuite
ConnectionConnected from Integrations (provider id netsuite), token-based authentication
Account pinconfig.connection, the connection row id. Without it the step uses the company's default NetSuite connection

Two sets of actions

The engine runs every action in the table below. Only the five generic record actions appear in the Studio Action list and in GET /api/v1/blocks/netsuite. The others run when a workflow definition names them, and system templates use them, but POST /api/v1/workflows/validate reports them as UNKNOWN_OPERATION because it checks the Studio list.

ActionIn Studio listWhat it doesRequired config
createRecordYesCreate any record type from a raw bodyrecordType, data
getRecordYesRead one recordrecordType, internalId
updateRecordYesPatch one recordrecordType, internalId, data
deleteRecordYesDelete one recordrecordType, internalId
searchRecordsYesBuild and run a SuiteQL selectrecordType
suiteqlNoRun a SuiteQL query as writtenquery
createCustomerNoCreate a customerNone (see fields)
getCustomerNoRead a customercustomerId
updateCustomerNoUpdate a customercustomerId
listCustomersNoList customers with filtersNone
createInvoiceNoCreate an invoicecustomerId, lines
getInvoiceNoRead an invoiceinvoiceId
updateInvoiceNoUpdate memo, due date, PO number or custom fieldsinvoiceId
listInvoicesNoList invoices with filtersNone
createVendorBillNoCreate a vendor billvendorId, lines
getVendorBillNoRead a vendor billbillId
listVendorBillsNoList vendor bills with filtersNone
createJournalEntryNoPost a journal entrylines
getJournalEntryNoRead a journal entryjournalId
createVendorNoCreate a vendorNone (see fields)
getVendorNoRead a vendorvendorId
listVendorsNoList vendors with filtersNone

The action id is netsuite.<action>.

The Studio form and the executor use different field names

The Studio form writes Record ID as recordId, Record Fields (JSON) as fields and Search Filters (JSON) as searchFilters. The executors read internalId, data and filters. Until the form is aligned, set the executor field names in the workflow definition. The Custom Record option writes recordType: "custom" and the executor does not read customRecordType, so put the custom record type id (for example customrecord_my_type) in recordType itself.

Fields

ActionFields
Generic recordrecordType (NetSuite record type, such as invoice, customer, vendor, journalEntry), internalId, data (raw REST body), expandSubResources (boolean, get only)
searchRecordsfields (array of column names, default ["id"]), filters (map of field to value, or to { operator, value }), orderBy, limit (default 100), offset
suiteqlquery, limit (default 1000), offset
createInvoicecustomerId, lines[] (itemId, quantity, rate, amount, description, taxCode, department, class, location), invoiceDate, dueDate, invoiceNumber, memo, poNumber, subsidiaryId, currencyId, exchangeRate, termsId, locationId, departmentId, classId, salesRepId, discountItemId, discountRate, externalId, customFields
listInvoices, listVendorBillscustomerId or vendorId, status, subsidiaryId, tranDateAfter, tranDateBefore, limit, offset
createVendorBillvendorId, lines[] (an item line with itemId, or an expense line with accountId; amount, quantity, rate, description, department, class, location, customerId, isBillable), billDate, dueDate, billNumber, memo, subsidiaryId, currencyId, exchangeRate, termsId, locationId, departmentId, classId, externalId, customFields
createJournalEntrylines[] (accountId, debit, credit, memo, entityId, department, class, location), tranDate (default today), tranId, memo, subsidiaryId, currencyId, exchangeRate, approved (default true), externalId, customFields
Customers and vendorsentityId, companyName, firstName, lastName, email, phone, subsidiaryId, currencyId, termsId, isInactive, customFields, and the record-specific fields in the executor

Behaviour worth knowing

  • createJournalEntry refuses an entry whose debits and credits differ by more than 0.01, before calling NetSuite.
  • createJournalEntry sends approved: true unless you set approved to false.
  • searchRecords builds its WHERE clause from filters by string concatenation. Pass trusted values only; for anything else, write the query in suiteql yourself.
  • Create, update and delete actions return NetSuite's response body as given.

Output

The step output is the NetSuite response. A record read returns the record's fields; a SuiteQL action returns NetSuite's query envelope, so read rows from {{steps.<id>.items}}.

Example

A SuiteQL step that lists open invoices for an aging check:

{
  "id": "open_invoices",
  "type": "action",
  "name": "List open invoices",
  "action": "netsuite.suiteql",
  "config": {
    "operation": "suiteql",
    "connection": "<netsuite-connection-id>",
    "query": "SELECT id, tranid, entity, duedate, foreigntotal FROM transaction WHERE type = 'CustInvc' AND status = 'CustInvc:A'",
    "limit": 500
  }
}

Live catalog

GET /api/v1/blocks/netsuite returns the Studio fields and the five record actions. See Block and action discovery.

Errors and limits

  • recordType is required, internalId is required, data is required: the step is missing an executor field, often because it was filled in with the Studio names described above.
  • Journal entry must balance. Debits: …, Credits: …: fix the line amounts.
  • at least one line item is required: createInvoice, createVendorBill and createJournalEntry need a non-empty lines array.
  • NetSuite errors are returned with NetSuite's own message.

On this page