How to integrate NetSuite with Medusa

Type
Concept
Applies to
Medusa v2.x
Updated

Short answer

Medusa has no prebuilt NetSuite connector. You build a custom Medusa module that calls NetSuite's SuiteTalk REST web services or RESTlets, then sync orders, items, stock, and prices with Medusa workflows, subscribers, and scheduled jobs. Workflows roll back NetSuite writes when a step fails, and NetSuite user event scripts can push changes to Medusa.

Does Medusa have a NetSuite connector?

Medusa has no first-party NetSuite connector and no NetSuite-specific guide. You integrate NetSuite by writing a custom Medusa module that calls NetSuite's APIs, then running it from workflows, subscribers, and scheduled jobs. The general Medusa ERP integration recipe shows each of these patterns with example code. Everything NetSuite-specific in this entry is Custom work.

Which NetSuite APIs to use from Medusa

NetSuite exposes three integration channels under SuiteTalk and SuiteScript. Oracle's guidance is to build new integrations on REST web services with OAuth 2.0.

NetSuite APIWhat it isUse it from Medusa for
SuiteTalk REST web servicesREST interface for CRUD on records, metadata, and SuiteQL queries. No server-side script to deploy.Default choice: create sales orders, read items, customers, and stock
RESTletsSuiteScript endpoints you write and deploy in NetSuiteOne call that runs a full business flow, or logic REST does not expose
SuiteTalk SOAP web servicesLegacy SOAP APIAvoid for new work. Oracle stops new SOAP integrations in 2027.1 and disables all SOAP endpoints in 2028.2
SuiteScript user event scripts with N/httpsScripts that run when a record is saved and can POST to an external URLPush changes from NetSuite to a Medusa API route in near real time

To get NetSuite changes into Medusa as they happen, you deploy a user event script whose Copy to clipboardafterSubmit entry point sends the record to a Medusa API route with the Copy to clipboardN/https module. Otherwise, you poll NetSuite from a Medusa scheduled job. Concurrency limits are shared across SOAP, REST, and RESTlets, so batch calls where you can.

How NetSuite data maps to Medusa

Each row is a sync you build in your NetSuite module. The Medusa side of every row uses native commerce modules.

NetSuite dataMedusa equivalentDirectionStatus
Item records and matrix itemsProducts and product variants (Product Module)NetSuite to MedusaCustom
Item quantities by locationInventory levels per stock location (Inventory Module)NetSuite to MedusaCustom
Price levels and customer-specific pricesPrice lists with customer group rules (Pricing Module), or a live price lookup in add-to-cartNetSuite to MedusaCustom
Customer recordsCustomers and customer groups (Customer Module)BothCustom
Sales ordersOrders (Order Module)Medusa to NetSuiteCustom
Fulfillment and status updatesOrder updatesNetSuite to MedusaCustom

Store the NetSuite internal ID on the Medusa record, for example in Copy to clipboardmetadata or the product's Copy to clipboardexternal_id, so later syncs can match records.

Real-time vs scheduled sync with NetSuite

Medusa supports both timing models with built-in tools. Choose per data type.

  • Real-time, Medusa to NetSuite. A subscriber on Copy to clipboardorder.placed runs a workflow that creates the sales order in NetSuite.
  • Real-time, inside checkout. A workflow hook on Copy to clipboardaddToCartWorkflow checks stock or purchase rules in NetSuite before an item enters the cart.
  • Real-time, NetSuite to Medusa. A user event script posts to a custom Medusa API route that runs an update workflow.
  • Scheduled. A scheduled job pulls the item catalog or price levels on a cron schedule.

Code skeleton: push Medusa orders to NetSuite

A Medusa workflow step can define a compensation function that runs if a later step fails. Here the compensation deletes the NetSuite sales order, so the two systems do not drift apart. Copy to clipboardcreateSalesOrder and Copy to clipboarddeleteSalesOrder are methods you write in your own NetSuite module, for example against the REST Copy to clipboardsalesOrder record.

import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
import { OrderDTO } from "@medusajs/framework/types"
export const createNetSuiteOrderStep = createStep(
"create-netsuite-order",
async ({ order }: { order: OrderDTO }, { container }) => {
const netsuite = container.resolve("netsuite")
const id = await netsuite.createSalesOrder(order)
return new StepResponse(id, id)
},
async (id, { container }) => {
if (!id) return
await container.resolve("netsuite").deleteSalesOrder(id)
}
)

Run this step in a workflow triggered by an Copy to clipboardorder.placed subscriber, as in the ERP recipe's order sync section. Learn more about compensation functions.

How Shopify and other platforms connect to NetSuite

Oracle's NetSuite Connector is a prebuilt integration for a fixed list of storefronts. Medusa is not on that list, so Medusa projects use custom code or an iPaaS tool.

PlatformHow it connects to NetSuiteCustomizable flows
Shopify, BigCommerce, Magento 2, WooCommerceOracle NetSuite Connector (prebuilt)Limited to the connector's sync options
MedusaCustom Medusa module using REST web services or RESTletsAny flow you code, including checkout-time stock and price checks
Any platformiPaaS toolsDepends on the iPaaS recipe

When Medusa is not the right choice for NetSuite

  • You run a standard store on Shopify, BigCommerce, Magento 2, or WooCommerce, and NetSuite Connector covers your order, item, and fulfillment syncs. A prebuilt connector is less work than a custom module.
  • You have no developer to own the integration. A Medusa NetSuite integration is TypeScript code you maintain through NetSuite releases.

Medusa fits when NetSuite holds rules the storefront must enforce during checkout, such as customer-specific prices or purchase restrictions, or when you need flows a connector's sync options do not cover.

Common questions

Is there a Medusa plugin for NetSuite?

No. Medusa has no first-party NetSuite plugin or NetSuite-specific guide. You write a custom module, following the patterns in the Medusa ERP integration recipe.

Should a NetSuite integration use SOAP or REST?

Use SuiteTalk REST web services with OAuth 2.0. Oracle says new SOAP integrations cannot be built from the 2027.1 release, and all SOAP endpoints are disabled in 2028.2.

Does NetSuite support webhooks?

A SuiteScript user event script can send a record to an external URL in its afterSubmit entry point using the N/https module, which works as a webhook to a Medusa API route.

Can Medusa use NetSuite customer-specific prices at checkout?

Yes, with custom code. You either sync NetSuite price levels into Medusa price lists, or fetch the price from NetSuite in a custom add-to-cart workflow, as the Medusa ERP recipe shows.