Skip to main content
NetSuite’s REST API doesn’t return invoice PDFs, so Stuut uses a small RESTlet in your account to render them. Once it’s deployed, Stuut downloads each invoice’s PDF during sync and can attach it to collection emails. This setup is optional. Skip it if you don’t want invoice PDFs on Stuut emails.

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

  1. Go to Setup → Company → Enable Features and open the SuiteCloud tab.
  2. Check Client SuiteScript and Server SuiteScript.
  3. Click Save.

2. Upload the script

Save the following as invoice_pdf_restlet.js:
invoice_pdf_restlet.js
Then in NetSuite:
  1. Go to Customization → Scripting → Scripts → New.
  2. Upload invoice_pdf_restlet.js as the script file and click Create Script Record.
  3. Set Name to Invoice PDF Generator and ID to _invoice_pdf_restlet. NetSuite adds the customscript prefix, so the full script ID is customscript_invoice_pdf_restlet.
  4. 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 becomes customdeploy_invoice_pdf.
  • Status: Released
  • Audience → Roles: include the Stuut Integration role
Save the deployment.
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
If you’re still in the connection setup, enter them on the Optional settings screen and click Save and continue. Otherwise, go to Settings → Connectors, open your NetSuite connection, enter them on the Settings tab, and save. Stuut starts downloading invoice PDFs on the next sync. If you used different IDs in steps 2 and 3, enter yours instead. Both values are the full IDs, including the customscript and customdeploy prefixes.

Troubleshooting

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.
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.
The script logs failures under Customization → Scripting → Script Deployments → Invoice PDF Deployment → Execution Log. Share the error with your Stuut team.