# NetSuite SOAP

Netsuite SOAP enables companies to manage all key business processes within a single online system. 

## Overview

Companies use NetSuite for enterprise resource planning (ERP) and to manage inventory, track their financials, host e-commerce stores and maintain customer relationship management (CRM) systems. This flexible platform can be applied to a range of business applications.

> **Warning:** For any new integrations, please use the [NetSuite REST
> Connector](https://tray.ai/documentation/connectors/service/netsuite), as SOAP will be deprecated in 2028.
> You can find more details in the official [deprecation
> announcement](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_1540391670.html).
> The Tray REST connector is fully up to date with the NetSuite REST API
> service.

> **Info:** **PLEASE NOTE**: Make sure before continuing that you are using the correct
> NetSuite API. We have a separate page for the [NetSuite
> REST](https://tray.ai/documentation/connectors/service/netsuite) connector as there are several
> differences and they cannot be used interchangeably.

## Authentication

### Prerequisites

To use NetSuite SOAP web services the relevant \*\*SOAP Web Services must be enabled \*\*within your NetSuite account.
Additionally the SOAP web services **user must have the required permissions** **assigned to said user’s role**.
If you already have your features and permission setup then please move straight to \*\*Stage 3: \*\*[Creation](https://tray.ai/documentation/connectors/service/netsuite/#creation).

### Stage 1: Enable Features

This accordion guides you through the process of enabling token authentication and SuiteAnalytics for NetSuite REST API authentication integration with Tray.

### 1 - Navigate to Enable Features

First sign into your Netsuite account. On the top menu bar you will see an
option for **Setup**. Click on it and in the newly displaying menu select
**Company**. Another sub-menu will appear called "Setup Tasks" where you can
then choose\*\* Enable Features\*\*.
![ntsw-rest-auth-pq-1](https://tray.ai/documentation/images/connectors/service/netsuite-soap/74CZstWbpzr9E2vCezSWCG_ntsw-rest-auth-pq-1.png)

### 2 - Switch to SuiteCloud

As you will **automatically land on the Company tab** please make sure that
you **switch to the SuiteCloud tab** tab instead. You will know you have
switched to the correct tab as the sub-heading will change from
\*\*Classifications \*\*to **SuiteBuilder**.
![ntsw-rest-auth-pq-0102](https://tray.ai/documentation/images/connectors/service/netsuite-soap/3g9nZoUwR4xtVLdy63ZvKS_Group%205.png)

### 3 - Select Token Based Auth & SOAP Web Based Services

Keep scrolling through the other sub headings until you see the **Manage
Authentication**. **Check the option TOKEN-BASED AUTHENTICATION**. Note that
in order to use this feature you must accept the SuiteCloud Terms of
Service. Once you agree your Token Based Auth box will be checked. Next make
sure the **SOAP WEB SERVICES option is checked**.
![ntsw-soap-auth-pq-1](https://tray.ai/documentation/images/connectors/service/netsuite-soap/5ugFEXUtzKn0DwsWDqfllB_ntsw-soap-auth-pq-1.png)

### Stage 2: Enable Permissions

This accordion guides you through the process of\*\* setting the permissions required\*\* for the respective features enabled in the previous section.

### 1 - Choose (or create) your role

In the main menu bar at the top of the UI select the **Setup** tab. Click on it and in the newly displaying menu select **Users/Roles**.
Another sub-menu will appear called "User Management" where you can then choose\*\* Manage Roles\*\*.
Either create a **New** role or \*\*Search \*\*and edit an existing one that you wish to enable permissions for.

> **Info:** **PLEASE NOTE**: Note that if you create a new role the setup will be entirely dependant on your use case so we cannot advise you on the process here.

![ntsw-rest-auth-pq-6](https://tray.ai/documentation/images/connectors/service/netsuite-soap/6YlAEq8vjuYexWc9matFqw_ntsw-rest-auth-pq-6.png)

### 2 - Permissions bar

On the main Role page click the \*\*Edit \*\*button.
Make sure that you have \*\*ACCESSIBLE SUBSIDIARIES: All checked \*\*(found within the section heading "Subsidiary Restrictions").
Then scroll to the bottom and select the **Permissions** tab.
![ntsw-rest-auth-pq-7](https://tray.ai/documentation/images/connectors/service/netsuite-soap/4D6zVBFIhNWsS6W0e3ulg6_ntsw-rest-auth-pq-7.png)

### 3 - Add your Permissions

Within the **Permissions** tab select the drop down **Setup**.
Add permissions. **You will need the following as a base line minimum**:

* Log in using Access Tokens: FULL
* **SOAP** web services: FULL
  Then it is a case of adding any other permissions that you will need for your own personal use case.
  ![ntsw-soap-auth-pq-8](https://tray.ai/documentation/images/connectors/service/netsuite-soap/1v3dbfYNlTSXoTXdHRUiqy_ntsw-soap-auth-pq-8.png)

### Stage 3: Creation

This section begins and ends in the Tray builder so **please have your workflow space set up** before continuing.

### 1 - Choose the correct NetSuite connector

You **must** \*\*make sure you are using Netsuite SOAP connector \*\*before proceeding.
![ntsw-soap-auth-create-choice](https://tray.ai/documentation/images/connectors/service/netsuite-soap/1cQdWRhSZHpw7c8LfM5h9S_ntsw-soap-auth-create-choice.png)

### 2 - Clarify your authentication is SOAP based

Select the **Auth tab** and click the **New authentication** button.
Name your authentication in a way that will quickly identify it within a potentially large list.
In this case it would be **good to specify that this authentication is for SOAP Netsuite connectors** only.
The next page asks you for a number of credentials which you will need in order to complete setup:

* Account ID
* Consumer key
* Consumer secret
* Token ID
* Token secret
  ![ntsw-rest-auth-cre-1](https://tray.ai/documentation/images/connectors/service/netsuite-soap/5Q75DxRfCZR5XCz7z2SXY_ntsw-rest-auth-cre-1.png)

### 3 - Get Account ID

### 1 - Head to Company Information

Within Netsuite head to the **Setup** tab. Click on **Company** and in the 'Setup Tasks' category click on **Company Information**.
![nswt-rest-auth-cre-2](https://tray.ai/documentation/images/connectors/service/netsuite-soap/3BJm5sdRpP2utOVwDtDBAx_nswt-rest-auth-cre-2.png)

### 2 - Locate Account ID

This will take you to the **Company Information** page.
At teh bottom of the right hand column you will find your **Account ID**.
![nswt-rest-acc-id](https://tray.ai/documentation/images/connectors/service/netsuite-soap/1zEGcgKfnOlVYumThUmqIO_nswt-rest-acc-id%20%284%29.png)

### 4 - Get Consumer Secret / Key (also known as 'Client' secret / key)

### 1 - Head to Manage Integrations

To get your **Consumer Key** and **Consumer Secret** you need to create an **Integration record**.
Go back to the **Setup** option on the main menu. Once clicked select **Integration**. In the 'Integration Management' category click on **Manage Integrations **then** New.**.
![nswt-rest-man-inge](https://tray.ai/documentation/images/connectors/service/netsuite-soap/3Qk0SK47boLx0boXkeHimL_nswt-rest-man-inge.png)

### 2 - Locate Consumer Key / Secret

Fill in the information required.
Make sure that you have enabled **Token-Based Authentication** by checking the box.
Click **Save** and you will be redirected to a page where you will find your **Consumer Key** and **Consumer Secret**.

> **Warning:** **IMPORTANT!**: Note that this information will only be shown once so please make sure it is saved elsewhere in a secure place for future setup / requirements.

![netsuite-auth-step-5](https://tray.ai/documentation/images/connectors/service/netsuite-soap/921adf8c-53848cac_netsuite-auth-step-5.png)

### 5 - Get Token Secret / ID

### 1 - Head to Access Tokens

Go to Setup in the main menu once more and navigate through to \*\*Users/Roles \*\*-> **User Management** -> **Access Tokens**.
![netsuite-auth-step-5](https://tray.ai/documentation/images/connectors/service/netsuite-soap/921adf8c-3f1c12ca_Group%208.png)

### 2 - Locate Tokens

On the Access Tokens page click **New Access Token**.
Select the **Application Name** (of the integration record that you created earlier). See Stage 3: Creation: step "4 - Get Consumer Secret / Key (also known as 'Client' secret / key)".
The Token Name is already populated by default with a concatenation of Application Name, User, and Role.
Once done the **Token ID** and \*\*Token Secret \*\*will display.

> **Warning:** **IMPORTANT!**: Note that this information will only be shown once so please make sure it is saved elsewhere in a secure place for future setup / requirements.

![netsuite-auth-step-5](https://tray.ai/documentation/images/connectors/service/netsuite-soap/921adf8c-82faaf2c_netsuite-auth-step-8.png)

### 6 - Add all fields to your Tray.io Authentication

Once you have added these fields to your Tray.io NetSuite authentication click the **Create authentication** button. 
Your connector authentication setup should now be complete.
Please run the simplest operation available to test you can retrieve data as expected.

## Available Operations

The examples below show one or two of the available connector operations in use.
Please see the [Full Operations Reference](#operationsFull) at the end of this page for details on all available operations for this connector.

## Notes on key operations

### Search records

Sometimes you may wish to only select certain fields to be returned. This is especially true if you are intent on performing a "join" in order to reduce the amount of data coming through your workflow.
With an "advanced search records" setup, you can define all the fields you want NetSuite to return as well as a criteria for said records in order to filter the results down further.
**Please see the** **walkthrough below for a demonstration on how you could potentially set up the Tray properties panel**, in order to use with the Contact endpoint (when using the Search records operation).

### Find 'ContactSearchAdvanced'

Take the [Contact
schema](https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2022_2/schema/record/contact.html)
for example. Scroll down to the bottom of the schema page until you see the
subheading **Related Searches**. Click on **ContactSearchAdvanced**. This
will take you to the [ContactSearchAdvanced
schema](https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2022_2/schema/search/contactsearchadvanced.html?mode=package)
page.
![ntsw-soap-search-contact-schema](https://tray.ai/documentation/images/connectors/service/netsuite-soap/36dJk1XEX0sWaoFOWpxjA8_ntsw-soap-search-contact-schema.png)

### Build your 'ContactSearchAdvanced' schema in Tray.io

The diagram below demonstrates the direction of the fields and how they
relate to the Tray.io property panel.
![3-advanced-search-1](https://tray.ai/documentation/images/connectors/service/netsuite-soap/921adf8c-65b344d3_3-advanced-search-1.png)

### Add Record (& Custom records)

This section essentially walks you through \*\*how to reference a custom record \*\*in NetSuite.
Users need to be aware that **custom records are non-standard entities in NetSuite**. You need to adhere to NetSuite's non-standard entity rules when using the **Add record** operation.
**Please see the walkthrough below for a demonstration on how you could potentially set up the Tray properties panel**, in order to use with the Contact endpoint (when using the Add record operation).

### Find your Internal ID reference

Take the [CustomRecord](https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2022_2/schema/record/customrecord.html) schema (used for the \*\*Add record \*\*operation) as an example.
On a contact record under the sub-heading **Classification** we have selected the **Custom** tab.

Here we have created a custom record called **Tray user**.
![3-create-custom-record-1](https://tray.ai/documentation/images/connectors/service/netsuite-soap/921adf8c-495e1b8a_Group%201.png)
When you click into the name record itself you will be able to see the `internalId` of the **record type** itself within the URL which you will need for referencing later.

```json
https://tstdrv001.app.netsuite.com/app/common/custom/custrecordentry.nl?rectype=476&id=1405
```

### Build your 'Add record' schema in Tray.io

The diagram below demonstrates the direction of the fields and how they relate to the Tray.io property panel.
![3-create-custom-record-2](https://tray.ai/documentation/images/connectors/service/netsuite-soap/921adf8c-a52e4a1d_3-create-custom-record-2.png)

***

## Further Info (REST & SOAP)

The following sections are mainly relevant to SOAP users however there is some cross over for our REST customers.

## Reverting XML Schema

Despite the fact that the NetSuite APIs (REST and SOAP) primarily deals in XML Tray has taken steps to standardise our NetSuite connectors so that they work using JSON instead.
However in order for NetSuite to process requests correctly, the input still requires a translation back to XML.
Therefore we have implemented a way to transform JSON back into XML. However this still **requires the JSON object to be in a specific format** in order to talk to NetSuite.
Check out the simple demo below for formatting details and example input / output schemas.

### Format

The format of the object has 3 main fields. The parameters are outlined below following a simple example.

* `name`
  * Note that this field is **REQUIRED**
  * **Must be** `type: string`
* `value`
  * Can be `type: string`
  * Can be `type: object`
  * It must hold the same three field references
  * Can be **an array of objects**
  * Each object must hold the same three field references
* `attributes`
  * Can be `type: object`
  * Accepts any key/value pair
  * Pairings must be in `type: string` format

```json
\{
 "name": "string (required)",
 "value": "string|object|array",
 "attributes": \{
  "key": "string"
 \}
\}
```

### JSON / Input

```json
\{
  "name": "input",
  "value": [
    \{
      "name": "name",
      "value": "tray.io"
    \},
    \{
      "name": "contact",
      "value": \{
        "name": "phone",
        "value": "+1-415-418-3570"
      \}
    \}
    \{
      "name": "otherInfo",
      "attributes": \{
        "nil": "true"
      \}
    \}
  ],
  "attributes": \{
    "type": "generic"
  \}
\}
```

### XML / Output

```html
<input type="generic">
  &lt;name>tray.io&lt;/name&gt;
  <contact>
    <phone>+1-415-418-3570</phone>
  </contact>
  <otherInfo nil="true"/>
</input>
```

## SuitTalk Guides

### SuiteTalk platform help

For information on how SuiteTalk works login into your NetSuite account and head to the **Help Centre** -> **SuiteCloud** -> **SuiteTalk** section.
Here you can then select the following options:

* **SuiteTalk (Web Services) Platform Guide**: Explains how the SuiteTalk API works and what each request requires.
* **Web Services Operations**: Relevant operation
* **SuiteTalk (Web Services) Records Guide**: Explains how the data is represented, constructed, and related.

### SuiteTalk WSDL and Schema definitions

* [WSDL](https://webservices.netsuite.com/wsdl/v2017_1_0/netsuite.wsdl)
* [Core XSD](https://webservices.netsuite.com/xsd/platform/v2017_1_0/core.xsd)
* [Core Type XSD](https://webservices.netsuite.com/xsd/platform/v2017_1_0/coreTypes.xsd)
* [Common XSD](https://webservices.netsuite.com/xsd/platform/v2017_1_0/common.xsd)
* [Relationship XSD](https://webservices.netsuite.com/xsd/lists/v2017_1_0/relationships.xsd)
* **Schema and Records** [Browser](http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_2/schema/record/account.html)

### SuiteTalk operation / request cross-reference

> **Info:** \*\*BEST PRACTICES: \*\*Whenever you do decide to create your own workflow, be
> sure to check out some of our key articles such as: - [Using callable
> workflows](https://tray.ai/documentation/platform/automation-integration/building-workflows/composable-workflows/calling-other-workflows)
> -----------------------------------------------------------------------------------------------------------------------------------------[Pagination](https://tray.ai/documentation/platform/automation-integration/advanced-use-cases/batching-queueing/pagination)- [Data transformation
>   guide](https://tray.ai/documentation/platform/automation-integration/building-workflows/mapping-data/data-transformation-guide)

### Reference Table

| Operation (tray.io)                 | Request endpoint (SuiteTalk)                                                                                                                                                              |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Add record                          | [add](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3480855.html)                                                                                                       |
| Batch add records                   | [addList](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3481360.html)                                                                                                   |
| Batch delete records                | [deleteList](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3486552.html)                                                                                                |
| Batch get records                   | [getList](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3499748.html)                                                                                                   |
| Batch update records                | [updateList](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3527652.html)                                                                                                |
| Batch upsert records                | [upsertList](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3533243.html)                                                                                                |
| Delete record                       | [delete](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3486046.html)                                                                                                    |
| Get record                          | [get](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3488543.html)                                                                                                       |
| List records                        | [getAll](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3489077.html)                                                                                                    |
| Search records                      | [search](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3514760.html) and [Basic Searches](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3519853.html) |
| Search records more (by pagination) | [searchMoreWithId](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3523074.html)                                                                                          |
| Update record                       | [update](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3527090.html)                                                                                                    |
| Upsert record                       | [delete](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3532463.html)                                                                                                    |

## Appendix I: Namespace to Alias Mappings

### Reference table

| Namespace                                                      | Namespace Alias                |
| -------------------------------------------------------------- | ------------------------------ |
| urn:accounting.lists.webservices.netsuite.com                  | listAccounting                 |
| urn:bank.transactions.webservices.netsuite.comtransaction      | transactionBank                |
| urn:common.platform.webservices.netsuite.com                   | platformCommon                 |
| urn:communication.general.webservices.netsuite.com             | generalCommunication           |
| urn:core.platform.webservices.netsuite.com                     | platformCore                   |
| urn:customers.transactions.webservices.netsuite.com            | transactionCustomers           |
| urn:customization.setup.webservices.netsuite.com               | setupCustomization             |
| urn:demandplanning.transactions.webservices.netsuite.com       | transactionDemandplanning      |
| urn:employees.lists.webservices.netsuite.com                   | listEmployees                  |
| urn:employees.transactions.webservices.netsuite.com            | transactionEmployees           |
| urn:faults.platform.webservices.netsuite.com                   | platformFaults                 |
| urn:faults.platform.webservices.netsuite.com                   | platformCommonTypes            |
| urn:filecabinet.documents.webservices.netsuite.com             | documentFilecabinet            |
| urn:financial.transactions.webservices.netsuite.com            | transactionFinancial           |
| urn:general.transactions.webservices.netsuite.com              | transactionGeneral             |
| urn:inventory.transactions.webservices.netsuite.com            | transactionInventory           |
| urn:marketing.lists.webservices.netsuite.com                   | listMarketing                  |
| urn:messages.platform.webservices.netsuite.com                 | platformMsgs                   |
| urn:purchases.transactions.webservices.netsuite.com            | transactionPurchases           |
| urn:relationships.lists.webservices.netsuite.com               | listRel                        |
| urn:sales.transactions.webservices.netsuite.com                | transactionSales               |
| urn:scheduling.activities.webservices.netsuite.com             | activityScheduling             |
| urn:supplychain.lists.webservices.netsuite.com                 | listSupplychain                |
| urn:support.lists.webservices.netsuite.com                     | listSupport                    |
| urn:types.accounting.lists.webservices.netsuite.com            | listAccountingTypes            |
| urn:types.communication.general.webservices.netsuite.com       | generalCommunicationTypes      |
| urn:types.customization.setup.webservices.netsuite.com         | setupCustomizationTypes        |
| urn:types.demandplanning.transactions.webservices.netsuite.com | transactionDemandplanningTypes |
| urn:types.employees.lists.webservices.netsuite.com             | listEmployeesTypes             |
| urn:types.filecabinet.documents.webservices.netsuite.com       | documentFilecabinetTypes       |
| urn:types.inventory.transactions.webservices.netsuite.com      | transactionInventoryTypes      |
| urn:types.marketing.lists.webservices.netsuite.com             | listMarketingTypes             |
| urn:types.relationships.lists.webservices.netsuite.com         | listRelTypes                   |
| urn:types.sales.transactions.webservices.netsuite.com          | transactionSalesTypes          |
| urn:types.scheduling.activities.webservices.netsuite.com       | activitySchedulingTypes        |
| urn:types.supplychain.lists.webservices.netsuite.com           | listSupplychainTypes           |
| urn:types.support.lists.webservices.netsuite.com               | listSupportTypes               |
| urn:types.website.lists.webservices.netsuite.com               | listWebsiteTypes               |
| urn:website.lists.webservices.netsuite.com                     | listWebsite                    |

## Appendix II: Further Documentation

* [NetSuite Basic Search Docs](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3514760.html\&whence=)
* [NetSuite Schema Browser](http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/schema/record/account.html)
* [NetSuite NetSuite Help Centre](https://system.netsuite.com/app/help/helpcenter.nl?topic=DOC_FRONTPAGE\&whence=)
