ANS-0797 · WEB SERVICES & INTEGRATIONS

How to Expose NetSuite Data for External Applications via REST

NetSuite Suitelets and RESTlets provide robust methods for securely exposing JSON data to external systems, requiring careful CORS configuration.

Short answer

To expose NetSuite data for external consumption, implement a Suitelet to return a JSON structure directly in the HTTP response body, or utilize a RESTlet for more complex logic. Both methods require explicit Cross-Origin Resource Sharing (CORS) configuration to manage cross-origin requests effectively.

Scenario

Organizations often need to integrate NetSuite data with external web applications or services. This requires a secure and efficient method to expose specific NetSuite information, such as transaction details or custom record data, in a format consumable by these external systems, typically JSON.

Solution

Leveraging RESTful principles can simplify data exposure from NetSuite. Two primary methods are available:

  1. Utilize a Suitelet: Configure a Suitelet to return a JSON structure directly in the HTTP response body. This allows the data to be queried by HTTP.

  2. Implement a RESTlet: Alternatively, move the required logic to a RESTlet and invoke it via its dedicated endpoint.For both Suitelets and RESTlets, when making cross-origin requests, explicit Cross-Origin Resource Sharing (CORS) configuration, including handling preflight requests and setting appropriate headers, is necessary.

Expert NetSuite Support

Need help with this NetSuite issue?

Web Services & Integrations consulting and configuration support

Talk to a consultant