> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/patchworks-connectors/netsuite-prebuilt-connector/preparing-your-netsuite-environment-to-work-with-patchworks.md).

# Preparing your NetSuite environment to work with Patchworks

## Introduction

Before your Patchworks Netsuite connector can be used in process flows, some setup is required in your NetSuite environment. This setup allows Patchworks to authorise API calls with token-based authentication.

{% hint style="info" %}
When you [add a Patchworks connector instance](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md) for NetSuite, you can choose to authenticate using OAuth 1 or OAuth 2. The OAuth protocol authenticates users via tokens, so this setup is imperative.
{% endhint %}

## Prerequisites

* You will need NetSuite administrator permissions to complete tasks detailed on this page.

## The steps

The required setup is detailed in five stages:

* [Stage 1: Enable REST API features](#stage-1-enable-rest-api-features)
* [Stage 2: Create a role to give access to the REST API & token-based authentication](#stage-2-create-a-role-to-give-access-to-the-rest-api-and-token-based-authentication)
* [Stage 3: Check/assign permissions for your Patchworks role](#stage-3-check-assign-permissions-for-your-patchworks-role)
* [Stage 4: Assign the role to a user](#stage-4-assign-the-role-to-a-user)
* [Stage 5: Add a Patchworks integration](#stage-5-add-a-patchworks-integration)

### Stage 1: Enable REST API features

Follow the steps below:

**Step 1**\
In NetSuite, login as an admin user and navigate to **setup** | **company** | **enable features**:

&#x20;![](/files/dMJqU74H3cx2vA9zgSI1)

**Step 2**\
Select the **SuiteCloud** tab - all available features are listed within a series of categories.&#x20;

**Step 3**\
Scroll to the **SuiteTalk (Web Services)** category and ensure that the following features are selected/enabled:

* SOAP WEB SERVICES
* REST WEB SERVICES&#x20;
* REST RECORD SERVICE (BETA) - if available

For example:

<div align="left"><figure><img src="/files/ETPAk6EV9wLsF2d4r2Xx" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
If you don't see the **REST RECORD SERVICE (BETA)** option, look for a blue banner at the top of the **setup** | **company** | **enable features** page:\
\
![](/files/Kk7E3Rn3X8wwBFzfsYTN)\
&#x20;\
Use the **click here** link to view Beta activities and apply to participate in the **Oracle NetSuite Umbrella Beta Program** Beta activity:\
\
![](/files/C8b3k4KDBrZQ0Ykb5jyn)

If you don't see the the **REST RECORD SERVICE (BETA)** option and there's no banner for you to opt in, don't worry - it's not required.
{% endhint %}

**Step 4**\
Scroll to the **Manage Authentication** category and ensure that the following features are selected/enabled:

* TOKEN-BASED AUTHENTICATION
* OAUTH 2.0

For example:

<div align="left"><figure><img src="/files/R2AwjRS3Ffyo5px22AYq" alt=""><figcaption></figcaption></figure></div>

You may find that some features (including other authentication settings) are already set when you access the **enable features** page in NetSuite. This is fine.

**Step 5**\
Save changes.

### Stage 2: Create a role to give access to the REST API & token-based authentication

{% hint style="info" %}
Adding a new role is optional - if you have an existing role that you would like to use that's fine - you can simply select that role (via **setup** | **users/roles** | **manage roles**) and go straight to [stage 3](#stage-3-check-assign-permissions-for-your-patchworks-role).
{% endhint %}

**Step 1**\
In NetSuite, login as an admin user and navigate to **setup** | **users/roles** | **manage roles**:

<div align="left"><figure><img src="/files/W7S0DpyOItBRD6L7dBhp" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 2**\
Click the **new role** button:

<div align="left"><figure><img src="/files/iSayi79SCW43Qv8xQM3b" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 3**\
In the **name** field enter a name for this role, we suggest:

```
Patchworks Integration
```

For example:

<div align="left"><figure><img src="/files/ZgBSGDaxuIs7AVpBVhof" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 4**\
Go directly to [stage 3](#stage-3-check-assign-permissions-for-your-patchworks-role).

### Stage 3: Check/assign permissions for your Patchworks role

**Step 1**\
In the lower panel, select the **permissions** tab:

<div align="left"><figure><img src="/files/X92KKUXyKJSc8vdcVpU4" alt=""><figcaption></figcaption></figure></div>

Here, you use permission tabs to navigate between different permission categories:

<figure><img src="/files/ORuXJN4qHvDIuaT8nnde" alt=""><figcaption></figcaption></figure>

**Step 2**\
Switch between these categories and ensure that the following permissions are granted:

| Category     | Permission                                                                                                                                                                                                                                | Access level             |                                  |                               |      |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------------------------------- | ----------------------------- | ---- |
| Setup        | Accounting lists                                                                                                                                                                                                                          | View                     |                                  |                               |      |
| Setup        | Customer status                                                                                                                                                                                                                           | Full                     |                                  |                               |      |
| Setup        | Custom fields                                                                                                                                                                                                                             | View                     |                                  |                               |      |
| Setup        | Custom body fields                                                                                                                                                                                                                        | View                     |                                  |                               |      |
| Setup        | Custom entity fields                                                                                                                                                                                                                      | View                     |                                  |                               |      |
| Setup        | Custom record types                                                                                                                                                                                                                       | View                     |                                  |                               |      |
| Setup        | Custom column fields                                                                                                                                                                                                                      | View                     |                                  |                               |      |
| Setup        | Custom item fields                                                                                                                                                                                                                        | View                     |                                  |                               |      |
| Setup        | Custom lists                                                                                                                                                                                                                              | View                     |                                  |                               |      |
| Setup        | Custom transaction fields                                                                                                                                                                                                                 | View                     |                                  |                               |      |
| Setup        | Log in using access tokens                                                                                                                                                                                                                | Full                     |                                  |                               |      |
| Setup        | REST web services                                                                                                                                                                                                                         | Full                     |                                  |                               |      |
| Reports      | SuiteAnalytics workbook                                                                                                                                                                                                                   | Edit                     |                                  |                               |      |
| Lists        | Subsidiaries                                                                                                                                                                                                                              | Full                     |                                  |                               |      |
| Lists        | Contacts                                                                                                                                                                                                                                  | Full                     |                                  |                               |      |
| Lists        | <p>Currency<br><img src="/files/SQLJTyh7dnCup0hVzTVb" alt="" data-size="line"> This permission is only displayed if the multi-currency feature is enabled for your company. If you need to check this, navigate to <strong>setup</strong> | <strong>company</strong> | <strong>enable features</strong> | <strong>company</strong>.</p> | Edit |
| Lists        | Customers                                                                                                                                                                                                                                 | Full                     |                                  |                               |      |
| Lists        | Entity-subsidiary relationship view                                                                                                                                                                                                       | Full                     |                                  |                               |      |
| Lists        | Items                                                                                                                                                                                                                                     | Full                     |                                  |                               |      |
| Lists        | Record custom field                                                                                                                                                                                                                       | Full                     |                                  |                               |      |
| Lists        | Payment methods                                                                                                                                                                                                                           | Full                     |                                  |                               |      |
| Lists        | Shipping items                                                                                                                                                                                                                            | Full                     |                                  |                               |      |
| Lists        | Perform search                                                                                                                                                                                                                            | Full                     |                                  |                               |      |
| Transactions | Customer deposit                                                                                                                                                                                                                          | Full                     |                                  |                               |      |
| Transactions | Customer payment                                                                                                                                                                                                                          | Full                     |                                  |                               |      |
| Transactions | Customer refund                                                                                                                                                                                                                           | Full                     |                                  |                               |      |
| Transactions | Find transaction                                                                                                                                                                                                                          | Full                     |                                  |                               |      |
| Transactions | Fulfill Orders                                                                                                                                                                                                                            | Full                     |                                  |                               |      |
| Transactions | Sales order                                                                                                                                                                                                                               | Full                     |                                  |                               |      |

**Step 3**\
Save changes.

### Stage 4: Assign the role to a user

{% hint style="info" %}
The steps below assume that you already have a NetSuite user ready to associate with the permissions granted above. However, you can create a new user if required. &#x20;
{% endhint %}

**Step 1**\
In NetSuite (logged in as an admin user), navigate to **setup** | **users/roles** | **manage users**:

<div align="left"><figure><img src="/files/Nz6h3mjIg0pLpdOulpJ8" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 2**\
From the list of users, select the user that you want to update with new permissions.

**Step 3**\
In the lower panel, select the **access** tab:

<div align="left"><figure><img src="/files/wjqxtzMQlQTXNhQjQMVo" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 4**\
Assign the `Patchworks integration` role that you saved in [stage 3](#stage-3-check-assign-permissions-for-your-patchworks-role).

**Step 5**\
Save changes.

### Stage 5: Add a Patchworks integration

**Step 1**\
In NetSuite (logged in as an admin user), navigate to **setup** | **integration** | **manage integrations**.

**Step 2**\
Click the **new** button:

<div align="left"><figure><img src="/files/Ndgo1rLjLETptf8adFGK" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 3**\
In the **name** field we suggest entering:

```
Patchworks Integration
```

**Step 4**\
Set the **state** field to **enabled**.

**Step 5**\
Move down to the **token-based authentication** section and select/de-select options as per your requirements:

<details>

<summary><img src="/files/mjTTZzyEQN7pfYDU3Ixl" alt="" data-size="line"> I want to use OAuth 1 authentication in Patchworks</summary>

Ensure that the following options are selected:

* TOKEN-BASED AUTHENTICATION
* TBA: ISSUETOKEN ENDPOINT
* TBA: AUTHORIZATION FLOW
* CALLBACK URL set to <https://app.wearepatchworks.com/oauth/authenticate> for the Patchworks production environment&#x20;

For example:

![](/files/Q9xmkgvBvk9WnOCJggsD)<br>

</details>

<details>

<summary><img src="/files/mjTTZzyEQN7pfYDU3Ixl" alt="" data-size="line"> I don't want to use OAuth 1 authentication in Patchworks</summary>

Ensure that no token-based authentication options are selected.

</details>

**Step 6**\
Move down to the **OAuth 2.0** section and select/de-select options as per your requirements:

<details>

<summary><img src="/files/mjTTZzyEQN7pfYDU3Ixl" alt="" data-size="line"> I want to use OAuth 2 (client credentials) authentication in Patchworks</summary>

Ensure that the following options are selected:

* CLIENT CREDENTIALS (MACHINE TO MACHINE) GRANT
* RESTLETS
* REST WEB SERVICES

Ensure that the following options are NOT selected:

* AUTHORIZATION CODE GRANT

For example:

![](/files/TTxZrS2uuXmtYKvKb5cI)

</details>

<details>

<summary><img src="/files/mjTTZzyEQN7pfYDU3Ixl" alt="" data-size="line"> I don't want to use OAuth 2 (client credentials) authentication in Patchworks</summary>

Ensure that no OAuth 2.0 options are selected.

</details>

**Step 7**\
Save changes. At this point, client credentials are provided for this integration - add these to your password manager:

<div align="left"><figure><img src="/files/jOF5VgT4hhrZBnli5beo" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
These credentials are only displayed once and are needed to [add Patchworks instances](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md) of the NetSuite connector - make sure that you have them noted securely for future reference.
{% endhint %}

**Step 8**\
The required NetSuite setup is now complete. If you haven't done so already, [install the NetSuite connector from the Patchworks marketplace](/product-documentation/connectors-and-instances/working-with-connectors/installing-a-connector.md), then [add required instances](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md) and [make connections in process flows](/product-documentation/process-flows/building-process-flows.md)!
