Models
W4
Documentation for the W4 Tax Form document model
Overview
The W4 model extracts and structures information from W4 tax forms (Employee’s Withholding Certificate), including taxpayer information, filing status, and withholding adjustments.
Schema Structure
Form Metadata
Field | Type | Description |
---|---|---|
TaxYear | string? | Tax year for W-4 form submission |
Taxpayer Information
Field | Type | Description |
---|---|---|
TaxPayer.FirstNameAndInitials | string? | Taxpayer’s first name and initials |
TaxPayer.LastName | string? | Taxpayer’s last name |
TaxPayer.Address | string? | Taxpayer’s mailing address |
TaxPayer.SSN | string? | Taxpayer’s Social Security Number |
Employer Information
Field | Type | Description |
---|---|---|
Employer.NameAndAddress | string? | Employer’s full name and address |
Employer.EmploymentFirstDate | string? | First date of employment |
Employer.EIN | string? | Employer’s Identification Number |
Filing Status and Options
Field | Type | Description |
---|---|---|
FilingStatus | string? | Taxpayer’s filing status |
Box2cCheckBox | boolean? | Multiple jobs or spouse works indicator |
Dependents and Withholding
Field | Type | Description |
---|---|---|
Box3 | number? | Total amount claimed for dependents |
Box3ChildrenUnder17 | number? | Amount claimed for children under 17 |
Box3OtherDependents | number? | Amount claimed for other dependents |
Additional Income and Deductions
Field | Type | Description |
---|---|---|
Box4a | number? | Other income for withholding consideration |
Box4b | number? | Deductions other than standard deduction |
Box4c | number? | Extra amount for tax withholding per paycheck |
Type Definitions
Validation Rules
Basic Validation
- All fields are optional by default
Strict Validation
The following fields are required in strict mode:
- TaxYear
- TaxPayer.FirstNameAndInitials
- TaxPayer.LastName
- TaxPayer.SSN
- FilingStatus
Example Usage
Date Handling
The model accepts dates in multiple formats:
- ISO 8601 datetime strings
- YYYY-MM-DD format
All dates are converted to ISO format during validation.
Best Practices
- Always validate W4 forms:
- Access data through the result property:
- Handle optional fields appropriately:
- Verify required fields in strict mode:
- Handle nested objects carefully: