I am trying to do an API integration of our third party application with NetSuite. I want to be able to import sales invoice details generated from our third party system (which uses REST API) into the NetSuite invoice form. The frequency of import is not too crucial- an immediate import will be ideal, but sending data once a day is fine as well.
Furthermore, the invoice on NetSuite needs to be filled with details of which some are already available on NetSuite (ex: tax code, billing address, etc.) and some which need to be imported from the third party application (ex: item name, price, etc.)
How would I go about doing so? Would I need to use our API to get the item and price details, use an API to get the details from NetSuite, merge them together somehow and push that into NetSuite? Is there a less complex way of doing so?
I have heard of user events that trigger when a change occurs on NetSuite, and scheduled scripts that trigger every x period of time, but I have only seen these being used from the POV of sending data FROM Netsuite into a third party system. How would I trigger data to be sent to NetSuite when an invoice is created on our external application?
To summarize, I would like to know how to go about integrating when data is needed from 2 sources (NetSuite itself, and the external application) and how to trigger the data to be imported into NetSuite.
I am a complete beginner to APIs and NetSuite. Tips on what I should look into researching, and any/all help is much appreciated!
In my opinion, the easiest way to implement what you need here, is to use a NetSuite scheduled script to GET the data from the third party API, and then create the invoices required from that data. Instead of thinking about it as the third party application sending data to NetSuite, think about it as NetSuite fetching the data from the third party application.
The scheduled script would need to connect to the third party, authenticate and run a query to get any new invoices using whatever filters make sense (for example, 'date created'). It would then need to iterate over the records returned to create corresponding records in NetSuite.
Scheduled scripts can be set up to run on schedule at any time interval down to 15 minutes, or can be called from another script using the N/task module. They can also be triggered manually for testing.