How to setup login_info on Netsuite web service?

Netsuite brands its web service integration services as SuiteTalk, and SuiteTalk allows third-party systems to communicate with NetSuite via the SOAP based APIs. To get started with Netsuite Webservice, you'll need a Netsuite account that you can use to communicate with Netsuite. You may sign up with the SuiteCloud Developer Network (SDN) as a Community member, and get a free Netsuite account for exploitation. It may take a day or two to get your account approved.

Virtually any programming language supporting SOAP standard can integrate with SuiteTalk, and Netsuite provides toolkit and sample codes for Java, .NET and PHP5 (limited). Since this is a PHP forum, I'll only discuss integrating with SuiteTalk with PHP programming language. Netsuite provides a PHP Toolkit which makes it easier to implement SOAP client calls. The toolkit includes a core file containing all SuiteTalk classes, core objects and operations, as well as a client-side deserializer.

Login Info

In order to make web service calls to SuiteTalk, you'll need a login credentials to SuiteTalk. Netsuite PHP Toolkit provides a login_info.php file, which you'll need to customize to gain access to SuiteTalk.

Here is a sample login_info.php file:

// Connect to live, beta, sandbox. Default is live.
$myNSclient = new nsClient( nsHost::live );

$email = "[email protected]";
$password = "password";
$account = "9999999";
$role = "18";  // Full Access Role

// set request level credentials. 
// (email, password, account#, internal id of role)
$myNSclient->setPassport($email, $password, $account, $role);

1. You may connect to live, beta or sandbox Netsuite hosts. Unless you've setup a beta or sandbox account with Netsuite, the default value of "live" will work.

2. You'll need an email address and password that you used to create a Netsuite account (or SDN account).

3. Find the Netsuite account number for Suite Talk (web service) login. You'll have to login to Netsuite portal to find your acccount number. Upon login, please follow the following steps to find your account number. Login as a Netsuite administrator.

4. You'll need an Internal ID of the user role to successfully query SuiteTalk. To do this, you'll first create a new role with the web services permission and assign the newly created role to a user. Alternatively, you may use standard NetSuite roles shown in the table below.

(a) Login to Netsuite with an administrator account.

(b) Go to Setup -> Users/Roles -> Manage Roles -> New to create a new role.

(c) Create a role with "Web Services Only Role".

(d) Go to Setup -> Integration -> Web Services Preferences. Select a User's Name, Web Services Default Role and the system will automatically pull Internal ID of the selected role.

Once you have customized the login_info.php file, you may browse "samples" folder and create a customer by running the sample_add_customer.php. You may have to slightly alter the script in order to make this to work.

The table below lists the standard Netsuite roles and their associated Internal IDs. These roles do not appear in Setup -> Users/Roles -> Manage Roles menu. You may use these internal IDs in the Passport object, which is used for the login operation. In addition to the Netsuite standard roles, you may create additional custom roles for your organization.

Note: The table above has been extracted from the SuiteTalk Web Services Platform Guide


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.