Search code examples
web-servicesnetsuite

Triggering external API from netsuite


I am new to NetSuite and I need to integrate it with a third party system. Each time a new sales order is created, I need to pass its details to the third party. Is there any way in NetSuite to call some external API on transaction creation?

There are user-event suitescripts which can be run before record load/submit and after submit. Is there any NetSuite server-side API which can be used to send record data to some external web-service?


Solution

  • You can certainly use an afterSubmit event handler and nlapiRequestURL function to send data to the 3rd party system.

    AfterSubmit is definitely the even to code, not beforeSubmit. Data can change between the beforeSubmit and afterSubmit events.

    You also can change the timing of the script if more than 1 script is attached to the afterSubmit event - ie you probably want to ship the data off to the 3rd party as the last script fired in afterSubmit.