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

# addUserBankAccount

> The `addUserBankAccount` API allows you to add a bank account for an employee.

For more information on employee bank account linking, refer to the [Employee Bank Account Linking guide](https://developer.rollfi.xyz/docs/EmployeeBankAccountLinking).

### Account linking with Plaid

Use the `linkType` field to specify the account linking method. Supported values are:

- `Manual`
- `Plaid`
- `CustomProvider`

If `linkType` is set to `Plaid`, use the `plaidOptions` field to either:

- Send the Plaid invitation via email
- Return the Plaid link in the API response to surface within your UI

The employee must have an email address on file to receive a Plaid invitation. If the employee was onboarded without an email address, use the `updateUser` endpoint to add one.

> ⚠️ **Warning:** Only one Plaid linking request can be active at a time. The employee must complete account linking using the original Plaid link before additional bank accounts can be added.

### Notes

- A bank account is required before employees using **Direct Deposit** can become active.
- The first bank account is automatically assigned `payPercentage: 100`.
- Multiple accounts may be added. After adding additional bank accounts, update allocation percentages using the `updateUserPayPercentage` API.
- If `linkType` is omitted from the request, it currently defaults to `Manual`.

---

## Changing an employee's bank account

- `payPercentage` is used to deactivate an existing bank account for payment purposes so a new one can be used instead.
- To change `payPercentage`, add a secondary bank account using `addUserBankAccount`.
- The secondary bank account can then be set to `payPercentage: 100` using the `updateUserPayPercentage` API.
- This update pattern retains an audit record of which bank accounts have been added or paid out to.




## OpenAPI

````yaml post /userPortal/addUserBankAccount
openapi: 3.0.1
info:
  title: Default module
  description: ''
  version: 1.0.0
servers: []
security:
  - basic: []
tags: []
paths:
  /userPortal/addUserBankAccount:
    post:
      tags: []
      summary: addUserBankAccount
      description: >
        The `addUserBankAccount` API allows you to add a bank account for an
        employee.


        For more information on employee bank account linking, refer to the
        [Employee Bank Account Linking
        guide](https://developer.rollfi.xyz/docs/EmployeeBankAccountLinking).


        ### Account linking with Plaid


        Use the `linkType` field to specify the account linking method.
        Supported values are:


        - `Manual`

        - `Plaid`

        - `CustomProvider`


        If `linkType` is set to `Plaid`, use the `plaidOptions` field to either:


        - Send the Plaid invitation via email

        - Return the Plaid link in the API response to surface within your UI


        The employee must have an email address on file to receive a Plaid
        invitation. If the employee was onboarded without an email address, use
        the `updateUser` endpoint to add one.


        > ⚠️ **Warning:** Only one Plaid linking request can be active at a
        time. The employee must complete account linking using the original
        Plaid link before additional bank accounts can be added.


        ### Notes


        - A bank account is required before employees using **Direct Deposit**
        can become active.

        - The first bank account is automatically assigned `payPercentage: 100`.

        - Multiple accounts may be added. After adding additional bank accounts,
        update allocation percentages using the `updateUserPayPercentage` API.

        - If `linkType` is omitted from the request, it currently defaults to
        `Manual`.


        ---


        ## Changing an employee's bank account


        - `payPercentage` is used to deactivate an existing bank account for
        payment purposes so a new one can be used instead.

        - To change `payPercentage`, add a secondary bank account using
        `addUserBankAccount`.

        - The secondary bank account can then be set to `payPercentage: 100`
        using the `updateUserPayPercentage` API.

        - This update pattern retains an audit record of which bank accounts
        have been added or paid out to.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                linkType:
                  type: string
                  enum:
                    - Manual
                    - Plaid
                    - CustomProvider
                plaidOptions:
                  type: string
                userPayAccountEntity:
                  type: object
                  properties:
                    companyId:
                      type: string
                    userId:
                      type: string
                    accountNumber:
                      type: string
                      maxLength: 40
                    routingNumber:
                      type: string
                      maxLength: 25
                    bankName:
                      type: string
                      maxLength: 40
                    accountType:
                      type: string
                      maxLength: 40
                    accountName:
                      type: string
                      maxLength: 40
                  required:
                    - companyId
                    - userId
              required:
                - method
                - userPayAccountEntity
            examples:
              '1':
                value:
                  method: addUserBankAccount
                  linkType: Manual
                  userPayAccountEntity:
                    companyId: 8A9B7683-8E02-494D-8422-963FD05EE785
                    userId: e066e305-3816-4b06-8576-50d2502be436
                    accountNumber: '9889890989'
                    routingNumber: '122238242'
                    bankName: Chase Bank
                    accountType: savings
                    accountName: default
                summary: Manual
              '2':
                value:
                  method: addUserBankAccount
                  linkType: Plaid
                  plaidOptions: sendInviteByEmail
                  userPayAccountEntity:
                    companyId: 8A9B7683-8E02-494D-8422-963FD05EE785
                    userId: e066e305-3816-4b06-8576-50d2502be436
                summary: Plaid - Email
              '3':
                value:
                  method: addUserBankAccount
                  linkType: Plaid
                  plaidOptions: generateURL
                  userPayAccountEntity:
                    companyId: 8A9B7683-8E02-494D-8422-963FD05EE785
                    userId: e066e305-3816-4b06-8576-50d2502be436
                summary: Plaid - URL link
              '4':
                value:
                  method: addUserBankAccount
                  linkType: CustomProvider
                  userPayAccountEntity:
                    companyId: 8A9B7683-8E02-494D-8422-963FD05EE785
                    userId: e066e305-3816-4b06-8576-50d2502be436
                    accountNumber: '9889890989'
                    routingNumber: '122238242'
                    bankName: Chase Bank
                    accountType: savings
                    accountName: default
                summary: Custom Provider
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  userPayAccountEntity:
                    type: object
                    properties:
                      userPayAccountEntityId:
                        type: string
                      status:
                        type: string
                      message:
                        type: string
                    required:
                      - userPayAccountEntityId
                      - status
                      - message
                  message:
                    type: string
                  inviteSentTo:
                    type: string
                  plaidLinkURL:
                    type: string
                  expirationDate:
                    type: string
              examples:
                '1':
                  summary: Manual
                  value:
                    userPayAccountEntity:
                      userPayAccountEntityId: 8BE7466C-37B5-4437-8FEE-7D0B582784BD
                      status: Ready
                      message: The User PayAccount Entity has been added successfully.
                '2':
                  summary: Plaid - Email
                  value:
                    message: >-
                      Bank Linking is in progress , payPercentage will be
                      updated , once the linking is completed.
                    inviteSentTo: testPlaidUser@mailsac.com
                    expirationDate: '2023-08-18T02:08:03Z'
                '3':
                  summary: Plaid - URL link
                  value:
                    message: >-
                      Bank Linking is in progress , payPercentage will be
                      updated , once the linking is completed.
                    plaidLinkURL: >-
                      https://secure.plaid.com/link/lp9o97618r1r6p93oon62nr025950ro4s3
                    expirationDate: '2023-08-18T02:08:03Z'
                '4':
                  summary: Custom Provider
                  value:
                    userPayAccountEntity:
                      userPayAccountEntityId: 8BE7466C-37B5-4437-8FEE-7D0B582784BD
                      status: Ready
                      message: The User PayAccount Entity has been added successfully.
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                        message:
                          type: string
                      required:
                        - code
                        - message
                required:
                  - error
              example:
                error:
                  code: 400
                  message: This employee does not have a saved email address
          headers: {}
      deprecated: false
      security:
        - basic: []
components:
  securitySchemes:
    basic:
      type: http
      scheme: basic

````