# NetSuite data mapping

NetSuite data mapping connects products, stock, suppliers, sales, purchase orders and receipts with their Optiply fields. Read imports separately from purchase-order exports because their identifiers and dates serve different purposes.

## Before you compare NetSuite fields

Identify the entity, direction and NetSuite environment you want to compare. Check which flows, locations and custom mappings your setup owner selected. Use [NetSuite setup](/article/netsuite-set-up-and-connection) for access and connection instructions.

## Steps to compare NetSuite fields

1. Find the entity and direction in the tables below.
2. Match the NetSuite source identifier to the corresponding Optiply record.
3. Check the applicable location, status, price and date conditions below that table.
4. Compare a complete order and its lines rather than matching a field name alone.
5. Ask your setup owner to confirm any custom mapping or synchronization timing before investigating a mismatch.

## Fields in NetSuite product and stock imports

These are the standard field correspondences. Custom product and supplier mappings can replace their standard inputs.

| Optiply field | NetSuite source or rule |
| --- | --- |
| `remoteId` | Item `id`. |
| `name` | `fullname`. |
| `skuCode` | `custitem_cl_sku`. |
| `articleCode` | `vendorname`. |
| `eanCode` | `upccode`. |
| `createdAtRemote` | `createddate`. |
| `stockLevel` | Sum of `inventory_item_locations.quantityavailable` for the selected locations, rounded to whole units. |
| `price` | Active `item_prices.price`, restricted by `filter_product_pricelevel` when configured, rounded to two decimals. |
| `status` | With `custitem_cl_item_status`, code `5` disables the product. Other codes enable it. |
| `notBeingBought` | With `custitem_cl_item_status`, codes `1`, `3`, `7` or `8` set this to true. |
| `assembled` | Code `4` sets this to true. A matched composition also marks its parent assembled. |

Only item types `InvtPart` and `Kit` enter the product import. When the custom status field is absent, `isinactive` supplies the enabled/disabled status.

Stock uses available quantity, not quantity on hand. If several active prices remain eligible, this mapping does not define a price-level priority; confirm the selected price level. `stock_location_ids` selects locations. Without a location selection, all supplied locations contribute. The stock calculation retains earlier location values between updates.

### Product compositions — NetSuite to Optiply

| Optiply field | NetSuite source |
| --- | --- |
| `remoteId` | `kit_item_members.id`. |
| `composedProductId` | `parentitem`, matched to the imported parent product. |
| `partProductId` | `item`, matched to the imported component. |
| `partQuantity` | `quantity`, with a minimum of one. |

Both products must resolve before the composition can be imported.

## Fields in NetSuite supplier imports

| Optiply field | NetSuite source |
| --- | --- |
| `remoteId` | Vendor `id`. |
| `name` | `companyname`. |
| `fixedCosts` | `custentity_cl_shipping_amount`. |
| `deliveryTime` | `custentity_cl_lead_time`, rounded to whole days and capped at 365. Zero is omitted. |
| `userReplenishmentPeriod` | `custentity_reorder_period`, rounded to whole days. Zero is omitted. |

### Supplier products — NetSuite to Optiply

| Optiply field | NetSuite source or rule |
| --- | --- |
| `remoteId` | `item` + `_` + `vendor`. |
| `productId` / `supplierId` | Item and vendor matched to imported Optiply records. |
| `name` | Item `fullname`. |
| `articleCode` | `vendorcode`. |
| `price` | `purchaseprice`, rounded to two decimals. |
| `lotSize` | `reordermultiple`, rounded to whole units with a minimum of one. |
| `deliveryTime` | `leadtime`, rounded to whole days and capped at 365. Values of one or less are omitted. |
| `preferred` | `preferredvendor`. |

Supplier-product import is controlled by `sync_supplier_products`. The default is enabled. The item-vendor pair identifies the relationship, not the vendor's article code. The standard input does not supply supplier-product SKU or free stock values.

## Fields in NetSuite sales imports

### Sell orders — NetSuite to Optiply

| Optiply field | NetSuite source |
| --- | --- |
| `remoteId` | Sales order `id`. |
| `totalValue` | `foreigntotal`. |
| `placed` | `createddate`. |
| `completed` | `closedate` on the newly imported order. |

Sales transactions use type `SalesOrd`. Orders whose `tranid` starts with `b2b`, ignoring letter case, are excluded. New orders need usable matched product lines. Existing sales orders and their lines are not updated by this import.

### Sell order lines — NetSuite to Optiply

| Optiply field | NetSuite source or rule |
| --- | --- |
| `productId` | `item`, matched to the imported product. |
| `quantity` | Absolute value of `quantity`, rounded to whole units. |
| `subtotalValue` | Absolute value of `netamount`, rounded to two decimals. |

`uniquekey` identifies the incoming sales line during preparation. Lines enter a new order together with its header. The outgoing nested line contains product, quantity and subtotal, not that source line identifier.

## Fields in NetSuite purchase imports

### Buy orders — NetSuite to Optiply

| Optiply field | NetSuite source or rule |
| --- | --- |
| `remoteId` | Purchase order `id`. |
| `supplierId` | `entity`, matched to the imported supplier. |
| `totalValue` | Absolute value of `foreigntotal`. |
| `placed` | `createddate`. |
| `expectedDeliveryDate` | `duedate`. |
| `completed` | `lastmodifieddate` for **Purchase Order : Pending Bill**, **Purchase Order : Fully Billed** or **Purchase Order : Closed**. |

Purchase transactions use type `PurchOrd`. The completion rule ignores letter case and surrounding spaces. Other statuses leave completion empty.

`otherrefnum` helps match orders created in Optiply. It is not a separate `reference` field sent when creating an imported buy order.

### Buy order lines — NetSuite to Optiply

| Optiply field | NetSuite source or rule |
| --- | --- |
| `remoteId` | `transaction` + `_` + `item`. |
| `buyOrderId` | `transaction`, matched to the imported purchase order. |
| `productId` | `item`, matched to the imported product. |
| `quantity` | Absolute value of `quantity`, rounded to whole units. |
| `subtotalValue` | Absolute value of `netamount`, rounded to two decimals. |
| `expectedDeliveryDate` | `duedate`. |

The purchase-order and item pair identifies the line. Repeated rows for that same pair do not become separate Optiply lines through their NetSuite `uniquekey` values.

### Receipt lines — NetSuite to Optiply

| Optiply field | NetSuite source or rule |
| --- | --- |
| `remoteId` | Item receipt line `uniquekey`. |
| `buyOrderLineId` | `createdfrom` + `_` + `item`, matched to the imported purchase line. |
| `quantity` | Absolute value of `quantity`, rounded to whole units. New receipts need a positive quantity. |
| `occurred` | Import processing time in the standard mapping. |

`linecreateddate` is prepared as a date called `placed`, not the receipt's `occurred` value. Do not use `occurred` from this mapping as the physical receipt time.

## Fields in NetSuite purchase exports

The purchase export prepares these fields for the NetSuite purchase-order connection. Confirm the selected connection with your setup owner before comparing its destination fields.

| Optiply value | Prepared export field | NetSuite correspondence |
| --- | --- | --- |
| Buy order ID | `purchaseOrderNumber`, `externalId`, `description` | Transaction number, external ID and memo. |
| Supplier source ID | `vendorId` | Matched vendor `entity.id`. |
| `placed` | `issueDate` | `tranDate`. |
| Expected delivery date | `dueDate` | `dueDate`. |
| Product source ID | `lineItems.itemId` | Matched item reference. |
| Line quantity | `lineItems.quantity` | `quantity`. |
| Line subtotal divided by quantity | `lineItems.unitPrice` | `rate`, rounded to two decimals during preparation. |
| Configured location | `lineItems.locationId` | Matched location when configured. |

The export groups lines by the original buy order ID. Optional price-export or tax configuration can change which prepared price fields are included. Ask the setup owner which configuration applies. Do not use this table as a resend instruction.

## What you see when NetSuite field comparison worked

You can match the selected record and explain its stock, identity, amount and date using the correct entity and direction. Check actual transferred records separately from the **Connected** label.

## Limits of comparing NetSuite fields

Enabled flows, custom fields, selected locations and run timing belong to your connection configuration. A schedule is not fixed by a mapping table.

Purchase-order updates apply to orders that are still open in the imported snapshot. Receipt lines are added, not updated. Missing records in a later input do not by themselves mean that Optiply deletes the corresponding records.

Whole-unit quantities and two-decimal amounts can differ from unrounded NetSuite values. Purchase-line identity differs from receipt identity. Sales updates and receipt timestamps follow the limits described above.

## If NetSuite field comparison did not work

First compare the entity, direction, source identifier and configured location or price level. Check that linked parent records exist for compositions, supplier products and order lines.

For a remaining mismatch, use the setup guide to reach the connection owner with the field name and non-sensitive record reference. For a missing exported order, use the original-order check below. Do not retry an export merely because a field differs.

## Related articles on NetSuite setup and orders

- [NetSuite setup and connection](/article/netsuite-set-up-and-connection)
- [Check a missing NetSuite buy order](/article/troubleshooting-failed-buy-order-to-netsuite)
- [When a buy order appears in your system](/article/when-a-buy-order-appears-in-your-system)
