NetSuite Integration with Custom HTTP Module(NO ENTERPRISE)

Integrating NetSuite with Make.com can be challenging, especially with the requirement of an enterprise plan. However, by leveraging a custom HTTP module and a Google Cloud Function, you can achieve this integration effectively without upgrading to the enterprise plan. Here’s a step-by-step guide to help you.

Step 1: Obtain NetSuite Credentials and Adjust Permissions

To integrate NetSuite with Make.com, you’ll need the following credentials:

  • Consumer Key
  • Consumer Secret
  • Token
  • Token Secret
  • Realm

How to complete the step

  • Follow the tutorial in this video until minute 4:00 to generate the Consumer Key, Consumer Secret, Token, and Token Secret:
    Watch Tutorial on NetSuite Credential Setup
  • Permissions Configuration
    During watching, replicate the steps in the video to configure the appropriate permissions for the integration. Without these permissions, API requests might fail.
  • Find Your Realm
    The Realm is a unique identifier for your NetSuite account. Here’s how to find it:
  • Log in to your NetSuite account.
  • Look at the URL in your browser’s address bar.
  • The Realm is the number before .app.
    For example, if the URL is:
    https://9744324.app.netsuite.com/app,
    the Realm is 9744324.

Step 2: Set Up Google Cloud Function

We’ll use Google Cloud Functions to generate an OAuth header that will be used for authenticating requests to NetSuite.

Google Cloud Function Code

  1. Go to Google Cloud Console
  2. Create Cloud Function
  3. When creating a function on Google Cloud Console don’t forget to set
    “Allow unauthenticated invocations”(Screen with example attached below)
  4. Copy the code below
  5. Set entry point parameter as “generateAuthHeader”. If you don’t - you’ll get error during deployment. (Screen with example attached below)
  6. Replace YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, YOUR_TOKEN, YOUR_TOKEN_SECRET, and YOUR_REALM with the values obtained in Step 1.
  7. Press “Deploy”
  8. After deployment copy function url
const crypto = require('crypto');
const functions = require('@google-cloud/functions-framework');

functions.http('generateAuthHeader', (req, res) => {
    const { method, url } = req.body;

    const consumerKey = 'YOUR_CONSUMER_KEY';
    const consumerSecret = 'YOUR_CONSUMER_SECRET';
    const token = 'YOUR_TOKEN';
    const tokenSecret = 'YOUR_TOKEN_SECRET';
    const realm = 'YOUR_REALM';

    console.log('Received request:', req.body);

    // OAuth 1.0a parameters
    const oauthParams = {
        oauth_consumer_key: consumerKey,
        oauth_token: token,
        oauth_signature_method: 'HMAC-SHA256',
        oauth_timestamp: Math.floor(Date.now() / 1000).toString(),
        oauth_nonce: crypto.randomBytes(16).toString('hex'),
        oauth_version: '1.0'
    };

    // Split the URL into base and query string
    const [baseUrl, queryString] = url.split('?');

    // Parse the query string into key-value pairs
    const queryParams = queryString
        ? Object.fromEntries(
              queryString.split('&').map(param => param.split('=').map(decodeURIComponent))
          )
        : {};

    // Merge OAuth parameters and query parameters
    const allParams = { ...oauthParams, ...queryParams };

    // Create the base string with parameters sorted and encoded
    const baseString = `${method.toUpperCase()}&${encodeURIComponent(baseUrl)}&${encodeURIComponent(
        Object.keys(allParams)
            .sort()
            .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(allParams[key])}`)
            .join('&')
    )}`;

    // Create the signing key
    const signingKey = `${encodeURIComponent(consumerSecret)}&${encodeURIComponent(tokenSecret)}`;

    // Generate the HMAC-SHA256 signature
    oauthParams.oauth_signature = crypto
        .createHmac('sha256', signingKey)
        .update(baseString)
        .digest('base64');

    // Prepare the Authorization header with the realm field
    const authHeader = 'OAuth realm="' + realm + '", ' +
        Object.keys(oauthParams)
            .map(key => `${encodeURIComponent(key)}="${encodeURIComponent(oauthParams[key])}"`)
            .join(', ');

    console.log('Authorization Header:', authHeader);

    // Return the Authorization header in the response
    res.status(200).json({ authHeader });
});


Step 3: Using the Function in Make.com

Overview of the Workflow

  1. First Request:
    Use the Google Cloud Function to generate an OAuth header.
    Send a POST request to your deployed function with the following parameters:
  • method: The HTTP method (e.g., GET or POST).
  • url: The full NetSuite API endpoint.


  1. Second Request:
    Use the authHeader from the first request to authenticate your NetSuite API call in Make.com.
  • Set up a custom HTTP module in Make.com.
  • Pass the authHeader in the Authorization header of your request.

That’s it!
You’re ready to go and use Netsuite API without enterprise!

Email for contact: philipp@lowcoding.dev
Youtube channel where I review automations: https://www.youtube.com/@5_min_ai

Thank you!

It’s amazing!
Saved me costs!
Thanks!