NetSuite setup guide

Create the NetSuite integration and certificate Lava needs and connect your NetSuite account.

Connecting NetSuite to Lava takes four values: your account ID, the client ID of an integration record, the certificate ID of an OAuth 2.0 client credentials mapping, and that certificate's private key. NetSuite calls this setup machine to machine (M2M): Lava signs each sign-in with the private key, so the connection uses no one's password and needs no periodic sign-in until the certificate expires. The mapping ties the connection to one NetSuite employee and role, and the agent sees and changes only what that role allows. Expect about fifteen minutes with a NetSuite administrator.

Prerequisites

A NetSuite administrator, a terminal with openssl (built into macOS and Linux), and a role for the agent. A dedicated role with only the permissions the agent needs is safest; it needs Log in using OAuth 2.0 Access Tokens and REST Web Services on the Setup subtab, plus permissions for the records the agent should work with.

Turn on the features

An administrator opens Setup → Company → Enable Features and, on the SuiteCloud subtab, checks REST Web Services (SuiteTalk section) and OAuth 2.0 (Manage Authentication section), then saves. REST web services also need SuiteAnalytics Workbook on the Analytics subtab. Skip any that are already on.

Find your account ID

Open Setup → Company → Company Information and copy the Account ID, for example 1234567, or 1234567_SB1 for a sandbox. The first part of the address you open NetSuite at works too: 1234567-sb1 from https://1234567-sb1.app.netsuite.com.

Create the integration record

1. Start a new integration

Open Setup → Integration → Manage Integrations → New. Name it Lava and set State to Enabled.

2. Choose the grant and scope

On the Authentication subtab, clear the token-based authentication boxes and Authorization Code Grant. Under OAuth 2.0, check Client Credentials (Machine to Machine) Grant and the REST Web Services scope.

3. Save and copy the client ID

Save, then copy the Client ID from the confirmation page. NetSuite shows it only once, and the record's Application ID is a different value that won't work. Lava does not need the client secret. If you lose the client ID, Reset Credentials on the record issues a new one.

Create a key and certificate

Run this in a terminal to create an elliptic curve key pair:

openssl req -new -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -pkeyopt ec_param_enc:named_curve -nodes -days 730 -subj "/CN=Lava NetSuite" -out public.pem -keyout private.pem

public.pem is the certificate you upload to NetSuite. private.pem is the private key you paste into Lava; keep it out of email and chat. An RSA key also works:

openssl req -new -x509 -newkey rsa:3072 -sigopt rsa_padding_mode:pss -sha256 -sigopt rsa_pss_saltlen:64 -nodes -days 730 -subj "/CN=Lava NetSuite" -out public.pem -keyout private.pem

NetSuite caps a certificate at two years and emails administrators before one expires.

Map the certificate

1. Open the M2M setup

Open Setup → Integration → Manage Authentication → OAuth 2.0 Client Credentials (M2M) Setup and select Create New.

2. Choose who the agent acts as

Pick the Entity (the employee the agent acts as), the Role, and the Application you created (Lava). Upload public.pem as the Certificate.

3. Save and copy the certificate ID

Save, then copy the Certificate ID from the mapping's row.

Connect to Lava

1. Add NetSuite

In Lava Desktop, add NetSuite from the app picker and choose Connect. (In the Lava dashboard, go to Wallet → Connected Services and click NetSuite.)

2. Enter the four values

Enter the account ID, the client ID, and the certificate ID, then paste the whole contents of private.pem, including the BEGIN PRIVATE KEY and END PRIVATE KEY lines. Lava requests an access token with them before saving, so a mistyped value is caught right away, and it renews the hour-long token from then on.

3. Open your account

The NetSuite tab in Lava Desktop opens your account. Sign in there as usual to review records alongside the agent.

Set it up for me

In Lava Desktop, Set it up for me hands this guide to the agent. It walks you through NetSuite's setup pages in the NetSuite tab. You still run the openssl command and paste the private key yourself on Lava's connection screen; the agent never handles it.

Renew the certificate

Before the certificate expires, create a new key pair, map the new public.pem the same way, and reconnect NetSuite in Lava with the new certificate ID and private key. Revoke the old mapping afterwards.

Troubleshooting

  • "NetSuite has no account with that account ID": the account ID has a typo. Copy it again from Company Information.
  • "NetSuite rejected the credential": the client ID is actually the integration's application ID, the certificate ID doesn't belong to the pasted key, the mapping was revoked or has expired, or the integration record lacks the Client Credentials grant or the REST Web Services scope. For some of these, Setup → Users/Roles → User Management → View Login Audit Trail with the Detail column added shows the reason.
  • "Paste the whole private key file": the key is missing its first or last line, is protected by a passphrase, or uses an older format (BEGIN RSA PRIVATE KEY or BEGIN EC PRIVATE KEY). Convert it with openssl pkcs8 -topk8 -nocrypt -in key.pem -out private.pem and paste the new file.
  • The agent can't see or change a record: the mapped role lacks that record's permission. Add the permission to the role, or map a role that has it.
  • Requests fail with 429: every integration in the account shares one concurrency limit. Wait a moment and retry, or ask your administrator to reserve some of the limit for the Lava integration record.

NetSuite's own reference lives at OAuth 2.0 Client Credentials Setup.