# NetSuite ## Overview The NetSuite plugin enables Zuar Runner to pipe data from NetSuite and store the data in a database. .. image:: assets/netsuite-1.png :alt: NetSuite Zuar Runner data flow diagram ## NetSuite Initial Setup In order for Zuar Runner to connect and access data via the NetSuite API, follow the instructions in this section. This only needs to be done one time. .. NOTE:: This setup requires a NetSuite administrator account! During the NetSuite setup, you'll obtain the following information, which Zuar Runner needs in order to access your data: * Account ID * Consumer Key * Consumer Secret * Token ID * Token Secret ### Enable features .. NOTE:: If these features are not enabled, you will not see the permissions required in later steps. 1. From NetSuite's top menu, click **Setup** > **Company** > **Enable Features**. .. image:: assets/netsuite__enable_features_menu.png :alt: NetSuite's Enable Features menu selection 2. Click the [SuiteCloud](https://www.netsuite.com/portal/platform.shtml) tab. .. image:: assets/netsuite__suitecloud_tab.png :alt: Click SuiteCloud tab 3. Under **SuiteTalk (Web Services)** make sure **SOAP WEB SERVICES** is checked. Accept "Terms of Service" if checking for the first time. .. image:: assets/netsuite__soap_web_services.png :alt: Check SOAP WEB SERVICES 4. Under **Manage Authentication** make sure **TOKEN-BASED AUTHENTICATION** is checked. Accept "Terms of Service" if checking for the first time. .. image:: assets/netsuite__token_based_auth.png :alt: Check TOKEN-BASED AUTHENTICATION 5. Click **Save** at the bottom of the page. ## Install Bundle with Zuar Runner Role .. NOTE:: This bundle adds a new role to your NetSuite instance that will be used in later steps. 1. From NetSuite's top menu, click **Customization** > **SuiteBuilder** > **Search & Install Bundles**. .. image:: assets/netsuite__install_bundle.png :alt: NetSuite's Bundles menu 2. Type `Zuar` in the **KEYWORDS** search field and click **Search**. .. image:: assets/netsuite__zuar_bundle.png :alt: Zuar NetSuite bundle 3. Click on the `Zuar, Inc. - Mitto Bundle`. The **BUNDLE ID** is `387543`. 4. Click **Install** and then **Install Bundle**. ### Account ID 1. From NetSuite's top menu, click **Setup** > **Integration** > **Web Services Preferences**. .. image:: assets/netsuite-8.png :alt: NetSuite's Web Services Preferences menu 2. Copy the **ACCOUNT ID** and save for later. (Obscured by a red box in the screenshot below.) .. image:: assets/netsuite__acct_id.png :alt: Copy the ACCOUNT ID ### Create an Integration Record .. NOTE:: The integration record identifies the application (Zuar Runner) in NetSuite's system. 1. From NetSuite's top menu, click **Setup** > **Integration** > **Manage Integrations** > **New**. .. image:: assets/netsuite__mng_integrations.png :alt: NetSuite's Manage Integrations menu 2. Create a new Integration Record by completing the form with the following information: .. table:: Integration Record values :widths: auto ============================== ========== Field Value ============================== ========== NAME Mitto STATE Enabled Authentication blank USER CREDENTIALS Unchecked TOKEN-BASED AUTHENTICATION Checked TBA: AUTHORIZATION FLOW Unchecked Oauth blank AUTHORIZATION CODE GRANT Unchecked ============================== ========== .. figure:: assets/netsuite__intg_form.png :alt: A completed Integration Record form A completed Integration Record form 3. Click **Save**. 4. Copy the the **CONSUMER KEY** and **CONSUMER SECRET** and store them in a safe place (e.g. password vault) for later. ### Create a New NetSuite Employee .. NOTE:: The instructions in this section create a new user in NetSuite for use by the Zuar Runner integration. If preferred, you can use an existing NetSuite user (employee) and assign the Zuar Runner role to that employee. Whichever employee you use will be tied to the Zuar Runner Integration record via an Access Token. 1. From NetSuite's top menu, click **Lists** > **Employees** > **New**. .. image:: assets/netsuite__new_employee_menu.png :alt: NetSuite's New Employee menu 2. Complete the form with the information required by your organization (Name, Email, Subsidiary, etc). .. image:: assets/netsuite__new_employee_form.png :alt: NetSuite New Employee Form 3. On the **Access** tab, set up a password based on your organization's policies. Store this password securely for use with Zuar Runner. 4. Under **Roles**, assign the `Mitto User Role` (this role is from the bundle you installed earlier). .. image:: assets/netsuite__new_user_access.png :alt: New Employee form - Access tab 5. Click **Save**. ### Create an Access Token 1. From NetSuite's top menu, click **Setup** > **Users/Roles** > **Access Tokens** > **New**. .. image:: assets/netsuite-15.png :alt: NetSuite's New Access Token menu 2. Complete the form with the following information: - APPLICATION NAME: **Mitto** - USER: **(the Zuar Runner employee/user you created previously)** - ROLE: **Mitto User Role** - TOKEN NAME: **(leave unchanged)** 3. Click **Save**. 4. Copy the **TOKEN ID** and **TOKEN SECRET** and store securely for use in Zuar Runner. ## Create NetSuite Jobs in Zuar Runner Using the values retrieved during the one-time NetSuite setup above, we next configure Zuar Runner jobs to download your NetSuite data. 1. In Zuar Runner, select **Add Job** on the left sidebar. Select **NetSuite CRM** from the list of plugins. .. image:: assets/netsuite__add_job.png :alt: Adding a NetSuite job in Zuar Runner 2. Enter the information you gathered from the one-time NetSuite setup above into the Zuar Runner NetSuite wizard. Your NetSuite `ACCOUNT ID` should be entered into the **Account** field. .. image:: assets/netsuite__acct_creds.png :alt: Enter NetSuite account details 3. Click **Next**. 4. The next step asks you to select which NetSuite jobs to add to a sequence. You can choose to **Enable All** the jobs or you can **Disable All** to select individual jobs you want to create. Select **Next** after you have chosen which jobs you want to add. .. image:: assets/netsuite__specify_ns_jobs.png :alt: Specify NetSuite jobs to create 5. On the next screen, specify the where NetSuite data should be stored. .. image:: assets/netsuite__spec_output.png :alt: Specify output - **Type** - **Local Database** (recommended): Mitto's internal PostgreSQL database - **Redshift**: AWS-hosted database - **Custom**: Specify the connection string of the destination database - **Schema** - The schema is a database organization mechanism which groups database objects (tables, views, etc.) and can be used for security purposes. - The default schema is: `netsuite` - **Prefix table names** - Checking option box will prefix each table created by the Zuar Runner NetSuite jobs with `netsuite`. This is convenient when tables are not being created in a NetSuite-specific schema. 6. Click **Save**. Congratulations! You have just connected NetSuite to Zuar Runner. .. NOTE:: A sequence with one or more jobs will be created by Zuar Runner's NetSuite wizard. If you run the sequence, *all* jobs (potentially several hundred) will be executed and may take a long time. You can run individual jobs if you don't want Zuar Runner to download all NetSuite data at once. Next, [schedule](/jobs/index) your NetSuite jobs so the data stays updated. ## NetSuite Saved Searches You will often want to get data from a NetSuite Saved Search. Refer to the Saved Search [documentation](https://www.zuar.com/api/mitto/plugin/netsuite/) for more details.