# NetSuite

### Overview

The NetSuite integration imports your transaction history, inventory levels, and product catalog from NetSuite saved searches into Moselle. Once connected, data syncs automatically on a daily basis.

***

### Connect NetSuite

To set up the NetSuite integration, you will need to generate API credentials in NetSuite and have them ready to share with the Moselle support team during your initial onboarding call.

#### Step 1: Create Web Services Role in NetSuite

1. In NetSuite, navigate to **Setup → Users/Roles → Manage Roles**
2. Click **New** to create a new role
3. Name the role (e.g., "Moselle Web Services")
4. Under **Permissions**, add the following (ensure access level is set to **Full**):
   * **Setup Tab**:
     * Log in using Access Tokens
     * SOAP Web Services
   * **Lists Tab**:
     * Perform Search
     * Persist Search
     * Publish Search
     * Items
     * Locations
     * Customers
     * Vendors
     * Any custom records you want to sync
   * **Transactions Tab**:
     * Find Transactions
     * Sales Orders
     * Purchase Orders
     * Transfer Orders
   * **Reports Tab**:
     * SuiteAnalytics Workbook
5. Save the role

#### Step 2: Create Integration Record

1. Navigate to **Setup → Integration → Manage Integrations**
2. Click **New**
3. Name the integration (e.g., "Moselle Integration")
4. Under the **Authentication** tab:
   * Enable **Token-Based Authentication**
   * **Turn off** TBA: ISSUETOKEN Endpoint
   * **Turn off** TBA: Authorization Flow
   * Under the **OAuth 2.0** section, ensure everything is **turned off**
5. Save the integration
6. **Record the Consumer Key and Consumer Secret** — you will need these for authentication

#### Step 3: Generate Access Tokens

1. Navigate to **Setup → Users/Roles → Access Tokens → New**
2. Select the **Application** (integration record from Step 2)
3. Select your **User**
4. Select the **Role** (web services role from Step 1)
5. Save the access token
6. **Record the Token ID and Token Secret** — you will need these for authentication

#### Step 4: Get Your Account ID

Your NetSuite Account ID is found in your NetSuite URL:

* If your URL is `https://1234567.app.netsuite.com`, your Account ID is `1234567`
* If your URL includes a region code like `https://1234567-sb1.app.netsuite.com`, your Account ID is `1234567-sb1`

#### Step 5: Create Saved Searches

NetSuite integration pulls data from saved searches you create in NetSuite. Create saved searches for the data you want to sync:

1. Navigate to **Lists → Search → Saved Searches → New**
2. Select the record type (e.g., Transaction, Item, Customer)
3. Add the fields you want to include in Moselle
4. Set search criteria if needed
5. Make the search **Public** or share it with the integration user
6. Save the search with a descriptive name

**Important Limitations:**

* Formula fields within saved searches will not be returned
* Saved searches with summary results are not supported
* Related objects return only internal IDs (see Data Sync Details below)

#### Step 6: Share Credentials During Onboarding Call

Have the following credentials ready to share with the Moselle support team during your initial onboarding call:

* **Consumer Key**
* **Consumer Secret**
* **Token ID**
* **Token Secret**
* **Account ID**
* **Names of saved searches** you want to sync

During the call, our team will work with you to configure the integration in Moselle and verify that data syncs correctly.

***

### Data Sync Details

**Sync Frequency** — NetSuite data syncs daily.

**Saved Search Results** — The integration pulls the full data results from your configured saved searches.

**Related Objects** — Related objects (e.g., customer on a sales order) return only internal IDs. To get full details for related objects:

* Add joined fields to your NetSuite saved search (e.g., customer name, customer email), or
* Create separate saved searches for related record types and link them in Moselle using the internal IDs

**SKU Matching** — NetSuite items automatically link to Moselle items when SKUs match exactly. Non-matching SKUs require manual linking.

***

### Supported Record Types

The NetSuite integration supports pulling data from:

* **Transactions** — Sales orders, purchase orders, transfer orders, and custom transactions
* **List Objects** — Items, locations, companies, customers, vendors
* **Custom Records** — Any organization-defined custom record objects
* **Reports** — Specific report types with appropriate permissions

***

### Data Mapping & Routing

To ensure your data flows correctly into Moselle, we use specific mapping logic for Sales Channels and Warehouses.

#### Sales Channel Routing

Sales orders from NetSuite need to be routed to specific Sales Channels in Moselle (e.g., Wholesale, Ecommerce, Retail).

* **How it works:** We configure the integration to filter orders based on a field in your NetSuite Sales Order.
* **Common Method (Entity/Customer):** Most often, we route orders based on the **Entity** (Customer or Project). For example, if you have a "Wholesale" channel in Moselle, you provide us the NetSuite Entity ID for your wholesale customer, and we route all matching orders to that channel.
* **Alternative Methods:** If you distinguish channels differently (e.g., by Class, Department, or a Custom Field), let us know! We can configure the routing based on any field available in your Saved Search.

#### Warehouse Mapping (Location Linking)

Moselle links NetSuite **Locations** to Moselle **Warehouses** using an **exact name match**.

* **Automatic Linking:** If a Location name in NetSuite exactly matches a Warehouse name in Moselle (case-sensitive), they will be automatically linked. Inventory levels from that NetSuite Location will sync to the corresponding Moselle Warehouse.
* **Automatic Creation:** If Moselle receives a Location name from NetSuite that does not exist in Moselle, it will **automatically create a new Warehouse** with that name and link them.

**Tip:** To prevent duplicate warehouses, ensure your NetSuite Location names match your existing Moselle Warehouse names exactly before the first sync.

***

### Saved Search Requirements

For the Sales Order sync to function correctly, your NetSuite Transaction Saved Search must return the following fields with these specific properties:

| Field        | Description      | Required Format / Notes                                   |
| ------------ | ---------------- | --------------------------------------------------------- |
| **trandate** | Transaction Date | Must be formatted as `M/D/YYYY` (e.g., `1/28/2026`).      |
| **tranid**   | Transaction ID   | The unique identifier for the order (e.g., `SO-12345`).   |
| **item**     | Item Internal ID | The internal ID of the item sold.                         |
| **quantity** | Quantity         | Numeric value.                                            |
| **amount**   | Total Amount     | Numeric value.                                            |
| **rate**     | Unit Price       | Numeric value. Used to calculate amount if total is zero. |

* **Note:** If your NetSuite configuration uses different field IDs, please let the Moselle team know so we can map them correctly.

***

### Troubleshooting

| Issue                              | Cause                                                  | Solution                                                                      |
| ---------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------- |
| Integration not connecting         | Incorrect credentials or insufficient role permissions | Verify credentials and ensure role has all required permissions               |
| Saved search not appearing         | Search is private or not shared with integration user  | Make search public or share with the integration user                         |
| Missing fields in synced data      | Formula fields or summary results in saved search      | Remove formula fields and summary settings from saved search                  |
| Related object details not syncing | NetSuite returns only internal IDs for related objects | Add joined fields to saved search or create separate searches for each record |
| Items not linking automatically    | SKUs don't match between NetSuite and Moselle          | Manually link items or update SKUs to match                                   |

***

### Important

**Formula fields are not supported.** NetSuite saved searches containing formula fields will not return those fields in the sync. Use standard fields or add joined fields instead.

**Summary searches are not supported.** Saved searches with summary results enabled cannot be synced. Disable summary mode in your saved search configuration.

***

### Optimizing NetSuite Data for Forecasting

If you use Moselle's forecasting features, these additional considerations help ensure accurate demand predictions from your NetSuite data.

#### Include the Right Transaction Types

Make sure your saved search captures all transaction types that represent real customer demand:

* **Sales Orders** — Primary demand signal
* **Cash Sales** — If you use point-of-sale or cash transactions
* **Credit Memos / Returns** — To net out returns from gross demand

{% hint style="warning" %}
**Exclude Transfer Orders and Purchase Orders** from your demand saved search. These represent internal inventory movement, not customer demand, and will distort your forecast.
{% endhint %}

#### Include Sufficient History

Include at least **12–24 months** of historical transactions. More history gives Mo better seasonal pattern detection. If you have multiple years of data, include it all — Mo will weight recent data more heavily.

#### Add Joined Fields for Channel Routing

If you route sales to different Moselle channels based on customer or class, include the relevant joined fields:

* **Entity/Customer name or ID** — For customer-based channel routing
* **Class or Department** — For class-based channel routing
* **Custom fields** — If you use custom fields to distinguish channels

Without these fields, Moselle can't route transactions to the correct sales channels, which leads to inaccurate channel-level forecasts.

#### Verify Channel Routing After Sync

After your initial sync:

1. Navigate to **Forecasting** and review demand by channel
2. Confirm that the volume and patterns per channel match your expectations
3. If a channel looks unexpectedly high or low, check whether transactions are being misrouted

#### Fiscal Period Alignment

NetSuite supports custom fiscal calendars, while Moselle forecasts on a standard **calendar month** basis.

| Your NetSuite Setup               | Impact on Moselle Forecasting                 | What to Do                                           |
| --------------------------------- | --------------------------------------------- | ---------------------------------------------------- |
| **Standard calendar months**      | No issues — dates align directly              | No action needed                                     |
| **4-4-5 fiscal calendar**         | Fiscal weeks don't align with calendar months | Use `trandate` (not fiscal period) in saved searches |
| **Non-January fiscal year start** | Fiscal Q1 may not equal calendar Q1           | Be aware when setting quarterly forecast guidelines  |
| **13-period calendar**            | Periods don't map to 12 calendar months       | Use `trandate` for calendar-month alignment          |

{% hint style="info" %}
Moselle uses the **transaction date** (`trandate`) to assign sales to calendar months. As long as your saved search returns accurate transaction dates, data will align correctly — regardless of your NetSuite fiscal calendar configuration.
{% endhint %}

If you use a non-standard fiscal calendar, minor differences between Moselle's monthly totals and NetSuite's fiscal period totals are expected. Quarterly totals should still align closely.

#### Forecasting Data Quality Checklist

Before generating your first forecast with NetSuite data, verify:

* [ ] Saved search includes all required fields (`trandate`, `tranid`, `item`, `quantity`, `amount`, `rate`)
* [ ] Date format is correct (`M/D/YYYY`)
* [ ] No formula fields or summary results in the saved search
* [ ] At least 12 months of transaction history included
* [ ] Channel routing configured and verified
* [ ] No overlapping saved searches causing duplicate transactions
* [ ] Warehouse names match between NetSuite Locations and Moselle Warehouses
* [ ] Transfer orders and purchase orders excluded from demand saved search


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.moselle.io/getting-started/onboarding/setup-integrations/netsuite.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
