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

# /Prepayment

> Use this endpoint to submit additional information on a given end-user and retrieve Payment Optimization insights.

Use the `/Prepayment` Endpoint to submit additional information on a given end-user and retrieve Payment Optimization insights that will help you and your team set the correct payment dates.

## Response Fields

| **NAME**               | **TYPE** | **DESCRIPTION**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name                   | string   | The full name of the user that has connected their account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Address                | string   | The full civic address of the user that has connected their bank account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Email                  | string   | The email address of the user that has connected their bank account. This value is null if unavailable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| EFTEligibleAccounts    | string   | A count of accounts (displayed below in lists) that are eligible to be set up for EFT or ACH payments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| AccountName            | string   | The name of the account as it is at the Financial Institution.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| AccountNumber          | string   | The full account number of the account as it is at the Financial Institution. To be used to setup payments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| InstitutionNumber      | string   | The institution number of the Financial Institution linked. To be used to setup payments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| SortCode               | string   | The sort-code of the Financial Institution and Account linked. To be used to setup payments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| RoutingNumber          | string   | The routing number (if available) of the Financial Institution and Account linked. To be used to setup payments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| OptimalPayments        | list     | A list of payments that correspond with the scheduled frequency and duration as passed within the request. For example, a duration of four will generate four distinct `dates` within this list. These dates are the most optimal dates within the calendar week where a payment of the requested frequency and amount are identified to be the most successful. Format of `date` is `MM/DD/YYYY`.                                                                                                                                                                                                           |
| OptimalDay             | string   | A textual field that represents the most optimal day of the week (limited to Monday-Friday) to initiate a payment given the amount requested. This field should be used if the OptimalPayments schedule above is not attainable for a given user. Responses can be any of: `Monday`, `Tuesday`, `Wednesday`, `Thursday`, or `Friday`.                                                                                                                                                                                                                                                                        |
| OverallPaymentRisk     | string   | A decimal field that represents the percentage chance of a payment of the submitted amount failing at any point in the future. I.e. What is the risk that the given user's balance falls below the expected repayment amount on any day in the future. A 1.00 response (100%) indicates that the user will never have enough money within their account to perform the required payment, whereas a 0.00 response (0%) indicates that the user will always have enough money in their account to perform the required payment. This is **not** a credit risk estimation, it is simply a cash flow projection. |
| NSFsLast90Days         | string   | A count of NSFs that have occurred within the last 90 days. To be used to understand the direct risk of that user not having sufficient funds as per their direct history.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| StopPaymentsLast90Days | string   | A count of stop payments that have occurred within the last 90 days. To be used to understand the direct risk of a user initiating a stop on any payments as per their direct history.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Frequency              | string   | A pass-through of the requested frequency of payments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| PaymentDates           | list     | A non-optimized list of dates (following the same format as the `OptimalPayments` list above. This list simply returns the exact dates that are requested based on the frequency and duration, with no optimization performed.                                                                                                                                                                                                                                                                                                                                                                               |
| Date                   | date     | The anticipated date of funding for the initial deposit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Amount                 | string   | The anticipated amount of funding for the initial deposit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |


## OpenAPI

````yaml POST /v3/{customerId}/prepayment/login/{LoginId}/{RequestId}
openapi: 3.0.3
info:
  title: Flinks API
  description: >
    Flinks API provides financial data connectivity, enrichment, and payment
    solutions.


    ## Authentication

    Endpoints require authentication using `flinks-auth-key` header (Bearer
    token).


    For more information, visit: https://docs.flinks.com
  version: 3.0.0
  contact:
    name: Flinks Support
    url: https://www.flinks.com/contact/sales
  termsOfService: https://www.flinks.com
servers:
  - url: https://{instance}-api.private.fin.ag
    description: Flinks API Environment
    variables:
      instance:
        default: toolbox
        description: The environment instance (e.g., toolbox, sandbox, production)
security: []
tags:
  - name: Authorization
    description: Endpoints for generating authorization tokens and authenticating requests
  - name: Enrich - Consumer Attributes
    description: Consumer financial attribute analysis and credit risk assessment
paths:
  /v3/{customerId}/prepayment/login/{LoginId}/{RequestId}:
    post:
      tags:
        - Enrich
      summary: Prepayment
      description: >-
        Use this endpoint to submit additional information on a given end-user
        and retrieve Payment Optimization insights.
      operationId: prepayment
      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: string
            default: 43387ca6-0391-4c82-857d-70d95f087ecb
          description: >-
            Key that grants access to the environment specified in the instance
            field.
        - name: LoginId
          in: path
          required: true
          schema:
            type: string
          description: GUID representing end user's login ID.
        - name: RequestId
          in: path
          required: true
          schema:
            type: string
          description: GUID representing an authorized request to the API.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                LoanFrequency:
                  type: string
                  description: >-
                    Input that defines the frequency to be used in calculating
                    the optimal days of payment.
                  enum:
                    - Weekly
                    - BiWeekly
                    - BiMonthly
                    - Monthly
                ExpectedRepaymentTotal:
                  type: string
                  description: >-
                    Submitted value that represents the entire amount that will
                    be repaid back at the end of the given duration/term.
                FundingDate:
                  type: string
                  description: >-
                    The date that a funding event is expected to occur. Format
                    should be in YYYY-MM-DD.
                Duration:
                  type: string
                  description: >-
                    An integer corresponding with how many payments are expected
                    to take place.
              example:
                LoanFrequency: Monthly
      responses:
        '200':
          description: Successful Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  UserInformation:
                    type: object
                    description: Object containing user details.
                  AccountsInformation:
                    type: array
                    items:
                      type: object
                    description: >-
                      Array of account objects containing payment optimization
                      details.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    description: Error object returned when the request is invalid.

````