Skip to main content
The Document Processing demo shows how to upload documents, validate them, and extract structured income and employment data, without Truv Bridge or payroll connections. Integration pattern: Document Processing | Products: Document extraction (pay stubs, W-2s, 1099s, 1040s)
git clone https://github.com/truvhq/demo-apps.git
cd demo-apps && npm install && cp .env.example .env
# Add your API_CLIENT_ID, API_SECRET, and NGROK_URL to .env
npm start        # Express server on :3000
npm run dev      # Vite dev server on :5173 — select "Document Processing"
See Demo Apps overview for full setup details including ngrok configuration.

Flow

1

Identify or create a user

Retrieve an existing user_id or create a new user. Save the returned id for subsequent steps.
GET /v1/users/
POST /v1/users/
2

Upload documents

Select files and upload them. The app creates a document collection and uploads each file.
POST /v1/documents/collections/
POST /v1/documents/collections/{id}/upload/
3

Validation

Truv validates each document:
  • is_valid: recognized document type
  • is_readable: text is extractable
  • document_type: paystub, w2, 1099, etc.
Poll the collection status until all documents are processed.
4

Finalize

Once validated, finalize the collection to extract structured data.
POST /v1/documents/collections/{id}/finalize/
5

Review

Fetch the extracted data: employer name, pay period, gross/net pay, tax withholdings, and more.
GET /v1/documents/collections/{id}/finalize/

Test documents

Use the sample PDFs from Test Documents. The sandbox determines results based on file name, not file content.