Skip to main content

Data Source

Follow the instructions below to create a new data flow that ingests data from a NetSuite REST API source in Nexla.
netsuite_rest_api.png

NetSuite Rest API

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the NetSuite REST API connector tile from the list of available connectors. Then, select the credential that will be used to connect to your NetSuite account, and click Next; or, create a new NetSuite REST API credential for use in this flow.

  3. In Nexla, NetSuite REST API data sources can be created using pre-built endpoint templates, which expedite source setup for common NetSuite REST API endpoints. Each template is designed specifically for the corresponding NetSuite REST API endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    NetSuite REST API sources can also be configured manually, allowing you to ingest data from NetSuite REST API endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common NetSuite REST API endpoints. Each template is designed specifically for the corresponding NetSuite REST API endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    Get all records of an Object

    This endpoint template retrieves all records of a specified record type from your NetSuite account. Use this template when you need to fetch all records from a NetSuite object, such as all customers, all sales orders, or all inventory items. The endpoint supports pagination to handle large datasets efficiently.

    • Enter the object name in the Object Name field. This should be the NetSuite record type name (e.g., customer, salesorder, item). The object name determines which NetSuite record type will be retrieved. Refer to the NetSuite REST API documentation for available record types.

    This endpoint retrieves all records for the specified NetSuite object. The endpoint uses offset-based pagination to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by incrementing the offset value. The endpoint returns up to 1000 records per page by default.

    The object name must be a valid NetSuite record type. For detailed information about available record types, API response structures, pagination, and record schemas, see the NetSuite REST API documentation.

    Execute SuiteQL Query

    This endpoint template executes a custom SuiteQL query to fetch resources from your NetSuite account. Use this template when you need to execute complex queries with filters, joins, or other SQL-like operations that are not covered by the simpler endpoint templates.

    • Enter your SuiteQL query in the Query String field. This should be a valid SuiteQL query string (e.g., SELECT * FROM customer WHERE status = 'Active'). The query string is used to fetch data from your NetSuite account using SuiteQL syntax. Refer to the NetSuite REST API documentation for SuiteQL query syntax and examples.

    This endpoint executes a custom SuiteQL query to retrieve data from your NetSuite account. SuiteQL is NetSuite's SQL-like query language that allows you to query NetSuite data using SQL syntax. The endpoint uses offset-based pagination to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by incrementing the offset value.

    The query string must be valid SuiteQL syntax. For detailed information about SuiteQL query syntax, available tables, query examples, and pagination, see the NetSuite REST API documentation.

    Get Metadata of an Object

    This endpoint template retrieves metadata for a specified record type from your NetSuite account. Use this template when you need to discover available fields, field types, and record structure for a NetSuite object before querying its data.

    • Enter the object name in the Object Name field. This should be the NetSuite record type name (e.g., customer, salesorder, item). The object name determines which NetSuite record type's metadata will be retrieved. Refer to the NetSuite REST API documentation for available record types.

    This endpoint returns metadata for the specified NetSuite object, including field definitions, field types, and record structure. Use this endpoint to discover which fields are available for an object before querying its data. The metadata is returned in JSON Schema format.

    The object name must be a valid NetSuite record type. For detailed information about metadata, available record types, and JSON Schema formats, see the NetSuite REST API documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

NetSuite REST API data sources can be manually configured to ingest data from any valid NetSuite REST API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex NetSuite REST API sources, such as sources that use chained API calls to fetch related record data or sources that require custom query parameters or filters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the NetSuite REST API from the Method pulldown menu. NetSuite REST API typically uses GET method for retrieving data and POST method for executing queries.

API Endpoint URL

  1. Enter the URL of the NetSuite REST API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including your account ID (from your credential), the API path (e.g., /services/rest/record/v1/customer), and any required query parameters (e.g., https://{account_id}.suitetalk.api.netsuite.com/services/rest/record/v1/customer). Include any required query parameters in the URL.

Ensure the API endpoint URL is correct and accessible with your current credentials. The NetSuite REST API uses offset-based pagination for some endpoints. The endpoint URL should point to a valid NetSuite REST API endpoint. You can test the endpoint using the Test button after configuring the URL.

Request Body (if applicable)

  1. If your endpoint requires a request body (e.g., for SuiteQL queries), configure the request body that will be sent to the NetSuite REST API. The request body should contain your request parameters formatted as JSON. For SuiteQL queries, the request body format is typically {"q": "{your_suiteql_query}"}.

The request body must be valid JSON and must match the NetSuite REST API's expected format for the specific endpoint you're using. For SuiteQL queries, the request body should include a q property containing your SuiteQL query string. For detailed information about request body formats, see the NetSuite REST API documentation.

Response Data Path

  1. Enter the JSONPath expression in the Response Data Path field to specify which part of the API response should be treated as the relevant data by Nexla. For NetSuite REST API responses, use $.items[*] to extract all items from the items array in the response.

The JSONPath expression must correctly reference the structure of your NetSuite REST API response. NetSuite REST API responses typically have an items property containing an array of record objects. Ensure your JSONPath expression matches the structure returned by your specific endpoint. The JSONPath expression determines which data will be extracted and processed by Nexla.

Pagination (if applicable)

  1. If your endpoint supports pagination, configure the pagination settings in the Pagination section. NetSuite REST API uses offset-based pagination for most endpoints. Select the pagination type that matches your endpoint's pagination mechanism.

  2. Configure the pagination parameters based on your selected pagination type. For offset-based pagination, specify the offset parameter name (offset), the starting offset value (0), and the page size parameter name (limit).

Save the Data Source

  1. Once all of the relevant steps in the above sections have been completed, click the Next button to proceed with the rest of the data flow configuration, or click Save to save the data source configuration for later use.