Veryfi icon

Veryfi

Extract data from invoices, receipts, checks, bank statements, W-9/W-2, IDs, and any document via Veryfi

Document → Extract Data From W-2

AI-generated

Summary

Sends an IRS Form W-2 image to Veryfi to extract wage and tax information, returning structured data about the employee, employer, and tax details.

Inputs

  • fileSource (required) — Choose how to provide the W-2 document: 'binary' to upload from a previous node or 'url' to provide a public URL.
  • binaryPropertyName (required) — The name of the binary field containing the file (e.g., 'data'). Used only when fileSource is 'binary'.
  • fileUrl (required) — The public URL of the W-2 document. Veryfi fetches it server-side. Used only when fileSource is 'url'.
  • fileName — Optional file name to send to Veryfi. If omitted, the file name is taken from the binary input or omitted for URL input.
  • confidenceDetails — Whether to include per-field confidence scores (value, score, ocr_score) in the response.
  • flattenConfidence — Whether to flatten confidence objects into sibling keys (e.g., field, field__score, field__ocr_score) for easier mapping. Defaults to true when confidenceDetails is enabled.
  • auto_categorize — Whether to let Veryfi auto-categorize the document. Defaults to true.
  • boost_mode — Whether to enable boost mode, which returns extracted data without storing the document image.
  • categories — Optional list of categories to constrain the auto-categorizer.
  • external_id — Optional external identifier to associate with the document.
  • tags — Optional tags to attach to the document.

Output shape

A single item containing the extracted W-2 data (e.g., employee name, SSN, wages, tax information).

When confidenceDetails is true, the response shape depends on flattenConfidence. If flattenConfidence is true, fields with confidence scores become sibling keys (e.g., 'wages', 'wages__score', 'wages__ocr_score'). If flattenConfidence is false, fields are objects like { value: ..., score: ..., ocr_score: ... }.

Examples

Example 1: Extract W-2 data from a binary file uploaded via an HTTP Request node.

File Source: Binary; Input Binary Field: data; Additional Options: auto_categorize = true

Example 2: Extract W-2 data from a public URL.

File Source: URL; File URL: https://example.com/w2.pdf

Example 3: Extract W-2 data with detailed confidence scores flattened for easy mapping.

File Source: Binary; Confidence Details: true; Flatten Confidence Scores: true

Links

Discussion