Contact Free trial Login

NetSuite OpenAir Connector - Mule 4

Support Category: Select

NetSuite OpenAir Connector v2.0

Anypoint Connector for NetSuite OpenAir (NetSuite OpenAir Connector) is a closed-source enterprise connector that provides a connection between OpenAir and third-party software.


To use this information, you must be familiar with NetSuite OpenAir, Mule runtime engine (Mule), Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.

To use this connector, you need:

  • A NetSuite OpenAir instance

  • A set of valid credentials, including username, password, companyID, API namespace, and key.

  • A MuleSoft Enterprise License

OpenAir complex types are limited to a set of OpenAir operations. See the OpenAir documentation for information about its object types. For example, object oaActualCost works with read, add, modify, and upsert methods, while object oaApproval works only with the submit method.

POM File Information


Mule converts RELEASE to the latest version. To specify a version, view NetSuite OpenAir Connector in Anypoint Exchange and click Dependency Snippets.


The OpenAir connector is compatible with:

Application/Service Version


EE 4.1.0 and later

Anypoint Studio

7.1 and later



Connect in Flow Designer

Flow Designer provides input sources (known as triggers) for:

  • On New Object - Start your application when a NetSuite user creates an object.

  • On Modified Object - Start your application when a NetSuite user modifies an object.

  • On Deleted Object - Start your application when a NetSuite user deletes an object.

  • HTTP Listener - Start your application from a browser, curl, or Postman.

  • Scheduler - Start your application at selected time intervals.

To configure your Flow Designer app:

  1. Configure a trigger.

  2. Select the plus sign next to the trigger to add a component.

  3. Select the connector as a component.

  4. Select the operation:

  5. Configure the Global Element for the connector:

    account config
    Field Description


    Enter the company.


    Enter the user name to connect to.


    Enter the password for the user.

    API Namespace

    Enter the API namespace.

    Api Key

    Enter the API key.

  6. Optionally configure the connection options for the connector:

    connector config
    Field Description


    Enter the endpoint.

    Connection Timeout

    Enter the connection timeout.

    Read Timeout

    Enter the read timeout.

Add the Connector to Your Project

Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange button in the Studio taskbar or from the Mule Palette view.

Add the Connector Using Exchange

  1. In Studio, create a Mule project.

  2. Click the Exchange icon (X) in the upper-left of the Studio task bar.

  3. In Exchange, click Login and supply your Anypoint Platform username and password.

  4. In Exchange, search for "openair".

  5. Select the connector and click Add to project.

  6. Follow the prompts to install the connector.

Add the Connector in Studio

  1. In Studio, create a Mule project.

  2. In the Mule Palette view, click (X) Search in Exchange.

  3. In Add Modules to Project, type "openair" in the search field.

  4. Click this connector’s name in Available modules.

  5. Click Add.

  6. Click Finish.

Configure in Studio

  1. Drag the connector operation to the Studio Canvas (they are the same as are in Design Center).

  2. Configure the Global Element for the connector:

    anypoint config
  3. If needed, configure a connection:

    anypoint connection
    1. Enable the automatic reconnection feature.

    2. Access the OpenAir Global Element configuration window from Studio.

    3. Click the Advanced tab (next to Connection).

    4. Select the Standard option in Reconnection Strategy.

    5. Adjust the Frequency (ms) and Reconnection Attempts fields accordingly.

Log HTTP Requests and Responses

To log the HTTP interactions of the connector with NetSuite OpenAir, configure the log4j2.xml file for the Mule app as follows, and use a Logger component in your project to display the results:

<AsyncLogger name="org.mule.service.http" level="DEBUG"/>

Use Case: Add OpenAir Object

OpenAir use case flow
  1. In Studio, drag an HTTP Listener operation onto the canvas and configure it to listen to host at port 8081.

  2. Drag the OpenAir Add operation connector into the flow and configure the connector as described in Configure in Studio.

  3. Drag a Transform Message component between the HTTP connector and the OpenAir connector.

  4. In the Transform Message component, insert the DataWeave script into the DataWeave editor to add oaCustomer objects to your NetSuite OpenAir instance:

    %dw 2.0
    output application/xml
    ns ns0
      ArrayOfoaBase: {
        oaBase: {
          ns0#oaCustomer: {
            name: "James Bond",
                  company: "MuleSoft"
          ns0#oaCustomer: {
            name: "Jane Doe",
            company: "Salesforce"
  5. Drag another Transform Message component after the OpenAir connector, and insert the DataWeave script into the Transform Message component’s DataWeave editor.

    The script should return the IDs of the newly added OpenAir objects.

    %dw 2.0
    output application/json
    ns ns0
    	customerName_1: payload.ns0#ArrayOfUpdateResult.*updateResult[0].id,
    	customerName_2: payload.ns0#ArrayOfUpdateResult.*updateResult[1].id
  6. Save the project.

  7. In Package Explorer, right-click the project and click Run As > Mule Application.

  8. Use a browser to access, and the following JSON displays:

        "customerName_1": "411",
        "customerName_2": "412"

Use Case: XML

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns=""
   <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config">
      <http:listener-connection host="" port="8081" />
   <openair:config name="Open_Air_Config" doc:name="Open Air Config">
      readTimeout="${config.readTimeout}" />
   <flow name="testopenairFlow">
      <http:listener doc:name="Listener" config-ref="HTTP_Listener_config" path="/" />
      <ee:transform doc:name="Transform Message">
            <ee:set-payload><![CDATA[%dw 2.0 output application/xml ns ns0  --- { ns0#ArrayOfoaBase: { oaBase: { oaCustomer: { name: "James Bond", company: "MuleSoft" }, oaCustomer: { name: "Jane Doe", company: "Salesforce" } } } }]]></ee:set-payload>
      <openair:add doc:name="Add" config-ref="Open_Air_Config" oaObject="jasdhjasdhik" />
      <ee:transform doc:name="Transform Message">
            <ee:set-payload><![CDATA[%dw 2.0 output application/json ns ns0 --- { ID1: payload.ns0#ArrayOfUpdateResult.*updateResult[0].id, ID2: payload.ns0#ArrayOfUpdateResult.*updateResult[1].id }]]></ee:set-payload>