Building a Custom Connector to Netsuite: Netsuite wants 24+ length "state" param yet Zapier's is 23

  • 26 March 2023
  • 3 replies

Userlevel 1

I’m trying to build a custom OAuth2 Integration with Netsuite using the developer console.

Netsuite’s documentation requires a “state” parameter in the OAuth urls that is between 24 and 1024 characters long.

Zapier’s state parameter is… 23 characters long 🤦

Is there anyone who has successfully integrated with Netsuite who may have encountered this? I was hoping there’d be a way to override Zapier’s state param but I’m not seeing a way. Otherwise, is there perhaps another known way to do the integration (please don’t tell me I have to build a custom OAuth1 app).

3 replies

Userlevel 1

Oh here is the Netsuite documentation. I’ve checked my audit logs in NS to confirm that I’m getting an “InvalidState” error which is what sent me down this rabbit hole. 

Per the Netsuite documentation on OAuth2, the state must be 24-1024 characters

For reference, here’s where I am in the developer platform. To try and hack a workaround around this error I created a “randomNumber” formula to generate my own “state” param for the Step 1 Auth URL (see image at bottom). However, Zapier tells me that I’m not allowed to do that when I attempt to run the auth flow at the bottom of the zapier platform page.


Userlevel 1

Forget it. I went and built a private custom OAuth1 integration for Netsuite.  If there’s any interest from the community in obtaining such an integration, feel free to let me know in this thread. I’d consider petitioning my org to open-source the code if I were getting some outside interest.

Userlevel 1
Badge +1

Hi @AJM, great that you made it work.


We are building a Netsuite connector too. 


It will include most of the triggers and actions the endpoints available on the API.