# NetSuite ## Overview The NetSuite plugin enables Mitto to pipe data from NetSuite and store the data in a database. .. image:: assets/netsuite__mitto_data_flow.png :alt: NetSuite Mitto data flow diagram ## NetSuite Initial Setup In order for Mitto 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 Mitto 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 Mitto 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__web_servs_prefs.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 (Mitto) 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: | DBMS | Parameter | |--|--| | SQL Server | ?driver=ODBC+Driver+17+for+SQL+Server | | Snowflake | ?warehouse={warehouse} | | 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 | .. image:: assets/netsuite__intg_form.png :alt: 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 Mitto integration. If preferred, you can use an existing NetSuite user (employee) and assign the Mitto role to that employee. Whichever employee you use will be tied to the Mitto 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 Mitto. 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__new_access_token_menu.png :alt: NetSuite's New Access Token menu 2. Complete the form with the following information: - APPLICATION NAME: **Mitto** - USER: **(the Mitto 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 Mitto. ## Create NetSuite jobs in Mitto Using the values retrieved during the one-time NetSuite setup above, we next configure Mitto jobs to download your NetSuite data. 1. In Mitto, 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 Mitto 2. Enter the information you gathered from the one-time NetSuite setup above into the Mitto 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 Mitto 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 Mitto. .. NOTE:: A sequence with one or more jobs will be created by Mitto'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 Mitto 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.