SuiteScript
NetSuite Unknown
2026-08-25

New N/documentCapture Module: AI-Driven Document Extraction via SuiteScript

NetSuite adds the N/documentCapture SuiteScript 2.1 module, enabling server-side AI-powered extraction of text, tables, and key-value pairs from PDFs, images, and scanned documents using Oracle Cloud Infrastructure Document Understanding.

Affects:SuiteScript 2.1N/documentCaptureN/llmServer SuiteScript

What changed

A new server-side SuiteScript 2.1 module, N/documentCapture, is now available by default when the Server SuiteScript feature is enabled. It wraps Oracle Cloud Infrastructure (OCI) Document Understanding — an AI/ML service — and exposes it directly within SuiteScript for programmatic document processing.

Supported input formats

  • PDF, PNG, JPG, TIFF

Core methods

  • documentCapture.documentToStructure(options) — synchronous structured extraction (up to 5 pages). Returns a documentCapture.Document object containing pages, lines, words, fields, and tables with confidence scores.
  • documentCapture.documentToStructure.promise(options) — asynchronous variant for documents longer than 5 pages.
  • documentCapture.documentToText(options) — synchronous plain-text extraction from PDF files. Returns a string.
  • documentCapture.documentToText.promise(options) — asynchronous variant.
  • documentCapture.getRemainingConcurrency() / .promise() — returns the number of available concurrent requests remaining. Use this to throttle workloads in scheduled or map/reduce scripts.
  • documentCapture.parseResult(options) — converts a previously-saved JSON result back into a documentCapture.Document object for re-processing without re-calling OCI.

Object model

The Document object exposes mimeType, a pages array, and a getText() convenience method. Each Page contains:

  • Page.lines — array of Line objects (text + confidence)
  • Page.words — array of Word objects (text + confidence)
  • Page.fields — array of Field objects, each with a FieldLabel (name + confidence) and FieldValue (text + confidence). The Field.type property maps to the documentCapture.FieldType enum.
  • Page.tables — array of Table objects with headerRows, bodyRows, footerRows (each containing Cell objects), plus rowCount, columnCount, and confidence.
  • Page.detectedDocumentTypes — array of objects with confidence levels for automatic document classification (invoice, receipt, contract, etc.).

Enums

  • documentCapture.DocumentType — document type values
  • documentCapture.Feature — which extraction feature to invoke
  • documentCapture.FieldType — field type classification
  • documentCapture.Language — language of the source document

Deprecation notice

documentCapture.getRemainingFreeUsage() and its .promise() variant are deprecated. They now delegate to llm.getRemainingUsage() from the N/llm module. This indicates that N/documentCapture shares the same usage quota pool as N/llm — plan capacity accordingly if you are also using generative AI features.

What the source does not specify

  • Governance cost — no governance-unit consumption is documented for these calls. Verify in your account by checking the SuiteScript governance topic or testing with nlapiGetContext().getRemainingUsage().
  • Concurrency limits — the getRemainingConcurrency() method exists but no concrete default limit is stated. Test in sandbox.
  • Usage quotas — the exact monthly or per-account free-tier allocation is not disclosed here. The deprecation of getRemainingFreeUsage in favor of llm.getRemainingUsage suggests a unified AI-services budget; check your account's AI usage dashboard.
  • File Cabinet integration — the docs do not clarify whether options accepts a File Cabinet internal ID, a file.File object, or raw base64/URL. Review the linked "Getting Started" page or script samples for exact parameter shapes.

What to do

  1. Confirm feature enablement. Verify that Server SuiteScript is enabled at Setup > Company > Enable Features > SuiteCloud. No separate feature flag is required for this module.
  2. Load the module. Use define(['N/documentCapture'], function(documentCapture) { ... }) in SuiteScript 2.1. This module is server-side only — it will not load in client scripts.
  3. Audit AI usage budgets. If you already use N/llm, note that document capture shares the same usage pool. Call documentCapture.getRemainingConcurrency() before processing batches.
  4. Replace deprecated calls. If you adopted getRemainingFreeUsage() in any early-access code, migrate to require(['N/llm'], function(llm) { llm.getRemainingUsage(); }).
  5. Choose sync vs. async. For documents ≤ 5 pages, synchronous calls work. For longer documents, use the .promise() variants — these are well-suited for Map/Reduce or Scheduled script contexts.
  6. Use parseResult for reprocessing. If you persist the raw JSON output (e.g., to a custom record or file), you can reconstitute it into a Document object later without re-calling OCI, saving both time and quota.
  7. Test in sandbox first. OCI Document Understanding is a cloud service call — latency, concurrency limits, and quota consumption should be profiled before production deployment.