> ## 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.

# Paycheck-Linked Loans

> Set up automatic loan repayment directly from the borrower paycheck via payroll deduction

Set up automatic loan repayment by connecting to the borrower's payroll provider. The borrower authenticates through [Truv Bridge](/developers/sdks/overview), and Truv routes a fixed amount or percentage of each paycheck to your bank account. You also receive a verified income report alongside the deposit switch confirmation.

<Info>
  **Integration pattern:** [Bridge Widget](/developers/integration/bridge-widget/overview) | **Products:** PLL (Paycheck-Linked Lending) | **Demo:** [Paycheck-Linked Loans](/developers/demos/consumer-credit/paycheck-linked-loans)
</Info>

***

## Get started

<Steps>
  <Step title="Run the demo">
    Clone and run the [Paycheck-Linked Loans demo](/developers/demos/consumer-credit/paycheck-linked-loans) to see the full paycheck-linked lending flow working locally.

    ```bash theme={null}
    git clone https://github.com/truvhq/demo-apps.git
    cd demo-apps
    npm install && npm start
    ```

    Open `http://localhost:5173`, select **Consumer Credit > Paycheck-Linked Loans**, and walk through a verification using sandbox credentials (`goodlogin` / `goodpassword`).

    See [full setup instructions](/developers/quickstarts-overview#demo-apps) for ngrok and environment configuration.
  </Step>

  <Step title="Understand the API flow">
    The demo follows this sequence:

    1. **Search for employer** -- Your server calls [GET /v1/company-mappings-search/](/api-reference/companies/company_autocomplete_search) to find the borrower's employer by name.
    2. **Create a user** -- Your server calls [POST /v1/users/](/api-reference/users/users_create) to create a Truv user.
    3. **Create a bridge token** -- Your server calls [POST /v1/users/{id}/tokens/](/api-reference/bridge-token/users_tokens) with `product_type: "pll"` and optionally `company_mapping_id` to [deeplink](/developers/integration/bridge-widget/deeplinking) Bridge to the employer. Include the `account` object with your bank details and deduction configuration.
    4. **Initialize Bridge** -- Your frontend opens [Truv Bridge](/developers/sdks/overview) with the `bridge_token`. The borrower connects their payroll and confirms the deduction.
    5. **Receive webhooks** -- Truv sends a `task-status-updated` [webhook](/api-reference/webhooks) when the enrollment completes. Verify the signature using the `X-Webhook-Sign` header with HMAC-SHA256.
    6. **Retrieve dual reports** -- Fetch the [VOIE report](/api-reference/user-income-and-employment-reports/users_reports) with `POST /v1/users/{user_id}/reports/` for income data. Fetch the [deposit switch report](/api-reference/dds-reports/dds-report-retrieve) with `GET /v1/users/{user_id}/deposit_switch/report/` for deduction confirmation.
  </Step>

  <Step title="Review the code">
    Each step maps to a specific file in the demo. Use these as reference when building your integration.

    | Step                  | Demo file                                                                                                              | API reference                                                                     |
    | --------------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
    | Employer search       | [`src/components/CompanySearch.jsx`](https://github.com/truvhq/demo-apps/blob/main/src/components/CompanySearch.jsx)   | [Company Search](/api-reference/companies/company_autocomplete_search)            |
    | User creation         | [`server/routes/bridge.js`](https://github.com/truvhq/demo-apps/blob/main/server/routes/bridge.js)                     | [POST /v1/users/](/api-reference/users/users_create)                              |
    | Bridge token          | [`server/routes/bridge.js`](https://github.com/truvhq/demo-apps/blob/main/server/routes/bridge.js)                     | [POST /v1/users/{id}/tokens/](/api-reference/bridge-token/users_tokens)           |
    | Bridge initialization | [`src/demos/PaycheckLinkedLoans.jsx`](https://github.com/truvhq/demo-apps/blob/main/src/demos/PaycheckLinkedLoans.jsx) | [Bridge SDK](/developers/sdks/overview)                                           |
    | Webhook verification  | [`server/webhooks.js`](https://github.com/truvhq/demo-apps/blob/main/server/webhooks.js)                               | [Webhooks](/api-reference/webhooks)                                               |
    | Income report         | [`server/routes/user-reports.js`](https://github.com/truvhq/demo-apps/blob/main/server/routes/user-reports.js)         | [Income reports](/api-reference/user-income-and-employment-reports/users_reports) |
    | Deposit switch report | [`server/routes/user-reports.js`](https://github.com/truvhq/demo-apps/blob/main/server/routes/user-reports.js)         | [Deposit switch report](/api-reference/dds-reports/dds-report-retrieve)           |
  </Step>
</Steps>

***

## Consumer Credit-specific configuration

### Bridge token for PLL

Set `product_type` to `"pll"` and include the `account` object with your bank details and deduction configuration:

```json theme={null}
{
  "product_type": "pll",
  "company_mapping_id": "COMPANY_MAPPING_ID",
  "account": {
    "account_number": "16002600",
    "routing_number": "123456789",
    "bank_name": "Your Bank",
    "account_type": "checking",
    "deposit_type": "amount",
    "deposit_value": "200.00"
  }
}
```

### Deduction options

Control the repayment amount with `deposit_type` and `deposit_value`:

| `deposit_type` | `deposit_value` | Description                      |
| -------------- | --------------- | -------------------------------- |
| `amount`       | `"200.00"`      | Fixed dollar amount per paycheck |
| `percent`      | `"10"`          | Percentage of each paycheck      |

### Dual reports

PLL verification produces two reports in parallel:

| Report                                                                         | Endpoint                                         | What it contains                               |
| ------------------------------------------------------------------------------ | ------------------------------------------------ | ---------------------------------------------- |
| [VOIE report](/api-reference/user-income-and-employment-reports/users_reports) | `POST /v1/users/{user_id}/reports/`              | Verified income, employment, and pay history   |
| [Deposit switch report](/api-reference/dds-reports/dds-report-retrieve)        | `GET /v1/users/{user_id}/deposit_switch/report/` | Deduction confirmation with allocation details |

<Note>
  Both reports become available after the `task-status-updated` webhook fires with `status: done`. Fetch them in parallel for the fastest results.
</Note>

***

## Next steps

<CardGroup cols={2}>
  <Card title="Smart Routing" icon="route" href="/credit/integration/smart-routing">
    Verify income before approval, then set up PLL after
  </Card>

  <Card title="Bridge Widget Guide" icon="book-open" href="/developers/integration/bridge-widget/overview">
    Full implementation guide for user creation, bridge tokens, and Bridge initialization
  </Card>

  <Card title="PLL Product" icon="money-bill-transfer" href="/credit/products/pll">
    Product details for Paycheck-Linked Lending
  </Card>

  <Card title="Bridge Events" icon="bolt" href="/developers/sdks/bridge-events">
    Handle all Bridge lifecycle events and error codes
  </Card>
</CardGroup>
