> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truv.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Processing Demo

> Process pay stubs, W-2s, and tax returns for benefit eligibility decisions

The Public Sector Document Processing demo shows how to extract structured income data from documents submitted by benefit applicants for eligibility determination. **Source:** [GitHub](https://github.com/truvhq/demo-apps#public-sector)

```bash theme={null}
git clone https://github.com/truvhq/demo-apps.git
cd demo-apps && npm install && cp .env.example .env
npm start && npm run dev  # select "Public Sector" → "Document Processing"
```

<img src="https://mintcdn.com/truv/xdZxh_j1HXZYzFiN/images/demos/public-sector/document-processing.png?fit=max&auto=format&n=xdZxh_j1HXZYzFiN&q=85&s=14d5ca1616d5baed9e669e05a2e28aed" alt="Public Sector Document Processing demo" width="1200" height="676" data-path="images/demos/public-sector/document-processing.png" />

## Flow

<Steps>
  <Step title="Upload documents">
    Upload documents submitted by the applicant. The backend creates a user and a document collection.

    ```
    POST /v1/users/
    POST /v1/documents/collections/
    ```
  </Step>

  <Step title="Poll for processing status">
    Poll until all files reach a terminal status.

    ```
    GET /v1/documents/collections/{id}/
    ```
  </Step>

  <Step title="Finalize and retrieve extracted data">
    Finalize to generate the structured income report for eligibility determination.

    ```
    POST /v1/documents/collections/{id}/finalize/
    GET  /v1/documents/collections/{id}/finalize/
    ```
  </Step>
</Steps>

**Integration pattern:** [Document Processing](/developers/integration/document-processing) | **Products:** Pay stubs, W-2s, 1040s, bank statements
