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

# Generate link_url

> Generate a short-lived Finverse Link URL (link_url) and access_token (referred to as `link_token`) to open the Finverse Link UI (in Mandate mode) in a browser window to allow an End-User to authorize the Mandate. The link_token is associated with a specific Customer App (client_id) and End-User (user_id), and expires after 60 minutes (resend request to renew).

**Authorization**: `customer_token`.

### link_customizations (object, required)

#### Required parameters for `link_customizations`

#### Optional parameters for `link_customizations`

You can use the following optional parameters to customize the behaviour of Finverse Link's UI to fit your implementation requirements.

## Token handling

### Usage

`link_token` is intended for use by front-end clients to call Finverse API. It is the only Finverse API token that is considered non-sensitive.

### Renewal

`link_token` expires after 60 minutes.

Repeat this request for token renewal.



## OpenAPI

````yaml /api-reference/openapi.json post /mandates/link
openapi: 3.0.0
info:
  description: Documentation of the early finverse services
  title: Finverse Public
  termsOfService: https://example.com
  contact:
    name: Maintainers
    email: info@finverse.com
  license:
    name: unknown license
  version: 0.0.1
servers:
  - url: https://api.prod.finverse.net
security:
  - Oauth2:
      - test
tags:
  - name: public
    description: Publicly accessible endpoints
    x-group: Public
  - name: customer
    description: Customer app and institution endpoints
    x-group: Customer
  - name: link
    description: Finverse Link flows
    x-group: Link
  - name: login_identity
    description: Login identity lifecycle and metadata
    x-group: Login identity
  - name: accounts
    description: Accounts, balances, and account numbers
    x-group: Accounts
  - name: statements
    description: Statements and composite statements
    x-group: Statements
  - name: transactions
    description: Transaction history
    x-group: Transactions
  - name: identity_income
    description: Identity and income insights
    x-group: Identity & income
  - name: payment_links
    description: Payment link creation and checkout
    x-group: Payment links
  - name: mandates
    description: Direct debit mandates
    x-group: Mandates
  - name: payments
    description: Payment initiation and status
    x-group: Payment operations
  - name: payouts
    description: Payouts and scheduled payouts
    x-group: Payouts
  - name: payment_users
    description: Payment user profiles
    x-group: Payment users
  - name: payment_accounts
    description: Payment accounts for users
    x-group: Payment accounts
  - name: payment_methods
    description: Stored payment methods
    x-group: Payment methods
  - name: bills
    description: Bill presentment
    x-group: Bills
  - name: disputes
    description: Payment disputes
    x-group: Disputes
  - name: ledger
    description: Ledger and statements
    x-group: Ledger
paths:
  /mandates/link:
    post:
      tags:
        - mandates
      summary: Generate link_url
      description: >-
        Generate a short-lived Finverse Link URL (link_url) and access_token
        (referred to as `link_token`) to open the Finverse Link UI (in Mandate
        mode) in a browser window to allow an End-User to authorize the Mandate.
        The link_token is associated with a specific Customer App (client_id)
        and End-User (user_id), and expires after 60 minutes (resend request to
        renew).


        **Authorization**: `customer_token`.


        ### link_customizations (object, required)


        #### Required parameters for `link_customizations`


        #### Optional parameters for `link_customizations`


        You can use the following optional parameters to customize the behaviour
        of Finverse Link's UI to fit your implementation requirements.


        ## Token handling


        ### Usage


        `link_token` is intended for use by front-end clients to call Finverse
        API. It is the only Finverse API token that is considered non-sensitive.


        ### Renewal


        `link_token` expires after 60 minutes.


        Repeat this request for token renewal.
      operationId: getMandateAuthLink
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetMandateAuthLinkRequest'
        description: request body for mandate authorization link
        required: true
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMandateAuthLinkResponse'
              examples:
                success:
                  summary: Success
                  value:
                    access_token: link_token
                    expires_in: 300
                    issued_at: '2022-09-01T01:01:00.000Z'
                    link_url: >-
                      https://link.sandbox.finverse.net/onboarding?mandate_id=ULID&products_supported=PAYMENTStoken=link_token
                    token_type: Bearer
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
              examples:
                mandate_not_found:
                  summary: Error (Mandate not found)
                  value:
                    error:
                      details: Mandate not found
                      error_code: RESOURCE_NOT_FOUND
                      message: >-
                        Resource cannot be found. Resource does not exist, has
                        been deleted, or is not accessible.
                      request_id: '{unique_id}'
                      type: API_ERROR
                mandate_locked:
                  summary: Error (Mandate locked)
                  value:
                    error:
                      code: MANDATE_LOCKED
                      details: ''
                      error_code: MANDATE_LOCKED
                      message: >-
                        The mandate cannot be interacted with at the time being
                        because there are other processes underway that requires
                        the mandate to be unchanged.
                      request_id: '{unique_id}'
                      type: PAYMENT_ERROR
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBodyModelV2'
      security:
        - Oauth2:
            - mandate:create
components:
  schemas:
    GetMandateAuthLinkRequest:
      required:
        - mandate_id
        - link_customizations
      properties:
        link_customizations:
          $ref: '#/components/schemas/MandateAuthLinkCustomizations'
          description: >-
            Parameters to customize the behaviour of Finverse Link's UI to fit
            your implementation requirements
        mandate_id:
          description: >-
            Mandate ID of the Mandate to be authorized (created via `POST
            /mandates`).
          type: string
          maxLength: 100
    GetMandateAuthLinkResponse:
      required:
        - access_token
        - expires_in
        - link_url
        - token_type
      properties:
        access_token:
          type: string
          description: Link session token (referred to as `link_token`)
        expires_in:
          description: Token validity length (in seconds)
          type: integer
        link_url:
          description: >-
            URL to launch the Finverse Link UI flow associated with this
            `link_token`, for the end-user to provide required consent and
            Mandate/Payment inputs.
          type: string
        token_type:
          type: string
          enum:
            - Bearer
          description: 'Possible values: `Bearer`'
    ErrBodyModelV2:
      properties:
        error:
          $ref: '#/components/schemas/FvErrorModelV2'
    MandateAuthLinkCustomizations:
      properties:
        countries:
          description: >-
            Filters "Select Institution" screen in Finverse Link UI to only list
            institutions from the specified countries. If empty, all
            institutions are listed. E.g. `["SGP", "VNM"]` **Recommended
            value**: \[\]
          type: array
          items:
            type: string
          example:
            - HKG
            - SGP
        institution_id:
          description: >-
            Instructs Finverse Link UI to skip the institution selection screen
            (after the consent screen). **Accepted values**: A single
            institution's `institution_id` (see `GET /institutions`).
            **Recommended Value**: ""
          type: string
          example: hsbc-hk
        institution_status:
          description: >-
            Specifies which institutions to list in the Finverse Link UI based
            on their reliability status. If empty, only supported institutions
            are listed. E.g. `"beta supported"` **Recommended value**: ""
          type: string
          example: alpha beta supported
        language:
          description: >-
            Desired language selection for Finverse Link UI. If empty or if an
            unsupported language is specified, Finverse Link will display the
            default language. Users can manually override the language selection
            on the 1st Finverse Link screen. Supported languages: `en`
            (default), `vn`, `zh` **Recommended Value**: any
          type: string
          enum:
            - en
            - vi
            - zh
            - ko
          example: en
        link_mode:
          description: >-
            Specifies whether to display specific sets of institutions (e.g.
            test institutions) in the Finverse Link UI. This can be helpful for
            testing purposes. E.g. `"real test"` **Accepted values**: \- `real`
            : show only real banks (default for live apps) \- `test` : show only
            testbanks \- `real test` shows both real banks & testbanks (default
            for test apps) **Recommended value**: ""
          type: string
          example: real
        products_supported:
          description: >-
            Filters the "Select Institution" screen in the Finverse Link UI to
            only list institutions which support the specified products. If left
            empty, all institutions are listed (including institutions which do
            not support Mandates/Payments). **Required value**: \["PAYMENTS"\]
            for Mandate and Payments modes.
          type: array
          items:
            type: string
          example:
            - ACCOUNTS
            - TRANSACTIONS
            - MANDATE
        redirect_uri:
          description: >-
            Required when `ui_mode` = `redirect`. When `ui_mode` = `redirect`,
            the Finverse Link UI will redirect to this uri after success,
            failure or when user exits the UI. Uri must be one of the
            redirect_uri values registered by customer under "API settings" in
            Finverse developer dashboard (dashboard.finverse.com).
          type: string
        ui_mode:
          description: >-
            Specifies the behaviour of the Finverse Link UI upon completion of
            the authorization flow (in both success or error cases). If left
            empty, Finverse Link will default to `standalone` behaviour for both
            the Payment Links and Mandates UI. **Accepted values**: \-
            `redirect`: for when Finverse Link UI is launched as a
            window/webview embedded within the customer's application. Finverse
            will display an Exit ("X") button on each screen and a "Continue"
            button on final success/error screens, each redirecting to the
            specified `redirect_uri`, allowing the user to return to the
            customer's application. \- `standalone`: for when Finverse Link UI
            is launched in a new window/webview without the need to navigate
            back to the customer's application. Finverse will display a "You may
            close this window now" message on final success/error screens,
            guiding the user to manually close the window/webview. \- `iframe`:
            for when Finverse Link UI is launched as an iframe/webview embedded
            within the customer's application. Finverse will display an Exit
            ("X") button on each screen and a "Continue" button on final
            success/error screens, allowing the user to close the iframe/webview
            and return to the customer's application (requires customer's
            application to handle iframe/webview messages). **Recommended
            value**: `redirect` or `standalone`
          type: string
          enum:
            - iframe
            - redirect
            - auto_redirect
            - standalone
          example: redirect
        user_type:
          description: institution's supported user_type filter
          type: array
          items:
            type: string
          example:
            - PERSONAL
    FvErrorModelV2:
      required:
        - type
        - error_code
        - message
        - details
        - request_id
      properties:
        details:
          type: string
        error_code:
          type: string
          example: CREDENTIALS_INVALID
        message:
          type: string
        request_id:
          description: The request_id provided in the request header
          type: string
        type:
          description: The error type
          type: string
          enum:
            - LINK_ERROR
            - API_ERROR
          example: LINKING_ERROR
  securitySchemes:
    Oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://finverse-dev.us.auth0.com/oauth/token
          scopes:
            account: Account
            balance: Balance
            credit: Credit
            institution: Institution
            investment: Investment
            link: Link
            test: Test
            transaction: Transaction

````