Before you begin
- Start with the NetSuite connection setup. You can deploy the RESTlet before or after you finish connecting; the setup has an Optional settings screen where the IDs can be entered.
- Make sure your Integration Record has the RESTlets scope checked (step 5 of the connection setup). If you connected with an interactive OAuth 2.0 login and add the scope later, re-authorize the connection in Stuut afterwards.
1. Enable SuiteScript
- Go to Setup → Company → Enable Features and open the SuiteCloud tab.
- Check Client SuiteScript and Server SuiteScript.
- Click Save.
2. Upload the script
Save the following asinvoice_pdf_restlet.js:
invoice_pdf_restlet.js
- Go to Customization → Scripting → Scripts → New.
- Upload
invoice_pdf_restlet.jsas the script file and click Create Script Record. - Set Name to
Invoice PDF Generatorand ID to_invoice_pdf_restlet. NetSuite adds thecustomscriptprefix, so the full script ID iscustomscript_invoice_pdf_restlet. - Save.
3. Deploy the script
On the script record, click Deploy Script and set:- Title:
Invoice PDF Deployment - ID:
_invoice_pdf. The full deployment ID becomescustomdeploy_invoice_pdf. - Status: Released
- Audience → Roles: include the
Stuut Integrationrole
The PDF uses the invoice’s standard print template, so it matches what you’d get from Print in NetSuite.
4. Enter the RESTlet IDs in Stuut
Enter both IDs on the NetSuite connection in Stuut:- PDF RESTlet script ID:
customscript_invoice_pdf_restlet - PDF RESTlet deployment ID:
customdeploy_invoice_pdf
customscript and customdeploy prefixes.
Troubleshooting
No PDFs appear after the next sync
No PDFs appear after the next sync
Check that the deployment’s Status is Released, the
Stuut Integration role is in its Audience, and the Integration Record has the RESTlets scope. Then confirm both IDs in Stuut match the script and deployment records exactly.Some PDFs arrive late during the first import
Some PDFs arrive late during the first import
NetSuite limits how many RESTlet calls one user can make at the same time. When the RESTlet reports it’s busy, Stuut waits and tries again on a later run, so a large first import can take a while to fill in every PDF.
Seeing script errors in NetSuite
Seeing script errors in NetSuite
The script logs failures under Customization → Scripting → Script Deployments → Invoice PDF Deployment → Execution Log. Share the error with your Stuut team.