openapi: 3.0.1
info:
  title: Pier API
  version: ''
paths:
  /applications:
    post:
      operationId: applications_create
      tags:
        - Applications
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Example1:
                  value:
                    id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    credit_type: consumer_installment_loan
                    rejection_reasons: []
                    status: pending
                    lender_of_record: lender
                    created_on: '2022-12-31T01:36:52.606Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create an application
      security: &ref_0
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                borrower_id:
                  type: string
                  description: >-
                    The `borrower_id` of the borrower the application is for
                    (1-256 chars)
                  example: bor_a1d0c30d77104f35b4c842b99132624e
                credit_type:
                  $ref: '#/components/schemas/CreditType'
                  description: The type of credit product.
                requested_amount:
                  type: integer
                  nullable: true
                  description: >-
                    If the borrower requests an amount in their application, the
                    requested loan or credit line amount (in cents).
                third_party_disbursement_destination:
                  type: string
                  nullable: true
                  description: >-
                    For credit applications of type `consumer/commercial_bnpl`,
                    the third party (i.e. merchant - "Acme Co.") is the person
                    receiving the funds
              required:
                - borrower_id
                - credit_type
            examples:
              Example1:
                value:
                  borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                  credit_type: consumer_installment_loan
                  requested_amount: 200000
    get:
      description: List all applications associated with your account
      operationId: applications_getAll
      tags:
        - Applications
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Application'
              examples:
                Example1:
                  value:
                    - id: app_f0467657bba948e6a87292e182132848
                      borrower_id: bor_d965bea9f47a4b108562642dbb1dae9f
                      credit_type: consumer_revolving_line_of_credit
                      rejection_reasons: []
                      status: approved
                      offers:
                        - type: revolving_line_of_credit_offer
                          id: off_86c05092a4384d89b03ef514ea4fee31
                          amount: 1000000
                          apr: 0
                          annual_fee: 0
                          billing_cycle: 30
                          finance_charge: 0
                          grace_period:
                            term: 21
                            interest_rate: 0
                          introductory_promo_period:
                            interest_rate: 0
                            promo_term:
                              term: 90
                              term_type: daily
                          interest_rate: 0
                          late_payment_fee: 0
                          minimum_payment:
                            type: interest_plus_percentage_of_principal
                            value: 500
                            floor: 3000
                          payment_period: monthly
                          first_payment_date: '2022-12-31'
                      lender_of_record: lender
                      created_on: '2022-12-31T01:36:52.606Z'
                      decisioned_on: '2023-01-17T05:31:52.955Z'
                    - id: app_f0467657bba948e6a87292e182132848
                      borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                      credit_type: consumer_installment_loan
                      rejection_reasons: []
                      status: pending
                      lender_of_record: lender
                      created_on: '2022-12-31T01:36:52.606Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all applications
      security: *ref_0
  /applications/{application_id}/approve:
    post:
      operationId: applications_approve
      tags:
        - Applications
      parameters:
        - name: application_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ApplicationId'
          example: app_f0467657bba948e6a87292e182132848
          examples:
            Example1:
              value: app_f0467657bba948e6a87292e182132848
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Example1:
                  value:
                    id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_d965bea9f47a4b108562642dbb1dae9f
                    credit_type: consumer_revolving_line_of_credit
                    rejection_reasons: []
                    status: approved
                    offers:
                      - type: revolving_line_of_credit_offer
                        id: off_86c05092a4384d89b03ef514ea4fee31
                        amount: 1000000
                        apr: 0
                        annual_fee: 0
                        billing_cycle: 30
                        finance_charge: 0
                        grace_period:
                          term: 21
                          interest_rate: 0
                        introductory_promo_period:
                          interest_rate: 0
                          promo_term:
                            term: 90
                            term_type: daily
                        interest_rate: 0
                        late_payment_fee: 0
                        minimum_payment:
                          type: interest_plus_percentage_of_principal
                          value: 500
                          floor: 3000
                        payment_period: monthly
                        first_payment_date: '2022-12-31'
                    lender_of_record: lender
                    created_on: '2022-12-31T01:36:52.606Z'
                    decisioned_on: '2023-01-17T05:31:52.955Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Approve an application
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                offers:
                  type: array
                  items:
                    $ref: '#/components/schemas/OfferRequest'
              required:
                - offers
            examples:
              Example1:
                value:
                  offers:
                    - type: revolving_line_of_credit_offer
                      amount: 1000000
                      apr: 0
                      annual_fee: 0
                      billing_cycle: 30
                      finance_charge: 0
                      grace_period:
                        term: 21
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      late_payment_fee: 0
                      minimum_payment:
                        type: interest_plus_percentage_of_principal
                        value: 500
                        floor: 3000
                      payment_period: monthly
                      first_payment_date: '2022-12-31'
  /applications/{application_id}/reject:
    post:
      description: >-
        Updates the status of a credit application to `rejected` and returns a
        user readable rejection reason, to be used in the adverse action notice
      operationId: applications_reject
      tags:
        - Applications
      parameters:
        - name: application_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ApplicationId'
          example: app_f0467657bba948e6a87292e182132848
          examples:
            Example1:
              value: app_f0467657bba948e6a87292e182132848
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Example1:
                  value:
                    rejection_reasons:
                      - bank_balance_too_low
                    id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_1677bbbaf21a4954bb114bd9c4348d8a
                    credit_type: consumer_installment_loan
                    status: rejected
                    lender_of_record: lender
                    created_on: '2022-12-31T02:20:35.934Z'
                    decisioned_on: '2022-12-31T02:21:01.842Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Reject an application
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rejection_reasons:
                  type: array
                  items:
                    $ref: '#/components/schemas/RejectionReason'
              required:
                - rejection_reasons
            examples:
              Example1:
                value:
                  rejection_reasons:
                    - bank_balance_too_low
  /applications/{application_id}:
    get:
      description: Get an application by its id
      operationId: applications_get
      tags:
        - Applications
      parameters:
        - name: application_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ApplicationId'
          example: app_f0467657bba948e6a87292e182132848
          examples:
            Example1:
              value: app_f0467657bba948e6a87292e182132848
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Example1:
                  value:
                    id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_d965bea9f47a4b108562642dbb1dae9f
                    credit_type: consumer_revolving_line_of_credit
                    rejection_reasons: []
                    status: approved
                    offers:
                      - type: revolving_line_of_credit_offer
                        id: off_86c05092a4384d89b03ef514ea4fee31
                        amount: 1000000
                        apr: 0
                        annual_fee: 0
                        billing_cycle: 30
                        finance_charge: 0
                        grace_period:
                          term: 21
                          interest_rate: 0
                        introductory_promo_period:
                          interest_rate: 0
                          promo_term:
                            term: 90
                            term_type: daily
                        interest_rate: 0
                        late_payment_fee: 0
                        minimum_payment:
                          type: interest_plus_percentage_of_principal
                          value: 500
                          floor: 3000
                        payment_period: monthly
                        first_payment_date: '2022-12-31'
                    lender_of_record: lender
                    created_on: '2022-12-31T01:36:52.606Z'
                    decisioned_on: '2023-01-17T05:31:52.955Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get an application by ID
      security: *ref_0
  /token:
    post:
      description: >-
        Get a JWT token for use with the Pier API by passing in a valid
        `client_id`/`secret` in the body
      operationId: auth_getToken
      tags:
        - Auth
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
              examples:
                Example1:
                  value:
                    token: >-
                      eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get a JWT token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRequest'
            examples:
              Example1:
                value:
                  client_id: '1234567890'
                  secret: '1234567890'
  /borrowers/business:
    post:
      description: Creates a business borrower. Business borrowers must have a unique EIN.
      operationId: borrowers_createBusinessBorrower
      tags:
        - Borrowers
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessBorrowerResponse'
              examples:
                Example1:
                  value:
                    address:
                      line_1: 15 Market St
                      line_2: null
                      city: San Francisco
                      state: NJ
                      zip: '94133'
                    business_contact:
                      first_name: alex
                      last_name: montana
                      phone: '4155555555'
                      email: alex@acme.co
                      title: COO
                    beneficial_owners:
                      - address:
                          line_1: 15 Market St
                          line_2: null
                          city: San Francisco
                          state: CA
                          zip: '91133'
                        date_of_birth: '1991-12-18'
                        email: jdoe@acme.com
                        first_name: Jane
                        last_name: Dough
                        percent_ownership: 2500
                        phone: '4155555555'
                        id: 63ae91f8eae458cb0d79f77e
                    id: bor_18e5a3726b3943cda2635f40e1041ba4
                    business_name: Apple Landscaping
                    business_type: corporation
                    dba_name: Apple Landscaping
                    incorporation_date: '2000-12-12'
                    kyb_completion_date: '2022-11-15'
                    phone: '4152556465'
                    state_of_incorporation: DE
                    created_on: '2022-12-30T07:23:36.665Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create a business borrower
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessBorrowerRequest'
            examples:
              Example1:
                value:
                  address:
                    line_1: 15 Market St
                    line_2: null
                    city: San Francisco
                    state: NJ
                    zip: '94133'
                  business_contact:
                    first_name: alex
                    last_name: montana
                    phone: '4155555555'
                    email: alex@acme.co
                    title: COO
                  beneficial_owners:
                    - address:
                        line_1: 15 Market St
                        line_2: null
                        city: San Francisco
                        state: CA
                        zip: '91133'
                      date_of_birth: '1991-12-18'
                      email: jdoe@acme.com
                      first_name: Jane
                      last_name: Dough
                      percent_ownership: 2500
                      phone: '4155555555'
                      government_identifiers:
                        ssn: '123456789'
                      id: 63ae91f8eae458cb0d79f77e
                  business_name: Apple Landscaping
                  business_type: corporation
                  dba_name: Apple Landscaping
                  ein: '130256721'
                  incorporation_date: '2000-12-12'
                  kyb_completion_date: '2022-11-15'
                  phone: '4152556465'
                  state_of_incorporation: DE
  /borrowers/business/{borrower_id}:
    patch:
      description: >-
        Updates an existing borrower. The full borrower object less a few
        unchangeable fields needs to be

        supplied in the update request.
      operationId: borrowers_updateBusinessBorrower
      tags:
        - Borrowers
      parameters:
        - name: borrower_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/BusinessBorrowerId'
          example: bor_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: bor_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessBorrowerResponse'
              examples:
                Example1:
                  value:
                    address:
                      line_1: 15 Market St
                      line_2: null
                      city: San Francisco
                      state: NJ
                      zip: '94133'
                    business_contact:
                      first_name: alex
                      last_name: montana
                      phone: '4155555555'
                      email: alex@acme.co
                      title: COO
                    beneficial_owners:
                      - address:
                          line_1: 15 Market St
                          line_2: null
                          city: San Francisco
                          state: CA
                          zip: '91133'
                        date_of_birth: '1991-12-18'
                        email: jdoe@acme.com
                        first_name: Jane
                        last_name: Dough
                        percent_ownership: 2500
                        phone: '4155555555'
                        id: 63ae91f8eae458cb0d79f77e
                    id: bor_18e5a3726b3943cda2635f40e1041ba4
                    business_name: Apple Landscaping
                    business_type: corporation
                    dba_name: Apple Landscaping
                    incorporation_date: '2000-12-12'
                    kyb_completion_date: '2022-11-15'
                    phone: '4152556465'
                    state_of_incorporation: DE
                    created_on: '2022-12-30T07:23:36.665Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Update a business borrower
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBusinessBorrowerRequest'
            examples:
              Example1:
                value:
                  address:
                    line_1: 15 Market St
                    line_2: null
                    city: San Francisco
                    state: NJ
                    zip: '94133'
                  business_contact:
                    first_name: alex
                    last_name: montana
                    phone: '4155555555'
                    email: alex@acme.co
                    title: COO
                  beneficial_owners:
                    - address:
                        line_1: 15 Market St
                        line_2: null
                        city: San Francisco
                        state: CA
                        zip: '91133'
                      date_of_birth: '1991-12-18'
                      email: jdoe@acme.com
                      first_name: Jane
                      last_name: Dough
                      percent_ownership: 2500
                      phone: '4155555555'
                      government_identifiers:
                        ssn: '123456789'
                      id: 63ae91f8eae458cb0d79f77e
                  business_name: Apple Landscaping
                  business_type: corporation
                  dba_name: Apple Landscaping
                  incorporation_date: '2000-12-12'
                  kyb_completion_date: '2022-11-15'
                  phone: '4152556465'
                  state_of_incorporation: DE
  /borrowers/consumer:
    post:
      description: |-
        Create a consumer borrower. The created consumer resource is returned
        in the response.
      operationId: borrowers_createConsumerBorrower
      tags:
        - Borrowers
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumerBorrowerResponse'
              examples:
                Example1:
                  value:
                    address:
                      line_1: 15 Main Street
                      line_2: null
                      city: Austin
                      state: TX
                      zip: '73301'
                    id: bor_a1d0c30d77104f35b4c842b99132624e
                    date_of_birth: '1991-12-18'
                    email: jdough@acme.co
                    first_name: Jane
                    last_name: Dough
                    kyc_completion_date: '2022-11-15'
                    created_on: '2022-12-31T00:58:47.828Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create a consumer borrower
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsumerBorrowerRequest'
            examples:
              Example1:
                value:
                  address:
                    line_1: 15 Main Street
                    line_2: Unit 204
                    city: Austin
                    state: TX
                    zip: '73301'
                  date_of_birth: '1991-12-18'
                  email: jdough@acme.co
                  first_name: Jane
                  last_name: Dough
                  government_identifiers:
                    ssn: '999888777'
                  kyc_completion_date: '2022-11-15'
                  kyc_status: approved
  /borrowers/consumer/{borrower_id}:
    patch:
      description: >-
        Updates an existing borrower. The full borrower object less a few
        unchangeable fields needs to be

        supplied in the update request.
      operationId: borrowers_updateConsumerBorrower
      tags:
        - Borrowers
      parameters:
        - name: borrower_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ConsumerBorrowerId'
          example: bor_a1d0c30d77104f35b4c842b99132624e
          examples:
            Example1:
              value: bor_a1d0c30d77104f35b4c842b99132624e
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumerBorrowerResponse'
              examples:
                Example1:
                  value:
                    address:
                      line_1: 15 Main Street
                      line_2: null
                      city: Austin
                      state: TX
                      zip: '73301'
                    id: bor_a1d0c30d77104f35b4c842b99132624e
                    date_of_birth: '1991-12-18'
                    email: jdough@acme.co
                    first_name: Jane
                    last_name: Dough
                    kyc_completion_date: '2022-11-15'
                    created_on: '2022-12-31T00:58:47.828Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Update a consumer borrower
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConsumerBorrowerRequest'
            examples:
              Example1:
                value:
                  address:
                    line_1: 15 Main Street
                    line_2: Unit 204
                    city: Austin
                    state: TX
                    zip: '73301'
                  date_of_birth: '1991-12-18'
                  email: jdough@acme.co
                  kyc_completion_date: '2022-11-15'
                  kyc_status: approved
  /borrowers/{borrower_id}:
    get:
      description: Retrieve one borrower by id
      operationId: borrowers_getBorrower
      tags:
        - Borrowers
      parameters:
        - name: borrower_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ConsumerBorrowerId'
          example: bor_a1d0c30d77104f35b4c842b99132624e
          examples:
            Example1:
              value: bor_a1d0c30d77104f35b4c842b99132624e
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumerBorrowerResponse'
              examples:
                Example1:
                  value:
                    address:
                      line_1: 15 Main Street
                      line_2: null
                      city: Austin
                      state: TX
                      zip: '73301'
                    id: bor_a1d0c30d77104f35b4c842b99132624e
                    date_of_birth: '1991-12-18'
                    email: jdough@acme.co
                    first_name: Jane
                    last_name: Dough
                    kyc_completion_date: '2022-11-15'
                    created_on: '2022-12-31T00:58:47.828Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve a borrower by id
      security: *ref_0
  /borrowers:
    get:
      description: Retrieve all borrowers associated with your account
      operationId: borrowers_listAllBorrowers
      tags:
        - Borrowers
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Borrower'
              examples:
                Example1:
                  value:
                    - type: business
                      address:
                        line_1: 15 Market St
                        line_2: null
                        city: San Francisco
                        state: NJ
                        zip: '94133'
                      business_contact:
                        first_name: alex
                        last_name: montana
                        phone: '4155555555'
                        email: alex@acme.co
                        title: COO
                      beneficial_owners:
                        - address:
                            line_1: 15 Market St
                            line_2: null
                            city: San Francisco
                            state: CA
                            zip: '91133'
                          date_of_birth: '1991-12-18'
                          email: jdoe@acme.com
                          first_name: Jane
                          last_name: Dough
                          percent_ownership: 2500
                          phone: '4155555555'
                          government_identifiers:
                            ssn: '123456789'
                          id: 63ae91f8eae458cb0d79f77e
                      id: bor_18e5a3726b3943cda2635f40e1041ba4
                      business_name: Apple Landscaping
                      business_type: corporation
                      dba_name: Apple Landscaping
                      ein: '130256721'
                      incorporation_date: '2000-12-12'
                      kyb_completion_date: '2022-11-15'
                      phone: '4152556465'
                      state_of_incorporation: DE
                      created_on: '2022-12-30T07:23:36.665Z'
                    - type: consumer
                      address:
                        line_1: 15 Main Street
                        line_2: Unit 204
                        city: Austin
                        state: TX
                        zip: '73301'
                      date_of_birth: '1991-12-18'
                      email: jdough@acme.co
                      first_name: Jane
                      last_name: Dough
                      government_identifiers:
                        ssn: '999888777'
                      kyc_completion_date: '2022-11-15'
                      id: bor_a1d0c30d77104f35b4c842b99132624e
                      created_on: '2022-12-30T07:23:36.665Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all borrowers
      security: *ref_0
  /configuration/webhook:
    post:
      description: Set the array of urls to receive webhook events from Pier.
      operationId: configuration_set_webhook_urls
      tags:
        - Configuration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookUrls'
              examples:
                Example1:
                  value:
                    urls:
                      - https://example.com/webhook1
                      - https://example.com/webhook2
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Set webhook URLs
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                urls:
                  type: array
                  items:
                    type: string
                  description: The array of `urls` to send webhooks to
                  example:
                    - https://example.com/webhook1
                    - https://example.com/webhook2
              required:
                - urls
            examples:
              Example1:
                value:
                  urls:
                    - https://example.com/webhook1
                    - https://example.com/webhook2
    delete:
      description: Reset the array of `urls` that receives Pier webhooks.
      operationId: configuration_delete_webhook_urls
      tags:
        - Configuration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteWebhookResponse'
              examples:
                Example1:
                  value:
                    urls: []
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Reset webhook URLs
      security: *ref_0
    get:
      description: Get the array of `urls` that receives Pier webhooks.
      operationId: configuration_get_webhook_urls
      tags:
        - Configuration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookUrls'
              examples:
                Example1:
                  value:
                    urls:
                      - https://example.com/webhook1
                      - https://example.com/webhook2
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get webhook URLs
      security: *ref_0
  /configuration/webhook-verification:
    get:
      description: The Pier public key to use to verify webhook signatures.
      operationId: configuration_webhook_verification
      tags:
        - Configuration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerificationResponse'
              examples:
                Example1:
                  value:
                    public_key: |-
                      -----BEGIN PUBLIC KEY-----
                      MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ
                      jkdfhdfjskfhsd==
                      -----END PUBLIC KEY-----
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Verify a webhook with Pier public key
      security: *ref_0
  /configuration/lending_details:
    post:
      description: Only valid in Starter Mode
      operationId: configuration_set_lending_details
      tags:
        - Configuration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LendingDetails'
              examples:
                Example1:
                  value:
                    address:
                      line_1: 123 Main St
                      line_2: Suite 100
                      city: San Francisco
                      state: CA
                      zip: '94105'
                    cs_phone: 415-555-5555
                    cs_email: support@example.com
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Set lending details
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LendingDetails'
            examples:
              Example1:
                value:
                  address:
                    line_1: 123 Main St
                    line_2: Suite 100
                    city: San Francisco
                    state: CA
                    zip: '94105'
                  cs_phone: 415-555-5555
                  cs_email: support@example.com
    delete:
      description: Only valid when lending through Pier.
      operationId: configuration_delete_lending_details
      tags:
        - Configuration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Remove lending details
      security: *ref_0
  /coverage/commercial:
    get:
      description: >-
        Retrieve state-by-state consumer coverage list. The state-by-state
        consumer coverage list reflects your state coverage and compliant loan
        thresholds based on your use case. We configure this based on your
        licensing and compliance setup, upon our review to ensure you're
        compliant with state and federal requirements.
      operationId: coverage_retrieveCommercialCoverage
      tags:
        - Coverage
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/CommercialCoverage'
              examples:
                Example1:
                  value:
                    AL:
                      limit_1:
                        amount:
                          min: 500000
                          max: 25000000
                      max_apr: 9999
                      business_types:
                        - corporation
                        - partnership
                        - llc
                        - sole_proprietorship
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve commercial lending coverage
      security: *ref_0
  /coverage/consumer:
    get:
      description: >-
        Retrieve state-by-state consumer coverage list. The state-by-state
        consumer coverage list reflects your state coverage and compliant loan
        thresholds based on your use case. We configure this based on your
        licensing and compliance setup, upon our review to ensure you're
        compliant with state and federal requirements.
      operationId: coverage_retrieveConsumerCoverage
      tags:
        - Coverage
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/ConsumerCoverage'
              examples:
                Example1:
                  value:
                    AL:
                      amount_threshold:
                        min: 5000
                        max: 5000000
                      apr_threshold:
                        type: tiered
                        max: []
                      origination_fee_threshold:
                        max: 500
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve consumer lending coverage
      security: *ref_0
  /rejection_reasons:
    get:
      description: >-
        Retrieve a list of valid reasons to reject an applicant, along with
        descriptions for each reason
      operationId: coverage_retrieveRejectionReasons
      tags:
        - Coverage
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveRejectionReasonsResponse'
              examples:
                Example1:
                  value:
                    income_too_low: |
                      Income does not meet requirement
                    bank_balance_too_low: |
                      Bank account balance is too low
                    income_unpredictable: |
                      Unable to predict regular pattern of income deposits
                    user_account_duplicate: >
                      Duplicate account (previously applied for a loan with a
                      different email address)
                    sdb_check_failed: |
                      State database lending restriction
                    bank_account_linking_error: |
                      Unable to link to a supported banking institution
                    mla_failed: >
                      Under the Military Lending Act, loans to military
                      personnel or their spouses and dependents cannot be made
                      if the interest and expenses associated with the loan
                      exceed an annual percentage rate (APR) of 36%. Due to
                      these limits on military-related lending, we can't lend to
                      members of the military or their spouses and dependents.
                      Please feel free to contact us with any questions you may
                      have about this notice!
                    iddoc_failed: |
                      Unable to verify identification documents
                    no_checking_or_savings_data: >
                      No data from supported financial institution. Unsupported
                      financial institution is linked
                    insufficient_bank_history: |
                      Unable to pull enough bank history
                    loan_location_no_license: >
                      Unable to verify that your permanent residence is in a
                      state
                    address_invalid: |
                      Unable to verify mailing address
                    income_verification_failed: |
                      Unable to verify qualified income over a sustained period
                    stacking_behavior: >
                      Recent deposits and withdrawals detected from other
                      lenders
                    ssn_verification_failed: |
                      Unable to verify SSN number
                    too_many_nsfs: >
                      Multiple Returned checks or Insufficient Fund Fees
                      detected
                    fraud_risk_too_high: |
                      Bank account has been flagged as potential fraud risk
                    has_bankruptcy_history: |
                      History of bankruptcy
                    unable_to_verify_credit_information: |
                      Unable to verify credit information
                    credit_file_frozen: |
                      Credit file is currently frozen
                    processor_suspended: |
                      Payment processor is unable to authenticate user
                    cash_flow_verification_failed: >
                      Cash flow analysis - income funds are quickly depleted
                      from bank account after income deposit
                    credit_score_too_low: |
                      Your credit score does not meet our requirement
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve rejection reasons
      security: *ref_0
  /coverage/check_offers:
    post:
      description: >-
        Check a set of offers against our limits for a given state. Customers
        can pass us a list of offers, which we will run through our compliance
        limits. We will return a boolean for each offer indicating whether the
        offer passes our limits or not. If the user does not specify an ID for
        each offer, we will reindex them from 0.
      operationId: coverage_checkOffers
      tags:
        - Coverage
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckOffersResponse'
              examples:
                Example1:
                  value:
                    '26':
                      is_compliant: true
                      apr: 955
                    '27':
                      is_compliant: true
                      apr: 200
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Check offers
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                state:
                  type: string
                  description: The state the borrower is in (2 chars)
                  example: AK
                offers:
                  type: array
                  items:
                    $ref: '#/components/schemas/CheckOffer'
                  description: >-
                    A list of CheckOffer objects, each uniquely identified by an
                    id.
              required:
                - state
                - offers
            examples:
              Example1:
                value:
                  state: AK
                  offers:
                    - id: 26
                      type: loan_offer
                      amount: 300000
                      interest_rate: 750
                      loan_term:
                        term_type: months
                        term: 12
                      origination_fee: 150
                      first_payment_date: '2024-04-15'
                      payment_period: monthly
                    - id: 27
                      type: revolving_line_of_credit_offer
                      amount: 100000
                      loan_term:
                        term_type: months
                        term: 12
                      interest_rate: 200
                      origination_fee: 0
  /facilities:
    post:
      description: >-
        A facility can be created for a given loan agreement with a status of
        `signed`
      operationId: facilities_create
      tags:
        - Facilities
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    status: active
                    created_on: '2023-05-12T19:46:09.293Z'
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    amortization_schedule:
                      - payment_date: '2023-11-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 91667
                        item_index: 1
                      - payment_date: '2023-12-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 83334
                        item_index: 2
                    repayment_bank_details:
                      bank_account_number: '98989898'
                      bank_routing_number: '021000021'
                      type: checking
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: false
                    documents:
                      unsigned_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_credit_agreement.pdf
                        document_id: doc_1234567890abcdef
                      signed_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_credit_agreement.pdf
                        document_id: doc_abcdef1234567890
                      unsigned_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_ach_authorization.pdf
                        document_id: doc_fedcba9876543210
                      unsigned_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                      signed_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_ach_authorization.pdf
                        document_id: doc_fedcba0987654321
                      signed_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create a facility
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                loan_agreement_id:
                  $ref: '#/components/schemas/LoanAgreementId'
                  description: >-
                    The `loan_agreement_id` of the loan agreement to create a
                    facility for
              required:
                - loan_agreement_id
            examples:
              Example1:
                value:
                  loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
    get:
      description: List all facilities on your account
      operationId: facilities_listAll
      tags:
        - Facilities
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    - terms:
                        type: loan_offer
                        id: off_86c05092a4384d89b03ef514ea4fee31
                        amount: 1000000
                        grace_period:
                          term: 0
                          interest_rate: 0
                        introductory_promo_period:
                          interest_rate: 0
                          promo_term:
                            term: 90
                            term_type: daily
                        interest_rate: 0
                        origination_fee:
                          type: deducted
                          fee: 0
                        payment_period: monthly
                        late_payment_fee: 0
                        first_payment_date: '2022-12-31'
                        loan_term:
                          term_type: months
                          term: 36
                      id: fac_18e5a3726b3943cda2635f40e1041ba4
                      application_id: app_f0467657bba948e6a87292e182132848
                      borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                      loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                      credit_type: consumer_installment_loan
                      status: active
                      created_on: '2023-05-12T19:46:09.293Z'
                      account_number: '401542198'
                      balance: 500000
                      balances:
                        current_balance: 500000
                        principal_balance: 500000
                        interest_balance: 0
                        payoff_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                      origination_date: '2023-05-12'
                      disbursement_date: '2023-05-12'
                      remaining_term: 48
                      payments_due:
                        - payment_amount: 123456
                          payment_amount_remaining: 123456
                          payment_due_date: '2023-06-12'
                      amortization_schedule:
                        - payment_date: '2023-11-02'
                          interest_payment_amount: 0
                          principal_payment_amount: 8333
                          other_payment_amount: 0
                          total_payment_amount: 8333
                          balance_amount: 91667
                          item_index: 1
                        - payment_date: '2023-12-02'
                          interest_payment_amount: 0
                          principal_payment_amount: 8333
                          other_payment_amount: 0
                          total_payment_amount: 8333
                          balance_amount: 83334
                          item_index: 2
                      repayment_bank_details:
                        bank_account_number: '98989898'
                        bank_routing_number: '021000021'
                        type: checking
                      transactions:
                        - amount: 100000
                          net_amount: 100000
                          transaction_date: '2023-05-12'
                          effective_date: '2023-05-12'
                          description: Disbursement
                          transaction_type: DEBIT
                          category: DISBURSEMENT
                          transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        - amount: 500000
                          net_amount: -500000
                          transaction_date: '2024-06-02'
                          effective_date: '2024-06-02'
                          description: Principal Reduction
                          transaction_type: CREDIT
                          category: PRINCIPAL_REDUCTION
                          transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      statements:
                        - id: stmt_deb6aba913d84feb987934f50c32bf03
                          statement_date: '2023-03-17'
                          facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                          url: >-
                            https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                          created_on: '2023-02-27T00:00:00Z'
                          statement_start_date: '2024-06-17T00:00:00.000Z'
                          balance_due: 500000
                          current_principal_balance: 500000
                          current_interest_balance: 10000
                          interest_charged: 0
                          due_date: '2023-03-17'
                          transactions:
                            - amount: 100000
                              net_amount: 100000
                              transaction_date: '2023-05-12'
                              effective_date: '2023-05-12'
                              description: Disbursement
                              transaction_type: DEBIT
                              category: DISBURSEMENT
                              transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                            - amount: 500000
                              net_amount: -500000
                              transaction_date: '2024-06-02'
                              effective_date: '2024-06-02'
                              description: Principal Reduction
                              transaction_type: CREDIT
                              category: PRINCIPAL_REDUCTION
                              transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          payments:
                            - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                              amount: 100000
                              facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                              status: settled
                              transfer_type: standard
                              created_on: '2023-02-27T00:00:00Z'
                              is_autopay: false
                          disbursements:
                            - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                              facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                              amount: 100000
                              status: pending
                              failure_reason: null
                              date: '2023-02-27'
                              created_on: '2023-02-27T00:00:00Z'
                              transfer_type: standard
                      next_payment_amount: 124425
                      next_payment_due_date: '2023-06-12'
                      current_payment_due_date: '2023-06-12'
                      last_payment_date: null
                      principal_paid_thru: '2023-05-11'
                      next_billing_date: '2023-05-28'
                      interest_accrued_thru: '2023-05-11'
                      next_accrual_cutoff_date: '2023-06-11'
                      scheduled_payoff_date: '2027-05-12'
                      autopay:
                        authorized: false
                      documents:
                        unsigned_credit_agreement:
                          document_url: >-
                            https://storage.googleapis.com/example/unsigned_credit_agreement.pdf
                          document_id: doc_1234567890abcdef
                        signed_credit_agreement:
                          document_url: >-
                            https://storage.googleapis.com/example/signed_credit_agreement.pdf
                          document_id: doc_abcdef1234567890
                        unsigned_ach_authorization:
                          document_url: >-
                            https://storage.googleapis.com/example/unsigned_ach_authorization.pdf
                          document_id: doc_fedcba9876543210
                        unsigned_autopay_ach_authorization:
                          document_url: >-
                            https://storage.googleapis.com/example/unsigned_autopay_ach_authorization.pdf
                          document_id: doc_0123456789abcdef
                        signed_ach_authorization:
                          document_url: >-
                            https://storage.googleapis.com/example/signed_ach_authorization.pdf
                          document_id: doc_fedcba0987654321
                        signed_autopay_ach_authorization:
                          document_url: >-
                            https://storage.googleapis.com/example/signed_autopay_ach_authorization.pdf
                          document_id: doc_0123456789abcdef
                      remaining_statement_balance: 7500
                      remaining_minimum_balance: 7500
                      last_statement_info:
                        last_statement_date: '2024-06-01T00:00:00.000Z'
                        last_statement_amount: 47000
                      in_grace_period: false
                      in_introductory_promo_period: false
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all facilities
      security: *ref_0
  /facilities/{facility_id}/disbursements:
    post:
      description: >-
        Create a disbursement for a facility. If disbursements_ach_enabled is
        false, use none for transfer_type.
      operationId: facilities_disburse
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
            Example2:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disbursement'
              examples:
                Example1:
                  value:
                    id: dsb_18e5a3726b3943cda2635f40e1041ba4
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    status: pending
                    failure_reason: null
                    date: '2023-02-27'
                    created_on: '2023-02-27T00:00:00Z'
                    transfer_type: standard
                Example2:
                  value:
                    id: dsb_18e5a3726b3943cda2635f40e1041ba4
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    status: pending
                    failure_reason: null
                    date: '2023-02-27'
                    created_on: '2023-02-27T00:00:00Z'
                    transfer_type: none
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create a disbursement for a facility
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DisbursementRequest'
            examples:
              Example1:
                value:
                  amount: 100000
                  disbursement_bank_account:
                    bank_account_number: '98989898'
                    bank_routing_number: '021000021'
                    type: checking
                  transfer_type: standard
                  settlement_priority: same_day
              Example2:
                value:
                  amount: 100000
                  transfer_type: none
    get:
      description: List disbursements for a facility
      operationId: facilities_listDisbursementsForFacility
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          description: The facility_id of the facility you want to list disbursements for
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Disbursement'
              examples:
                Example1:
                  value:
                    - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      amount: 100000
                      status: pending
                      failure_reason: null
                      date: '2023-02-27'
                      created_on: '2023-02-27T00:00:00Z'
                      transfer_type: standard
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List disbursements for a facility
      security: *ref_0
  /facilities/{facility_id}/disbursements/{disbursement_id}/test/initiate:
    patch:
      description: Move disbursement to initiated state (*sandbox only*)
      operationId: facilities_disbursementTestInitiate
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
        - name: disbursement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/DisbursementId'
          example: dsb_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: dsb_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Move disbursement to initiated state
      security: *ref_0
  /facilities/{facility_id}/disbursements/{disbursement_id}/test/success:
    patch:
      description: Move disbursement to successful state (*sandbox only*)
      operationId: facilities_disbursementTestSuccess
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
        - name: disbursement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/DisbursementId'
          example: dsb_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: dsb_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Move disbursement to successful state
      security: *ref_0
  /facilities/{facility_id}/disbursements/{disbursement_id}/test/failed:
    patch:
      description: Move disbursement to failed state (*sandbox only*)
      operationId: facilities_disbursementTestFailed
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
        - name: disbursement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/DisbursementId'
          example: dsb_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: dsb_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Move disbursement to failed state
      security: *ref_0
  /facilities/{facility_id}/create_limit_reduction_notice:
    post:
      description: >-
        Create a limit reduction notice, which should be presented to the user
        when their credit limit is reduced. This endpoint must be called before
        reducing the credit limit. The document_id returned should be stored and
        used in the PATCH /facilities/{facility_id}/update_limit endpoint.
      operationId: facilities_createLimitReductionNotice
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
              examples:
                Example1:
                  value:
                    document_url: https://example.com/document.pdf
                    id: doc_1234567890abcdef
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create a limit reduction notice
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                new_limit_amount:
                  type: integer
                  description: Amount of the new credit limit, in cents
                  example: 100000
                reasons:
                  type: array
                  items:
                    $ref: '#/components/schemas/LimitReductionReasons'
                  description: The reasons for the limit reduction
              required:
                - new_limit_amount
                - reasons
            examples:
              Example1:
                value:
                  new_limit_amount: 100000
                  reasons:
                    - fraud_prevention
  /facilities/{facility_id}/update_limit:
    patch:
      description: >-
        Update credit limit for a line of credit. For reductions, pass in the
        document_id from the create_limit_reduction_notice endpoint. For
        increases, pass in the new credit limit amount.
      operationId: facilities_updateCreditLimit
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    status: active
                    created_on: '2023-05-12T19:46:09.293Z'
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    amortization_schedule:
                      - payment_date: '2023-11-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 91667
                        item_index: 1
                      - payment_date: '2023-12-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 83334
                        item_index: 2
                    repayment_bank_details:
                      bank_account_number: '98989898'
                      bank_routing_number: '021000021'
                      type: checking
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: false
                    documents:
                      unsigned_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_credit_agreement.pdf
                        document_id: doc_1234567890abcdef
                      signed_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_credit_agreement.pdf
                        document_id: doc_abcdef1234567890
                      unsigned_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_ach_authorization.pdf
                        document_id: doc_fedcba9876543210
                      unsigned_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                      signed_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_ach_authorization.pdf
                        document_id: doc_fedcba0987654321
                      signed_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Update credit limit for a line of credit
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                new_limit_amount:
                  type: integer
                  nullable: true
                  description: The new credit limit amount, in cents
                document_id:
                  type: string
                  nullable: true
                  description: >-
                    The document_id from the `create_limit_reduction_notice`
                    endpoint
            examples:
              Example1:
                value:
                  new_limit_amount: 100000
  /facilities/{facility_id}/payments:
    get:
      description: List payments for a facility
      operationId: facilities_listPayments
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: facility_id
          examples:
            Example1:
              value: facility_id
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Payment'
              examples:
                Example1:
                  value:
                    - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                      amount: 100000
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      status: pending
                      transfer_type: standard
                      created_on: '2023-02-27T00:00:00Z'
                      is_autopay: false
                    - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                      amount: 100000
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      status: processing
                      transfer_type: standard
                      created_on: '2023-02-27T00:00:00Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all payments for a facility
      security: *ref_0
  /facilities/{facility_id}/credit:
    post:
      description: Credit a facility
      operationId: facilities_credit
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundedPayment'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Credit a facility
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  description: >-
                    The amount to credit the facility, in cents (e.g. 1000 =
                    $10.00)
                memo:
                  type: string
                  nullable: true
                  description: A memo to attach to the credit
                original_disbursement_id:
                  $ref: '#/components/schemas/DisbursementId'
                  nullable: true
                  description: >-
                    Disbursement ID associated with the credit action (if
                    applicable)
                original_payment_id:
                  $ref: '#/components/schemas/PaymentId'
                  nullable: true
                  description: Payment ID associated with the credit action (if applicable)
              required:
                - amount
  /facilities/{facility_id}/disbursements/{disbursement_id}/cancel:
    post:
      description: >-
        Cancels a submitted disbursement before it is sent to the ACH network.
        Disbursements can only be canceled if they are still in the `pending`
        state and have not been submitted to the ACH network. After a
        disbursement is sent to the ACH network, you must wait for the it to
        settle and then you may refund it instead.


        In some cases if you cancel while the disbursement is in the process of
        being submitted to the ACH network you may see a status of
        `cancellation_pending` in the response. In this case, you can check the
        status of the disbursement or wait for a subsequent webhook to see if it
        was successfully canceled or processed.
      operationId: facilities_cancelDisbursement
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
            Example2:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
        - name: disbursement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/DisbursementId'
          example: dsb_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: dsb_18e5a3726b3943cda2635f40e1041ba4
            Example2:
              value: dsb_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disbursement'
              examples:
                Example1:
                  value:
                    id: dsb_18e5a3726b3943cda2635f40e1041ba4
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    status: canceled
                    failure_reason: null
                    date: '2023-02-27'
                    created_on: '2023-02-27T00:00:00Z'
                    transfer_type: none
                Example2:
                  value:
                    id: dsb_18e5a3726b3943cda2635f40e1041ba4
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    status: cancellation_pending
                    failure_reason: null
                    date: '2023-02-27'
                    created_on: '2023-02-27T00:00:00Z'
                    transfer_type: none
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Cancel a disbursement
      security: *ref_0
  /facilities/{facility_id}/disbursements/{disbursement_id}/refund:
    post:
      description: >-
        Refunds a specified disbursement in full. This endpoint is intended for
        correcting erroneous transactions.
      operationId: facilities_refundDisbursement
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
        - name: disbursement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/DisbursementId'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundedDisbursement'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Refund a disbursement
      security: *ref_0
  /facilities/{facility_id}/close:
    post:
      description: Closes an active facility by setting its status to `closed`
      operationId: facilities_close
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    created_on: '2023-01-17T04:59:21.773Z'
                    status: closed
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due: []
                    amortization_schedule: []
                    repayment_bank_details:
                      bank_account_number: '98989898'
                      bank_routing_number: '021000021'
                      type: checking
                    transactions: []
                    statements: []
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: false
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Close a facility
      security: *ref_0
  /facilities/{facility_id}/create_ach_authorization:
    post:
      description: >-
        Creates an unsigned ACH authorization document for a specified facility.
        This is a required step before submitting a payment if repayment ACH is
        enabled. The user must agree to ACH withdrawals before Pier can initiate
        payments. This document is automatically signed by the user when you
        call POST /payments. You must create a new ACH authorization document
        for each payment.
      operationId: facilities_createACHAuthorization
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
              examples:
                Example1:
                  value:
                    document_url: https://example.com/document.pdf
                    id: doc_1234567890abcdef
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create ACH Authorization
      security: *ref_0
  /facilities/{facility_id}/create_autopay_authorization:
    post:
      description: >-
        Creates an unsigned autopay ACH authorization document for a specified
        facility. This is a required step before enabling autopay. The user must
        agree to automatic ACH withdrawals before Pier can initiate payments.
        This document is automatically signed by the user when you call POST
        /enable_autopay.
      operationId: facilities_createAutopayAuthorization
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      amount: 100000
                      apr: 200
                      annual_fee: 0
                      type: revolving_line_of_credit_offer
                      interest_rate: 200
                      late_payment_fee: 0
                      id: off_2e60b8c4fb7e4a10835e5a7e0641a5d8
                      minimum_payment:
                        type: interest_plus_percentage_of_principal
                        value: 250
                        floor: 1500
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_25fbcb8b8bd2417fab99b184678d2437
                    borrower_id: bor_39addd1e5d7241cfa758e12388cd2fd4
                    loan_agreement_id: doc_aac8a211dd9f49229dae022c5ecddccd
                    account_number: '652633487'
                    credit_type: consumer_revolving_line_of_credit
                    status: active
                    autopay:
                      authorized: false
                    balance: 0
                    balances:
                      current_balance: 0
                      principal_balance: 0
                      interest_balance: 0
                      payoff_balance: 0
                    origination_date: '2024-04-19'
                    remaining_statement_balance: 7500
                    documents:
                      unsigned_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/download/storage/v1/b/pier_loan_docs/o/test%2Fdoc_db4efb43d1c0435ba5d730927d156fa6_unsigned.pdf?generation=1714045339730396&alt=media
                        document_id: doc_db4efb43d1c0435ba5d730927d156fa6
                    created_on: '2024-04-25T11:38:54.520Z'
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    remaining_minimum_balance: 7500
                    in_grace_period: true
                    in_introductory_promo_period: true
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create autopay ACH authorization
      security: *ref_0
  /facilities/{facility_id}/enable_autopay:
    post:
      description: Enables autopay for a facility
      operationId: facilities_enable_autopay
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    status: active
                    created_on: '2023-05-12T19:46:09.293Z'
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    amortization_schedule:
                      - payment_date: '2023-11-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 91667
                        item_index: 1
                      - payment_date: '2023-12-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 83334
                        item_index: 2
                    repayment_bank_details: null
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: true
                      authorization_timestamp: '2021-01-01T00:00:00Z'
                      bank_account:
                        bank_account_number: '98989898'
                        bank_routing_number: '021000021'
                        type: checking
                      amount_type: minimum_payment
                      additional_amount: 1000
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Enable autopay for a facility
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bank_account:
                  $ref: '#/components/schemas/BankAccount'
                  description: The bank account details to use for scheduled payments
                amount_type:
                  $ref: '#/components/schemas/AutopayAmountType'
                  description: >-
                    The type of autopay amount, either minimum_payment or
                    statement_balance
                additional_amount:
                  type: integer
                  nullable: true
                  description: >-
                    The additional amount to pay on top of the minimum payment,
                    in cents (e.g. 1000 = $10.00)
              required:
                - bank_account
                - amount_type
            examples:
              Example1:
                value:
                  bank_account:
                    bank_account_number: '98989898'
                    bank_routing_number: '021000021'
                    type: checking
                  additional_amount: 0
                  amount_type: statement_balance
  /facilities/{facility_id}/disable_autopay:
    post:
      description: Disable autopay for a facility
      operationId: facilities_disable_autopay
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    status: active
                    created_on: '2023-05-12T19:46:09.293Z'
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    amortization_schedule:
                      - payment_date: '2023-11-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 91667
                        item_index: 1
                      - payment_date: '2023-12-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 83334
                        item_index: 2
                    repayment_bank_details:
                      bank_account_number: '98989898'
                      bank_routing_number: '021000021'
                      type: checking
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: false
                    documents:
                      unsigned_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_credit_agreement.pdf
                        document_id: doc_1234567890abcdef
                      signed_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_credit_agreement.pdf
                        document_id: doc_abcdef1234567890
                      unsigned_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_ach_authorization.pdf
                        document_id: doc_fedcba9876543210
                      unsigned_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                      signed_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_ach_authorization.pdf
                        document_id: doc_fedcba0987654321
                      signed_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Disable autopay for a facility
      security: *ref_0
  /facilities/{facility_id}/repayment_bank_details:
    post:
      description: Add repayment bank details for a facility
      operationId: facilities_addRepaymentBankDetails
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    status: active
                    created_on: '2023-05-12T19:46:09.293Z'
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    amortization_schedule:
                      - payment_date: '2023-11-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 91667
                        item_index: 1
                      - payment_date: '2023-12-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 83334
                        item_index: 2
                    repayment_bank_details:
                      bank_account_number: '98989898'
                      bank_routing_number: '021000021'
                      type: checking
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: false
                    documents:
                      unsigned_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_credit_agreement.pdf
                        document_id: doc_1234567890abcdef
                      signed_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_credit_agreement.pdf
                        document_id: doc_abcdef1234567890
                      unsigned_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_ach_authorization.pdf
                        document_id: doc_fedcba9876543210
                      unsigned_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                      signed_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_ach_authorization.pdf
                        document_id: doc_fedcba0987654321
                      signed_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Add repayment bank details for a facility
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccount'
            examples:
              Example1:
                value:
                  bank_account_number: '98989898'
                  bank_routing_number: '021000021'
                  type: checking
  /facilities/{facility_id}:
    get:
      description: Retrieve a facility by its id
      operationId: facilities_get
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          description: The facility_id of the facility you want to retrieve
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facility'
              examples:
                Example1:
                  value:
                    terms:
                      type: loan_offer
                      id: off_86c05092a4384d89b03ef514ea4fee31
                      amount: 1000000
                      grace_period:
                        term: 0
                        interest_rate: 0
                      introductory_promo_period:
                        interest_rate: 0
                        promo_term:
                          term: 90
                          term_type: daily
                      interest_rate: 0
                      origination_fee:
                        type: deducted
                        fee: 0
                      payment_period: monthly
                      late_payment_fee: 0
                      first_payment_date: '2022-12-31'
                      loan_term:
                        term_type: months
                        term: 36
                    id: fac_18e5a3726b3943cda2635f40e1041ba4
                    application_id: app_f0467657bba948e6a87292e182132848
                    borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                    loan_agreement_id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    credit_type: consumer_installment_loan
                    status: active
                    created_on: '2023-05-12T19:46:09.293Z'
                    account_number: '401542198'
                    balance: 500000
                    balances:
                      current_balance: 500000
                      principal_balance: 500000
                      interest_balance: 0
                      payoff_balance: 500000
                    interest_balance: 0
                    payoff_balance: 500000
                    origination_date: '2023-05-12'
                    disbursement_date: '2023-05-12'
                    remaining_term: 48
                    payments_due:
                      - payment_amount: 123456
                        payment_amount_remaining: 123456
                        payment_due_date: '2023-06-12'
                    amortization_schedule:
                      - payment_date: '2023-11-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 91667
                        item_index: 1
                      - payment_date: '2023-12-02'
                        interest_payment_amount: 0
                        principal_payment_amount: 8333
                        other_payment_amount: 0
                        total_payment_amount: 8333
                        balance_amount: 83334
                        item_index: 2
                    repayment_bank_details:
                      bank_account_number: '98989898'
                      bank_routing_number: '021000021'
                      type: checking
                    transactions:
                      - amount: 100000
                        net_amount: 100000
                        transaction_date: '2023-05-12'
                        effective_date: '2023-05-12'
                        description: Disbursement
                        transaction_type: DEBIT
                        category: DISBURSEMENT
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      - amount: 500000
                        net_amount: -500000
                        transaction_date: '2024-06-02'
                        effective_date: '2024-06-02'
                        description: Principal Reduction
                        transaction_type: CREDIT
                        category: PRINCIPAL_REDUCTION
                        transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    statements:
                      - id: stmt_deb6aba913d84feb987934f50c32bf03
                        statement_date: '2023-03-17'
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        url: >-
                          https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                        created_on: '2023-02-27T00:00:00Z'
                        statement_start_date: '2024-06-17T00:00:00.000Z'
                        balance_due: 500000
                        current_principal_balance: 500000
                        current_interest_balance: 10000
                        interest_charged: 0
                        due_date: '2023-03-17'
                        transactions:
                          - amount: 100000
                            net_amount: 100000
                            transaction_date: '2023-05-12'
                            effective_date: '2023-05-12'
                            description: Disbursement
                            transaction_type: DEBIT
                            category: DISBURSEMENT
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                          - amount: 500000
                            net_amount: -500000
                            transaction_date: '2024-06-02'
                            effective_date: '2024-06-02'
                            description: Principal Reduction
                            transaction_type: CREDIT
                            category: PRINCIPAL_REDUCTION
                            transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        payments:
                          - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            status: settled
                            transfer_type: standard
                            created_on: '2023-02-27T00:00:00Z'
                            is_autopay: false
                        disbursements:
                          - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                            facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                            amount: 100000
                            status: pending
                            failure_reason: null
                            date: '2023-02-27'
                            created_on: '2023-02-27T00:00:00Z'
                            transfer_type: standard
                    next_payment_amount: 124425
                    next_payment_due_date: '2023-06-12'
                    current_payment_due_date: '2023-06-12'
                    last_payment_date: null
                    principal_paid_thru: '2023-05-11'
                    next_billing_date: '2023-05-28'
                    interest_accrued_thru: '2023-05-11'
                    next_accrual_cutoff_date: '2023-06-11'
                    scheduled_payoff_date: '2027-05-12'
                    autopay:
                      authorized: false
                    documents:
                      unsigned_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_credit_agreement.pdf
                        document_id: doc_1234567890abcdef
                      signed_credit_agreement:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_credit_agreement.pdf
                        document_id: doc_abcdef1234567890
                      unsigned_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_ach_authorization.pdf
                        document_id: doc_fedcba9876543210
                      unsigned_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/unsigned_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                      signed_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_ach_authorization.pdf
                        document_id: doc_fedcba0987654321
                      signed_autopay_ach_authorization:
                        document_url: >-
                          https://storage.googleapis.com/example/signed_autopay_ach_authorization.pdf
                        document_id: doc_0123456789abcdef
                    remaining_statement_balance: 7500
                    remaining_minimum_balance: 7500
                    last_statement_info:
                      last_statement_date: '2024-06-01T00:00:00.000Z'
                      last_statement_amount: 47000
                    in_grace_period: false
                    in_introductory_promo_period: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve a facility
      security: *ref_0
  /facilities/disbursements:
    get:
      description: List disbursements for your account
      operationId: facilities_listDisbursements
      tags:
        - Facilities
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Disbursement'
              examples:
                Example1:
                  value:
                    - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      amount: 100000
                      status: pending
                      failure_reason: null
                      date: '2023-02-27'
                      created_on: '2023-02-27T00:00:00Z'
                      transfer_type: standard
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all disbursements for your account
      security: *ref_0
  /facilities/{facility_id}/statements:
    get:
      description: List statements for a facility
      operationId: facilities_listStatementsForFacility
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          description: The facility_id of the facility you want to list statements for
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Statement'
              examples:
                Example1:
                  value:
                    - id: stmt_deb6aba913d84feb987934f50c32bf03
                      statement_date: '2023-03-17'
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      url: >-
                        https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
                      created_on: '2023-02-27T00:00:00Z'
                      statement_start_date: '2024-06-17T00:00:00.000Z'
                      balance_due: 500000
                      current_principal_balance: 500000
                      current_interest_balance: 10000
                      interest_charged: 0
                      due_date: '2023-03-17'
                      transactions:
                        - amount: 100000
                          net_amount: 100000
                          transaction_date: '2023-05-12'
                          effective_date: '2023-05-12'
                          description: Disbursement
                          transaction_type: DEBIT
                          category: DISBURSEMENT
                          transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        - amount: 500000
                          net_amount: -500000
                          transaction_date: '2024-06-02'
                          effective_date: '2024-06-02'
                          description: Principal Reduction
                          transaction_type: CREDIT
                          category: PRINCIPAL_REDUCTION
                          transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                      payments:
                        - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                          amount: 100000
                          facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                          status: settled
                          transfer_type: standard
                          created_on: '2023-02-27T00:00:00Z'
                          is_autopay: false
                      disbursements:
                        - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                          facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                          amount: 100000
                          status: pending
                          failure_reason: null
                          date: '2023-02-27'
                          created_on: '2023-02-27T00:00:00Z'
                          transfer_type: standard
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List statements for a facility
      security: *ref_0
  /facilities/{facility_id}/disbursements/{disbursement_id}:
    get:
      description: Retrieve a disbursement by its id
      operationId: facilities_getDisbursementById
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          description: The facility_id of the facility you want to retrieve
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
        - name: disbursement_id
          in: path
          description: The disbursement_id of the disbursement you want to retrieve
          required: true
          schema:
            $ref: '#/components/schemas/DisbursementId'
          example: dsb_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: dsb_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disbursement'
              examples:
                Example1:
                  value:
                    id: dsb_18e5a3726b3943cda2635f40e1041ba4
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    status: pending
                    failure_reason: null
                    date: '2023-02-27'
                    created_on: '2023-02-27T00:00:00Z'
                    transfer_type: standard
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve a disbursement by its id
      security: *ref_0
  /facilities/{facility_id}/payoff_amounts:
    get:
      description: >-
        Retrieve a list of payoff amount/date pairs for a facility for the next
        10 days
      operationId: facilities_getPayoffAmounts
      tags:
        - Facilities
      parameters:
        - name: facility_id
          in: path
          description: >-
            The facility_id of the facility you want to retrieve payoff amounts
            for
          required: true
          schema:
            $ref: '#/components/schemas/FacilityId'
          example: fac_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: fac_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoffAmounts'
              examples:
                Example1:
                  value:
                    - amount: 504889
                      date: '2023-12-08'
                    - amount: 505112
                      date: '2023-12-09'
                    - amount: 505334
                      date: '2023-12-10'
                    - amount: 505556
                      date: '2023-12-11'
                    - amount: 505778
                      date: '2023-12-12'
                    - amount: 506001
                      date: '2023-12-13'
                    - amount: 506223
                      date: '2023-12-14'
                    - amount: 506445
                      date: '2023-12-15'
                    - amount: 506667
                      date: '2023-12-16'
                    - amount: 506866
                      date: '2023-12-17'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Retrieve payoff amounts for a facility
      security: *ref_0
  /loan_agreements:
    post:
      description: >-
        A loan agreement can be created for an application with a status of
        approved. Expect 4-8 seconds of latency
      operationId: loanAgreements_create
      tags:
        - LoanAgreements
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoanAgreement'
              examples:
                Example1:
                  value:
                    status: pending_signature
                    id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    application_id: app_a9d2f388030d4f4296f80fc327e08d0d
                    document_url: https://example.com/document-endpoint-unique-hash
                    created_on: '2022-12-31T20:47:38.152Z'
                    signature_timestamp: null
                    type: credit_agreement
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Create a loan agreement
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                application_id:
                  $ref: '#/components/schemas/ApplicationId'
                  description: >-
                    The `application_id` of the application to create the loan
                    agreement for
                accepted_offer_id:
                  $ref: '#/components/schemas/OfferId'
                  description: >-
                    The `accepted_offer_id` of the application's offer to create
                    the loan agreement for
              required:
                - application_id
                - accepted_offer_id
            examples:
              Example1:
                value:
                  application_id: app_f0467657bba948e6a87292e182132848
                  accepted_offer_id: off_86c05092a4384d89b03ef514ea4fee31
    get:
      description: List all loan agreements on your account
      operationId: loanAgreements_getAll
      tags:
        - LoanAgreements
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LoanAgreement'
              examples:
                Example1:
                  value:
                    - status: pending_signature
                      id: doc_43da3b3f95c745e1985a71e9a00d6c27
                      application_id: app_a9d2f388030d4f4296f80fc327e08d0d
                      document_url: https://example.com/document-endpoint-unique-hash
                      created_on: '2022-12-31T20:47:38.152Z'
                      signature_timestamp: null
                      type: credit_agreement
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all loan agreements
      security: *ref_0
  /loan_agreements/{loan_agreement_id}/sign:
    post:
      description: >-
        Electronically signs a loan document and updates the application's
        status to `accepted`
      operationId: loanAgreements_sign
      tags:
        - LoanAgreements
      parameters:
        - name: loan_agreement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/LoanAgreementId'
          example: doc_43da3b3f95c745e1985a71e9a00d6c27
          examples:
            Example1:
              value: doc_43da3b3f95c745e1985a71e9a00d6c27
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignLoanAgreementResponse'
              examples:
                Example1:
                  value:
                    status: signed
                    id: doc_96d13bec673c4eba8d44c9cda3bbb811
                    application_id: app_a9d2f388030d4f4296f80fc327e08d0d
                    signature_timestamp: '2022-12-31T21:10:47.610Z'
                    document_url: https://example.com/document-endpoint-unique-hash
                    created_on: '2022-12-31T21:07:16.642Z'
                    type: credit_agreement
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Sign a loan agreement
      security: *ref_0
  /loan_agreements/{loan_agreement_id}:
    get:
      description: Retrieve a loan agreement by its id
      operationId: loanAgreements_get
      tags:
        - LoanAgreements
      parameters:
        - name: loan_agreement_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/LoanAgreementId'
          example: doc_43da3b3f95c745e1985a71e9a00d6c27
          examples:
            Example1:
              value: doc_43da3b3f95c745e1985a71e9a00d6c27
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoanAgreement'
              examples:
                Example1:
                  value:
                    status: pending_signature
                    id: doc_43da3b3f95c745e1985a71e9a00d6c27
                    application_id: app_a9d2f388030d4f4296f80fc327e08d0d
                    document_url: https://example.com/document-endpoint-unique-hash
                    created_on: '2022-12-31T20:47:38.152Z'
                    signature_timestamp: null
                    type: credit_agreement
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get a loan agreement by id
      security: *ref_0
  /payments:
    post:
      description: >-
        Instructs Pier to initiate an ACH payment for a loan. If
        repayment_ach_enabled is false, use none for transfer_type.
      operationId: payments_submitPayment
      tags:
        - Payments
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
              examples:
                Example1:
                  value:
                    id: pmt_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    status: pending
                    transfer_type: standard
                    created_on: '2023-02-27T00:00:00Z'
                    is_autopay: false
                Example2:
                  value:
                    id: pmt_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    status: pending
                    transfer_type: none
                    created_on: '2023-02-27T00:00:00Z'
                    is_autopay: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Submit a loan payment
      security: *ref_0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
            examples:
              Example1:
                value:
                  facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                  amount: 100000
                  transfer_type: standard
                  settlement_priority: same_day
                  ach_authorization_id: doc_43da3b3f95c745e1985a71e9a00d6c27
              Example2:
                value:
                  facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                  amount: 100000
                  transfer_type: none
                  ach_authorization_id: doc_43da3b3f95c745e1985a71e9a00d6c27
    get:
      description: List all payments associated with your account
      operationId: payments_getAll
      tags:
        - Payments
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Payment'
              examples:
                Example1:
                  value:
                    - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                      amount: 100000
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      status: pending
                      transfer_type: standard
                      created_on: '2023-02-27T00:00:00Z'
                      is_autopay: false
                    - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                      amount: 100000
                      facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                      status: processing
                      transfer_type: standard
                      created_on: '2023-02-27T00:00:00Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: List all payments
      security: *ref_0
  /payments/{payment_id}:
    get:
      description: Get a payment by its id
      operationId: payments_get
      tags:
        - Payments
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
          example: pmt_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: pmt_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
              examples:
                Example1:
                  value:
                    id: pmt_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    status: pending
                    transfer_type: standard
                    created_on: '2023-02-27T00:00:00Z'
                    is_autopay: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get a payment by ID
      security: *ref_0
  /payments/{payment_id}/refund:
    post:
      description: >-
        Refunds a specified payment in full. This endpoint is intended for
        correcting erroneous transactions. Only payments in the `settled` state
        can be refunded. This includes customers with ACH disabled because
        payments go straight to settled.
      operationId: payments_refundPayment
      tags:
        - Payments
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundedPayment'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Refund a payment
      security: *ref_0
  /payments/{payment_id}/cancel:
    post:
      description: >-
        Cancels a submitted payment before it is sent to the ACH network.
        Payments can only be canceled if they are still in the `pending` state
        and have not been submitted to the ACH network. After a payment is sent
        to the ACH network, you must wait for the it to settle and then you may
        refund it instead.
          
        In some cases if you cancel while the payment is in the process of being
        submitted to the ACH network you may see a status of
        `cancellation_pending` in the response. In this case, you can check the
        status of the payment or wait for a subsequent webhook to see if it was
        successfully canceled or processed.
      operationId: payments_cancelPayment
      tags:
        - Payments
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
          example: pmt_18e5a3726b3943cda2635f40e1041ba4
          examples:
            Example1:
              value: pmt_18e5a3726b3943cda2635f40e1041ba4
            Example2:
              value: pmt_18e5a3726b3943cda2635f40e1041ba4
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
              examples:
                Example1:
                  value:
                    id: pmt_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    status: canceled
                    transfer_type: standard
                    created_on: '2023-02-27T00:00:00Z'
                    is_autopay: false
                Example2:
                  value:
                    id: pmt_18e5a3726b3943cda2635f40e1041ba4
                    amount: 100000
                    facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                    status: cancellation_pending
                    transfer_type: standard
                    created_on: '2023-02-27T00:00:00Z'
                    is_autopay: false
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Cancel a payment
      security: *ref_0
  /payments/{payment_id}/test/initiate:
    patch:
      description: Move payment to initiated state (*sandbox only*)
      operationId: payments_paymentTestInitiate
      tags:
        - Payments
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
          example: pmt_234259b117854d0194bc5864a6c45b42
          examples:
            Example1:
              value: pmt_234259b117854d0194bc5864a6c45b42
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Move payment to initiated state
      security: *ref_0
  /payments/{payment_id}/test/success:
    patch:
      description: Move payment to successful state (*sandbox only*)
      operationId: payments_paymentTestSuccess
      tags:
        - Payments
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
          example: pmt_234259b117854d0194bc5864a6c45b42
          examples:
            Example1:
              value: pmt_234259b117854d0194bc5864a6c45b42
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Move payment to successful state
      security: *ref_0
  /payments/{payment_id}/test/failed:
    patch:
      description: Move payment to failed state (*sandbox only*)
      operationId: payments_paymentTestFailed
      tags:
        - Payments
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
          example: pmt_234259b117854d0194bc5864a6c45b42
          examples:
            Example1:
              value: pmt_234259b117854d0194bc5864a6c45b42
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
              examples:
                Example1:
                  value: Ok.
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Move payment to failed state
      security: *ref_0
  /reconciliation/balance-report/{date}:
    get:
      description: >-
        Get the balance report for all facilities for a Pier partner  for a
        specific day. The report contains the balance EOD in  Pacific Time.
      operationId: reconciliationReports_getBalanceReport
      tags:
        - ReconciliationReports
      parameters:
        - name: date
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ISODate'
          example: '2024-10-01'
          examples:
            Example1:
              value: '2024-10-01'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceReportResponse'
              examples:
                Example1:
                  value:
                    facility_balances:
                      - facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                        report_date: '2024-10-01'
                        balance: 100000
                        payoff_balance: 100000
                        current_balance: 100000
                        interest_balance: 0
                        in_grace_period: true
                        in_introductory_promo_period: false
                    cadence: daily
                    type: balance
                    report_date: '2024-10-01'
                    last_updated: '2024-10-02T00:00:00Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '412':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get balance report
      security: *ref_0
  /reconciliation/transaction-report/{date}:
    get:
      description: >-
        Get the transaction report for all facilities for a Pier partner  for a
        specific day. The report contains all transactions for the  day that
        make up the ledger of the facility as well as payments and
        disbursements.
      operationId: reconciliationReports_getTransactionReport
      tags:
        - ReconciliationReports
      parameters:
        - name: date
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ISODate'
          example: '2024-10-01'
          examples:
            Example1:
              value: '2024-10-01'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionReportResponse'
              examples:
                Example1:
                  value:
                    facility_transactions:
                      - - facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                          borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                          amount: 100000
                          net_amount: 100000
                          transaction_date: '2023-05-12'
                          effective_date: '2023-05-12'
                          description: Disbursement
                          transaction_type: DEBIT
                          category: DISBURSEMENT
                          transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                        - facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                          borrower_id: bor_a1d0c30d77104f35b4c842b99132624e
                          amount: 500000
                          net_amount: -500000
                          transaction_date: '2024-06-02'
                          effective_date: '2024-06-02'
                          description: Principal Reduction
                          transaction_type: CREDIT
                          category: PRINCIPAL_REDUCTION
                          transaction_iso_timestamp: '2023-05-12T00:00:00.000Z'
                    payments:
                      - id: pmt_18e5a3726b3943cda2635f40e1041ba4
                        amount: 100000
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        status: pending
                        transfer_type: standard
                        created_on: '2023-02-27T00:00:00Z'
                        is_autopay: false
                    disbursements:
                      - id: dsb_18e5a3726b3943cda2635f40e1041ba4
                        facility_id: fac_18e5a3726b3943cda2635f40e1041ba4
                        amount: 100000
                        status: pending
                        failure_reason: null
                        date: '2023-02-27'
                        created_on: '2023-02-27T00:00:00Z'
                        transfer_type: standard
                    cadence: daily
                    type: transaction
                    report_date: '2024-10-01'
                    last_updated: '2024-10-02T00:00:00Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '412':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: ''
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      summary: Get transaction report
      security: *ref_0
components:
  schemas:
    ApplicationId:
      title: ApplicationId
      type: string
    OfferId:
      title: OfferId
      type: string
    ApplicationStatus:
      title: ApplicationStatus
      type: string
      enum:
        - pending
        - approved
        - accepted
        - declined
        - incomplete
        - rejected
    Offer:
      title: Offer
      oneOf:
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - revolving_line_of_credit_offer
            - $ref: '#/components/schemas/LineOfCreditOffer'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - loan_offer
            - $ref: '#/components/schemas/LoanOffer'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - merchant_advance_offer
            - $ref: '#/components/schemas/MerchantAdvanceOffer'
          required:
            - type
    OfferRequest:
      title: OfferRequest
      oneOf:
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - revolving_line_of_credit_offer
            - $ref: '#/components/schemas/LineOfCreditOfferRequest'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - loan_offer
            - $ref: '#/components/schemas/LoanOfferRequest'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - merchant_advance_offer
            - $ref: '#/components/schemas/MerchantAdvanceOfferRequest'
          required:
            - type
    Application:
      title: Application
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ApplicationId'
          nullable: true
        borrower_id:
          $ref: '#/components/schemas/ConsumerBorrowerId'
          nullable: true
          description: The `borrower_id` of the borrower the application belongs to
        created_on:
          type: string
          format: date-time
          nullable: true
          description: Timestamp the application object is created on
        credit_type:
          $ref: '#/components/schemas/CreditType'
          nullable: true
          description: The type of credit product.
        decisioned_on:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the application is either approved or rejected on
        offers:
          type: array
          items:
            $ref: '#/components/schemas/Offer'
          nullable: true
          description: >-
            If the application is approved, an object containing the credit
            offer details
        rejection_reasons:
          type: array
          items:
            $ref: '#/components/schemas/RejectionReason'
          nullable: true
          description: >-
            If the application is rejected, a list containing 1-4 rejection
            reason(s).  The Rejection Reasons endpoint provides a list of valid
            reasons and descriptors
        requested_amount:
          type: integer
          nullable: true
          description: >-
            If the borrower requests an amount in their application, the
            requested  loan or credit line amount in cents (e.g. 500000 for
            $5,000)
        status:
          $ref: '#/components/schemas/ApplicationStatus'
        third_party_disbursement_destination:
          type: string
          nullable: true
          description: >-
            For credit applications of type `consumer_bnpl`, the third party
            (i.e. merchant) receiving the funds is specified here
        lender_of_record:
          type: string
          nullable: true
          description: The lender of record
        credit_data:
          $ref: '#/components/schemas/CreditData'
          nullable: true
      required:
        - status
    LineOfCreditOfferRequest:
      title: LineOfCreditOfferRequest
      type: object
      properties:
        amount:
          type: integer
          description: >-
            The amount (in cents) of the credit line offer (e.g. '200000' for
            $2,000.00)
        apr:
          type: integer
          nullable: true
          description: The annual percentage rate (in basis points) of the credit line
        annual_fee:
          type: integer
          nullable: true
          description: The annual fee charged for the credit line (e.g. '5000' for $50.00)
        billing_cycle:
          type: integer
          nullable: true
          description: >-
            The time in days between the last statement's closing date and the
            next statement's closing date.  For consumer lines of credit, the
            minimum is '21'
        finance_charge:
          type: integer
          nullable: true
          description: >-
            If your platform charges a monthly finance charge for access to the
            line, the amount in cents
        grace_period:
          $ref: '#/components/schemas/GracePeriod'
          nullable: true
        introductory_promo_period:
          $ref: '#/components/schemas/IntroductoryPromoPeriod'
          nullable: true
        interest_rate:
          type: integer
          nullable: true
          description: >-
            The interest rate (in basis points) of the loan or credit line offer
            (e.g. '750' for 7.50%)
        late_payment_fee:
          type: integer
          nullable: true
          description: >-
            The fee charged if a borrower misses the payment due date, in cents
            (e.g. '2500' for $25.00; default to 0)
        minimum_payment:
          $ref: '#/components/schemas/MinimumPayment'
          nullable: true
          description: >-
            The minimum payment due each billing cycle. There is also a flat
            minimum payment of \$15, which is used if the calculated minimum
            payment is less than \$15.
        payment_period:
          $ref: '#/components/schemas/PaymentPeriod'
          nullable: true
          description: >-
            The repayment frequency for the loan. Accepted values weekly,
            biweekly, monthly, semi_monthly_first_15th, semi_monthly_last_15th,
            semi_monthly
        first_payment_date:
          type: string
          nullable: true
          description: The date of the first payment, in ISO 8601 format (e.g. 2022-12-31)
      required:
        - amount
    LineOfCreditOffer:
      title: LineOfCreditOffer
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OfferId'
      required:
        - id
      allOf:
        - $ref: '#/components/schemas/LineOfCreditOfferRequest'
    LoanOfferRequest:
      title: LoanOfferRequest
      type: object
      properties:
        amount:
          type: integer
          description: The amount (in cents) of the loan offer (e.g. 200000 for $2,000.00)
        grace_period:
          $ref: '#/components/schemas/GracePeriod'
          nullable: true
        introductory_promo_period:
          $ref: '#/components/schemas/IntroductoryPromoPeriod'
          nullable: true
        interest_rate:
          type: integer
          nullable: true
          description: >-
            The interest rate (in basis points) charged on the loan principal
            (e.g. 750 for 7.50%)
        origination_fee:
          $ref: '#/components/schemas/OriginationFee'
          nullable: true
          description: >-
            The origination fee charged to originate the loan in basis points
            (e.g. 150 for 1.50%)
        payment_period:
          $ref: '#/components/schemas/PaymentPeriod'
          nullable: true
          description: >-
            The repayment frequency for the loan. Accepted values weekly,
            biweekly, monthly, semi_monthly_first_15th, semi_monthly_last_15th,
            semi_monthly
        first_payment_date:
          type: string
          nullable: true
          description: The date of the first payment, in ISO 8601 format (e.g. 2022-12-31)
        late_payment_fee:
          type: integer
          nullable: true
          description: >-
            The fee charged if a borrower misses the payment due date, in cents
            (e.g. 2500 for $25.00)
        loan_term:
          $ref: '#/components/schemas/Term'
          description: The type of term. Accepted values are months, days, payments
        security_amount:
          type: integer
          nullable: true
          description: >-
            The amount (in cents) of the value of the loan collateral (e.g.
            200000 for $2,000.00). Required for secured loan application types.
      required:
        - amount
        - loan_term
    LoanOffer:
      title: LoanOffer
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OfferId'
      required:
        - id
      allOf:
        - $ref: '#/components/schemas/LoanOfferRequest'
    MerchantAdvanceOfferRequest:
      title: MerchantAdvanceOfferRequest
      type: object
      properties:
        amount:
          type: integer
          description: The amount (in cents) of the loan offer (e.g. 200000 for $2,000.00)
        interest_rate:
          type: integer
          description: The interest rate charged on the advance
        loan_term:
          $ref: '#/components/schemas/Term'
          description: The term of the advance
        origination_fee:
          $ref: '#/components/schemas/OriginationFee'
          nullable: true
          description: >-
            The origination fee charged to originate the line in basis points
            (e.g. '150' for 1.50%)
        late_payment_fee:
          type: integer
          nullable: true
          description: >-
            The fee charged if a borrower misses the payment due date, in cents
            (e.g. 2500 for $25.00)
      required:
        - amount
        - interest_rate
        - loan_term
    MerchantAdvanceOffer:
      title: MerchantAdvanceOffer
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OfferId'
        apr:
          type: integer
          nullable: true
          description: The annual percentage rate (in basis points) of the credit line
      required:
        - id
      allOf:
        - $ref: '#/components/schemas/MerchantAdvanceOfferRequest'
    GracePeriod:
      title: GracePeriod
      type: object
      properties:
        term:
          type: integer
          nullable: true
          description: >-
            The time in days between the end of a billing cycle and the bill's
            due date. For consumer lines of credit, the minimum is '21'
        interest_rate:
          type: integer
          nullable: true
          description: >-
            The interest rate (in basis points) charged during the grace period.
            Must be '0' for consumer lines of credit. Defaults to 0 if omitted
    IntroductoryPromoPeriod:
      title: IntroductoryPromoPeriod
      type: object
      properties:
        interest_rate:
          type: integer
          description: >-
            The interest rate (in basis points) charged during the introductory
            period
        promo_term:
          $ref: '#/components/schemas/PromoTerm'
          description: The terms of the promotional period
      required:
        - interest_rate
        - promo_term
    PromoTerm:
      title: PromoTerm
      type: object
      properties:
        term:
          type: integer
          description: >-
            The term of the promotional period relative to the `term_type` (e.g.
            if `daily` in days, `period` in period of loan, etc.)
        term_type:
          $ref: '#/components/schemas/PromoTermType'
          description: The term of the promotional period
      required:
        - term
        - term_type
    PromoTermType:
      title: PromoTermType
      type: string
      enum:
        - daily
        - period
    Term:
      title: Term
      type: object
      properties:
        term_type:
          $ref: '#/components/schemas/TermType'
        term:
          type: integer
          description: >-
            The term of the loan according to the term type. A minimum of 3 is
            required for monthly payment_period, 6 for semi-monthly, 7 for
            biweekly and 13 for weekly.
      required:
        - term_type
        - term
    PaymentPeriod:
      title: PaymentPeriod
      type: string
      enum:
        - weekly
        - biweekly
        - monthly
        - semi_monthly_first_15th
        - semi_monthly_last_15th
        - semi_monthly
    MinimumPayment:
      title: MinimumPayment
      type: object
      properties:
        type:
          $ref: '#/components/schemas/MinimumPaymentType'
          description: >-
            The type of minimum payment structure. Accepted values are
            interest_plus_percentage_of_principal
        value:
          type: integer
          description: >-
            The minimum payment percentage due each billing cycle (e.g. 500 for
            5.00%)
        floor:
          type: integer
          nullable: true
          description: >-
            The minimum payment floor in cents (e.g. 1500 for $15.00). Defaults
            to 1500 if omitted. If the percentage of the principal balance is
            less than the floor, the floor is used.
      required:
        - type
        - value
    MinimumPaymentType:
      title: MinimumPaymentType
      type: string
      enum:
        - interest_plus_percentage_of_principal
    RejectionReason:
      title: RejectionReason
      type: string
      enum:
        - income_too_low
        - bank_balance_too_low
        - income_unpredictable
        - user_account_duplicate
        - sdb_check_failed
        - bank_account_linking_error
        - mla_failed
        - iddoc_failed
        - no_checking_or_savings_data
        - insufficient_bank_history
        - loan_location_no_license
        - address_invalid
        - income_verification_failed
        - stacking_behavior
        - ssn_verification_failed
        - too_many_nsfs
        - fraud_risk_too_high
        - has_bankruptcy_history
        - unable_to_verify_credit_information
        - credit_file_frozen
        - processor_suspended
        - cash_flow_verification_failed
        - credit_score_too_low
    GetApplicationRequest:
      title: GetApplicationRequest
      type: object
      properties:
        application_id:
          type: string
          description: The id of the borrower you're requesting to retrieve
      required:
        - application_id
    TermType:
      title: TermType
      type: string
      enum:
        - months
        - days
        - payments
    CreditData:
      title: CreditData
      type: object
      properties:
        fico:
          type: integer
          nullable: true
          description: A FICO score (e.g. 750)
        has_bankruptcy_history:
          type: boolean
          nullable: true
          description: Whether or not there is bankruptcy history
    OriginationFee:
      title: OriginationFee
      type: object
      properties:
        type:
          $ref: '#/components/schemas/OriginationFeeType'
          description: >-
            The type of origination fee. Accepted values are deducted and
            capitalized
        fee:
          type: integer
          description: The origination fee in bps
      required:
        - type
        - fee
    OriginationFeeType:
      title: OriginationFeeType
      type: string
      enum:
        - deducted
        - capitalized
    AuthRequest:
      title: AuthRequest
      type: object
      properties:
        client_id:
          type: string
          description: Your Pier API client ID
          example: '1234567890'
        secret:
          type: string
          description: Your Pier API client secret
          example: '1234567890'
      required:
        - client_id
        - secret
    AuthResponse:
      title: AuthResponse
      type: object
      properties:
        token:
          type: string
          description: A JWT token to use with the Pier API (24h expiration)
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
      required:
        - token
    BusinessBorrowerId:
      title: BusinessBorrowerId
      type: string
    BeneficialOwnerId:
      title: BeneficialOwnerId
      type: string
    GovernmentIdentifiers:
      title: GovernmentIdentifiers
      type: object
      properties:
        ssn:
          type: string
          nullable: true
          description: The borrower's 9-digit social security number (e.g. 345543221)
        ssn_last_4:
          type: string
          nullable: true
          description: The last 4 digits of the borrower's social security number
        itin:
          type: string
          nullable: true
          description: >-
            The borrower's 9-digit individual taxpayer identification number
            (e.g. 345543221)
        passport:
          $ref: '#/components/schemas/Passport'
          nullable: true
          description: The borrower's passport
        drivers_license:
          $ref: '#/components/schemas/DriversLicense'
          nullable: true
          description: The borrower's driver license
    Passport:
      title: Passport
      type: object
      properties:
        country:
          type: string
          description: ISO 3166-1 Alpha-3 code representing the country of issue (e.g. USA)
          example: USA
        number:
          type: string
          description: The passport number
          example: PA0940443
        expiration_date:
          type: string
          nullable: true
          description: The expiration date of the passport (YYYY-MM-DD)
        issue_date:
          type: string
          description: The issue date of the passport (YYYY-MM-DD)
          example: '2012-12-12'
      required:
        - country
        - number
        - issue_date
    DriversLicense:
      title: DriversLicense
      type: object
      properties:
        country:
          type: string
          description: ISO 3166-1 Alpha-3 code representing the country of issue (e.g. USA)
          example: USA
        province:
          type: string
          description: >-
            Adapted ISO 3166-2 code with Alpha-3 country code prefix (e.g.
            USA-CA)
          example: USA-CA
        number:
          type: string
          description: The passport number
          example: D9892111
        expiration_date:
          type: string
          nullable: true
          description: The expiration date of the passport (YYYY-MM-DD)
        issue_date:
          type: string
          description: The issue date of the passport (YYYY-MM-DD)
          example: '2012-12-12'
      required:
        - country
        - province
        - number
        - issue_date
    ConsumerBorrowerId:
      title: ConsumerBorrowerId
      type: string
    Borrower:
      title: Borrower
      oneOf:
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - business
            - $ref: '#/components/schemas/BusinessBorrower'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - consumer
            - $ref: '#/components/schemas/ConsumerBorrower'
          required:
            - type
    BusinessBorrowerRequest:
      title: BusinessBorrowerRequest
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          nullable: true
          description: The address of the business.
        beneficial_owners:
          type: array
          items:
            $ref: '#/components/schemas/BeneficialOwners'
          nullable: true
          description: >-
            An array of objects representing owners of the business and those
            who control the funds of the business. 

            If no one owns more than 25% of the business, just the individual
            who has ultimate control of the funds must be included. 

            A maximum of 5 objects can be added.
        business_contact:
          $ref: '#/components/schemas/BusinessContact'
          nullable: true
          description: The person executing the loan agreement.
        business_name:
          type: string
          description: Legal name of the business.
          example: Apple Landscaping
        business_type:
          $ref: '#/components/schemas/BusinessType'
          description: The type of business entity.
        dba_name:
          type: string
          nullable: true
          description: Doing-business-as name of the business
        ein:
          type: string
          nullable: true
          description: >-
            9-digit IRS employee identification number of the business (e.g.
            345543221)
        incorporation_date:
          type: string
          nullable: true
          description: Incorporation date of the business (YYYY-MM-DD)
        kyb_completion_date:
          type: string
          nullable: true
          description: Date kyb completed on the business (YYYY-MM-DD)
        state_of_incorporation:
          type: string
          description: Required 2-digit US state code (e.g. CA, IL, FL, …)
          example: DE
        phone:
          type: string
          nullable: true
          description: The phone number of the business
      required:
        - business_name
        - business_type
        - state_of_incorporation
    BusinessBorrowerResponse:
      title: BusinessBorrowerResponse
      type: object
      properties:
        id:
          $ref: '#/components/schemas/BusinessBorrowerId'
        address:
          $ref: '#/components/schemas/Address'
        beneficial_owners:
          type: array
          items:
            $ref: '#/components/schemas/BeneficialOwnersResponse'
          description: >-
            An array of objects representing owners of the business and those
            who control the funds of the business. 

            If no one owns more than 25% of the business, just the individual
            who has ultimate control of the funds must be included. 

            A maximum of 5 objects can be added.
        business_contact:
          $ref: '#/components/schemas/BusinessContact'
          description: The person executing the loan agreement.
        business_name:
          type: string
          description: Legal name of the business
          example: Apple Landscaping
        business_type:
          $ref: '#/components/schemas/BusinessType'
          description: The type of business entity.
        created_on:
          type: string
          description: Time stamp of borrower's creation date
          example: '2022-12-30T07:23:36.665Z'
        dba_name:
          type: string
          description: Doing-business-as name of the business
          example: Apple Landscaping
        incorporation_date:
          type: string
          description: Incorporation date of the business (YYYY-MM-DD)
          example: '2000-12-12'
        kyb_completion_date:
          type: string
          description: Date kyb completed on the business (YYYY-MM-DD)
          example: '2022-11-15'
        phone:
          type: string
          description: The phone number of the business
          example: '4152556465'
        state_of_incorporation:
          type: string
          description: Required 2-digit US state code (e.g. CA, IL, FL, …)
          example: DE
      required:
        - id
        - address
        - beneficial_owners
        - business_contact
        - business_name
        - business_type
        - created_on
        - dba_name
        - incorporation_date
        - kyb_completion_date
        - phone
        - state_of_incorporation
    UpdateBusinessBorrowerRequest:
      title: UpdateBusinessBorrowerRequest
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: The address of the business.
        beneficial_owners:
          type: array
          items:
            $ref: '#/components/schemas/BeneficialOwners'
          description: >-
            An array of objects representing owners of the business and those
            who control the funds of the business. 

            If no one owns more than 25% of the business, just the individual
            who has ultimate control of the funds must be included. 

            A maximum of 5 objects can be added.
        business_contact:
          $ref: '#/components/schemas/BusinessContact'
          description: The person executing the loan agreement.
        business_name:
          type: string
          description: Legal name of the business.
          example: Apple Landscaping
        business_type:
          $ref: '#/components/schemas/BusinessType'
          description: The type of business entity.
        dba_name:
          type: string
          description: Doing-business-as name of the business
          example: Apple Landscaping
        incorporation_date:
          type: string
          description: Incorporation date of the business (YYYY-MM-DD)
          example: '2000-12-12'
        kyb_completion_date:
          type: string
          description: Date kyb completed on the business (YYYY-MM-DD)
          example: '2022-11-15'
        state_of_incorporation:
          type: string
          description: Required 2-digit US state code (e.g. CA, IL, FL, …)
          example: DE
        phone:
          type: string
          description: The phone number of the business
          example: '4152556465'
      required:
        - address
        - beneficial_owners
        - business_contact
        - business_name
        - business_type
        - dba_name
        - incorporation_date
        - kyb_completion_date
        - state_of_incorporation
        - phone
    BusinessBorrower:
      title: BusinessBorrower
      type: object
      properties:
        id:
          $ref: '#/components/schemas/BusinessBorrowerId'
        address:
          $ref: '#/components/schemas/Address'
          nullable: true
        beneficial_owners:
          type: array
          items:
            $ref: '#/components/schemas/BeneficialOwners'
          nullable: true
          description: >-
            An array of objects representing owners of the business and those
            who control the funds of the business. 

            If no one owns more than 25% of the business, just the individual
            who has ultimate control of the funds must be included. 

            A maximum of 5 objects can be added.
        business_contact:
          $ref: '#/components/schemas/BusinessContact'
          nullable: true
          description: The person executing the loan agreement.
        business_name:
          type: string
          description: Legal name of the business
          example: Apple Landscaping
        business_type:
          $ref: '#/components/schemas/BusinessType'
          description: The type of business entity.
        created_on:
          type: string
          nullable: true
          description: Time stamp of borrower's creation date
        dba_name:
          type: string
          nullable: true
          description: Doing-business-as name of the business
        ein:
          type: string
          nullable: true
          description: >-
            9-digit IRS employee identification number of the business (e.g.
            345543221)
        incorporation_date:
          type: string
          nullable: true
          description: Incorporation date of the business (YYYY-MM-DD)
        kyb_completion_date:
          type: string
          nullable: true
          description: Date kyb completed on the business (YYYY-MM-DD)
        phone:
          type: string
          nullable: true
          description: The phone number of the business
        state_of_incorporation:
          type: string
          description: Required 2-digit US state code (e.g. CA, IL, FL, …)
          example: DE
      required:
        - id
        - business_name
        - business_type
        - state_of_incorporation
    BeneficialOwnersResponse:
      title: BeneficialOwnersResponse
      type: object
      properties:
        id:
          $ref: '#/components/schemas/BeneficialOwnerId'
        address:
          $ref: '#/components/schemas/Address'
          description: The person's address.
        date_of_birth:
          type: string
          description: The person's date of birth (YYYY-MM-DD)
        email:
          type: string
          description: The person's valid email address
        first_name:
          type: string
          description: The person's first name
        last_name:
          type: string
          description: The person's last name
        phone:
          type: string
          description: The person's 10-digit US phone number (e.g. 4152251000)
        percent_ownership:
          type: integer
          description: >-
            The percent ownership the person has in the business in basis points
            (e.g. 2500 for 25%)
      required:
        - id
        - address
        - date_of_birth
        - email
        - first_name
        - last_name
        - phone
        - percent_ownership
    BeneficialOwners:
      title: BeneficialOwners
      type: object
      description: >-
        A person who owns owns 25% or more of the business as well as those who
        control the funds.
      properties:
        government_identifiers:
          $ref: '#/components/schemas/GovernmentIdentifiers'
          description: >-
            The person's government identifiers, required fields dependent on
            customer configuration
      required:
        - government_identifiers
      allOf:
        - $ref: '#/components/schemas/BeneficialOwnersResponse'
    BusinessContact:
      title: BusinessContact
      type: object
      properties:
        first_name:
          type: string
          description: The person's first name
        last_name:
          type: string
          description: The person's last name
        phone:
          type: string
          description: The person's 10-digit US phone number (e.g. 4152251000)
        email:
          type: string
          description: The person's valid email address
        title:
          type: string
          description: The person's title in the company (e.g. COO)
      required:
        - first_name
        - last_name
        - phone
        - email
        - title
    BusinessType:
      title: BusinessType
      type: string
      enum:
        - corporation
        - llc
        - partnership
        - sole_proprietorship
    ConsumerBorrowerRequest:
      title: ConsumerBorrowerRequest
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: The address of the borrower
        date_of_birth:
          type: string
          description: The borrower's date of birth (YYYY-MM-DD)
          example: '1991-12-18'
        email:
          type: string
          description: The borrower's valid email address
          example: jdough@acme.co
        first_name:
          type: string
          description: The borrower's first name (min. 2 characters)
          example: Jane
        last_name:
          type: string
          description: The borrower's last name (min. 2 characters)
          example: Dough
        kyc_completion_date:
          type: string
          nullable: true
          description: >-
            Date kyc completed on the borrower, only required if Pier is not
            performing KYC (YYYY-MM-DD)
        kyc_status:
          $ref: '#/components/schemas/KycStatus'
          nullable: true
          description: Kyc status of a consumer (*sandbox only*)
        government_identifiers:
          $ref: '#/components/schemas/GovernmentIdentifiers'
          nullable: true
          description: >-
            The borrower's government identifiers, required fields dependent on
            customer configuration. Can be non-unique on sandbox environment.
      required:
        - address
        - date_of_birth
        - email
        - first_name
        - last_name
    UpdateConsumerBorrowerRequest:
      title: UpdateConsumerBorrowerRequest
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: The address of the borrower
        date_of_birth:
          type: string
          description: The borrower's date of birth (YYYY-MM-DD)
          example: '1991-12-18'
        email:
          type: string
          description: The borrower's valid email address
          example: jdough@acme.co
        kyc_completion_date:
          type: string
          nullable: true
          description: Date kyc completed on the borrower (YYYY-MM-DD)
        kyc_status:
          $ref: '#/components/schemas/KycStatus'
          nullable: true
          description: Kyc status of a consumer (*sandbox only*)
      required:
        - address
        - date_of_birth
        - email
    ConsumerBorrowerResponse:
      title: ConsumerBorrowerResponse
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: The address of the borrower
        date_of_birth:
          type: string
          description: The borrower's date of birth (YYYY-MM-DD)
          example: '1991-12-18'
        id:
          $ref: '#/components/schemas/ConsumerBorrowerId'
          description: The ID of the borrower
        email:
          type: string
          description: The borrower's valid email address
          example: jdough@acme.co
        first_name:
          type: string
          description: The borrower's first name (min. 2 characters)
          example: Jane
        last_name:
          type: string
          description: The borrower's last name (min. 2 characters)
          example: Dough
        kyc_completion_date:
          type: string
          description: Date kyc completed on the borrower (YYYY-MM-DD)
          example: '2022-11-15'
        created_on:
          type: string
          format: date-time
          description: The date the borrower was created
          example: '2022-12-31T00:58:47.828Z'
      required:
        - address
        - date_of_birth
        - id
        - email
        - first_name
        - last_name
        - kyc_completion_date
        - created_on
    ConsumerBorrower:
      title: ConsumerBorrower
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: The address of the borrower
        date_of_birth:
          type: string
          description: The borrower's date of birth (YYYY-MM-DD)
          example: '1991-12-18'
        id:
          $ref: '#/components/schemas/ConsumerBorrowerId'
          description: The ID of the borrower
        email:
          type: string
          description: The borrower's valid email address
          example: jdough@acme.co
        first_name:
          type: string
          description: The borrower's first name (min. 2 characters)
          example: Jane
        last_name:
          type: string
          description: The borrower's last name (min. 2 characters)
          example: Dough
        kyc_completion_date:
          type: string
          description: Date kyc completed on the borrower (YYYY-MM-DD)
          example: '2022-11-15'
        government_identifiers:
          $ref: '#/components/schemas/GovernmentIdentifiers'
          description: >-
            The borrower's government identifiers, required fields dependent on
            customer configuration
        created_on:
          type: string
          format: date-time
          description: The date the borrower was created
          example: '2022-12-31T00:58:47.828Z'
      required:
        - address
        - date_of_birth
        - id
        - email
        - first_name
        - last_name
        - kyc_completion_date
        - government_identifiers
        - created_on
    KycStatus:
      title: KycStatus
      type: string
      enum:
        - approved
        - declined
        - pending
    Address:
      title: Address
      type: object
      properties:
        line_1:
          type: string
          description: A string of 1-256 characters
        line_2:
          type: string
          nullable: true
          description: A string of 1-256 characters
        city:
          type: string
          description: A string of 1-30 characters
        state:
          type: string
          description: 2-digit US state code (e.g. CA, IL, FL)
        zip:
          type: string
          description: 5-digit US zip code
      required:
        - line_1
        - city
        - state
        - zip
    Autopay:
      title: Autopay
      type: object
      properties:
        authorized:
          type: boolean
          description: a bollean indicating whether autopay is authorized
          example: true
        authorization_timestamp:
          type: string
          format: date-time
          nullable: true
          description: the timestamp when autopay was authorized
        bank_account:
          $ref: '#/components/schemas/BankAccount'
          nullable: true
        amount_type:
          $ref: '#/components/schemas/AutopayAmountType'
          nullable: true
          description: >-
            the type of autopay amount, either minimum_payment or
            statement_balance
        additional_amount:
          type: integer
          nullable: true
          description: >-
            the additional amount to be paid on top of the minimum payment, in
            cents
      required:
        - authorized
    BankAccount:
      title: BankAccount
      type: object
      properties:
        bank_account_number:
          type: string
          description: The bank account number to use for scheduled payments
          example: '98989898'
        bank_routing_number:
          type: string
          description: The bank routing number to use for scheduled payments
          example: '021000021'
        type:
          $ref: '#/components/schemas/BankAccountType'
          description: The type of bank account, either checking or savings
      required:
        - bank_account_number
        - bank_routing_number
        - type
    AutopayAmountType:
      title: AutopayAmountType
      type: string
      enum:
        - minimum_payment
        - statement_balance
    BankAccountType:
      title: BankAccountType
      type: string
      enum:
        - checking
        - savings
    TransferType:
      title: TransferType
      type: string
      enum:
        - standard
        - none
      description: These transfer types are passed in by API users to indicate ACH or not.
    PaymentTransferType:
      title: PaymentTransferType
      type: string
      enum:
        - standard
        - none
        - refund
        - credit
        - cancellation
        - suspense_credit
      description: >-
        Transfer types that are not standard/none are set by special operations
        like the refund endpoint for example.  Special types, like refund, will
        reference the original transaction transfer type of standard/none to
        determine  if ACH was used if this knowledge is needed (e.g. does an ACH
        refund need to happen or was this ledgering only).
    DisbursementTransferType:
      title: DisbursementTransferType
      type: string
      enum:
        - standard
        - none
        - refund
        - cancellation
        - suspense_refund
      description: >-
        Transfer types that are not standard/none are set by special operations
        like the refund endpoint for example.  Special types, like refund, will
        reference the original transaction transfer type of standard/none to
        determine  if ACH was used if this knowledge is needed (e.g. does an ACH
        refund need to happen or was this ledgering only).
    TransferStatus:
      title: TransferStatus
      type: string
      enum:
        - pending
        - processing
        - processed
        - settled
        - failed
        - canceled
        - cancellation_pending
    SettlementPriorities:
      title: SettlementPriorities
      type: string
      enum:
        - standard
        - next_day
        - same_day
      description: This determines the network speed used for ACH transfers.
    CreditType:
      title: CreditType
      type: string
      enum:
        - consumer_installment_loan
        - consumer_bnpl
        - consumer_revolving_line_of_credit
        - consumer_closed_line_of_credit
        - consumer_secured_installment_loan
        - consumer_secured_revolving_line_of_credit
        - commercial_installment_loan
        - commercial_revolving_line_of_credit
        - commercial_closed_line_of_credit
        - commercial_bnpl
        - commercial_merchant_advance
    ErrorBody:
      title: ErrorBody
      type: object
      properties:
        error_type:
          type: string
        error_code:
          type: string
        error_message:
          type: string
        error_detail:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
          nullable: true
      required:
        - error_type
        - error_code
        - error_message
    ErrorDetail:
      title: ErrorDetail
      type: object
      properties:
        value:
          type: string
        msg:
          type: string
        param:
          type: string
        location:
          type: string
      required:
        - value
        - msg
        - param
        - location
    WebhookUrls:
      title: WebhookUrls
      type: object
      properties:
        urls:
          type: array
          items:
            type: string
          description: The array of `urls` to send webhooks to
          example:
            - https://example.com/webhook1
            - https://example.com/webhook2
      required:
        - urls
    DeleteWebhookResponse:
      title: DeleteWebhookResponse
      type: object
      properties:
        urls:
          type: array
          items:
            type: string
          example: []
      required:
        - urls
    VerificationResponse:
      title: VerificationResponse
      type: object
      properties:
        public_key:
          type: string
          description: The `public_key` to use to verify Pier webhook signatures
          example: |-
            -----BEGIN PUBLIC KEY-----
            MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ
            jkdfhdfjskfhsd==
            -----END PUBLIC KEY-----
      required:
        - public_key
    LendingDetails:
      title: LendingDetails
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: Your address as lender of record
        cs_phone:
          type: string
          description: Your customer service phone number
          example: 415-555-5555
        cs_email:
          type: string
          description: Your customer service email
          example: support@example.com
      required:
        - address
        - cs_phone
        - cs_email
    CommercialCoverage:
      title: CommercialCoverage
      type: object
      properties:
        max_apr:
          type: integer
          nullable: true
        business_types:
          type: array
          items:
            $ref: '#/components/schemas/BusinessType'
          nullable: true
        limit_1:
          $ref: '#/components/schemas/CoverageLimit'
      required:
        - limit_1
    ConsumerCoverage:
      title: ConsumerCoverage
      type: object
      properties:
        amount_threshold:
          $ref: '#/components/schemas/AmountThreshold'
        apr_threshold:
          $ref: '#/components/schemas/AprThreshold'
        origination_fee_threshold:
          $ref: '#/components/schemas/OriginationFeeThreshold'
      required:
        - amount_threshold
        - apr_threshold
        - origination_fee_threshold
    CoverageLimit:
      title: CoverageLimit
      type: object
      properties:
        amount:
          $ref: '#/components/schemas/CoverageAmount'
      required:
        - amount
    AmountThreshold:
      title: AmountThreshold
      type: object
      properties:
        min:
          type: integer
        max:
          type: integer
      required:
        - min
        - max
    AprThreshold:
      title: AprThreshold
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AprThresholdType'
        max:
          $ref: '#/components/schemas/AprCaps'
      required:
        - type
        - max
    AprCaps:
      title: AprCaps
      type: array
      items:
        $ref: '#/components/schemas/AprCap'
    AprCap:
      title: AprCap
      type: object
      properties:
        range:
          $ref: '#/components/schemas/AprRange'
        rate:
          type: integer
          example: 1000
      required:
        - range
        - rate
    OriginationFeeThreshold:
      title: OriginationFeeThreshold
      type: object
      properties:
        max:
          type: integer
      required:
        - max
    CoverageAmount:
      title: CoverageAmount
      type: object
      properties:
        min:
          type: integer
        max:
          type: integer
      required:
        - min
        - max
    AprMax:
      title: AprMax
      type: object
      properties:
        range:
          $ref: '#/components/schemas/AprRange'
        rate:
          type: integer
      required:
        - range
        - rate
    AprRange:
      title: AprRange
      type: object
      properties:
        min:
          type: integer
        max:
          type: integer
      required:
        - min
        - max
    AprThresholdType:
      title: AprThresholdType
      type: string
      enum:
        - simple
        - tiered
        - cumulative
    RetrieveRejectionReasonsResponse:
      title: RetrieveRejectionReasonsResponse
      type: object
      additionalProperties:
        type: string
    CheckOffer:
      title: CheckOffer
      type: object
      properties:
        id:
          type: integer
          nullable: true
          description: Unique identifier for the offer used in the check_offers endpoint.
        type:
          $ref: '#/components/schemas/CheckOfferType'
        amount:
          type: integer
          description: The amount (in cents) of the offer (e.g., 300000 for $3,000.00).
        interest_rate:
          type: integer
          description: >-
            The interest rate (in basis points) charged on the offer (e.g., 750
            for 7.50%).
        term:
          type: integer
          nullable: true
          description: >-
            Legacy - The term of the offer in months (e.g., 24 for a 24-month
            term). Use loan_term instead, but if this is specified, loan_term
            can be undefined.
        loan_term:
          $ref: '#/components/schemas/Term'
          description: The term of the offer.
        origination_fee:
          type: integer
          description: >-
            The origination fee charged to originate the offer in basis points
            (e.g., 150 for 1.50%).
        first_payment_date:
          type: string
          nullable: true
          description: >-
            The date of the first payment, in ISO 8601 format (e.g.,
            "2023-10-15"). This date must be in the future, and is used to
            calculate the APR.
        payment_period:
          $ref: '#/components/schemas/PaymentPeriod'
          nullable: true
          description: >-
            The repayment frequency for the offer. Accepted values weekly,
            biweekly, monthly, semi_monthly_first_15th, semi_monthly_last_15th,
            semi_monthly.
      required:
        - type
        - amount
        - interest_rate
        - loan_term
        - origination_fee
    CheckOfferType:
      title: CheckOfferType
      type: string
      enum:
        - loan_offer
        - revolving_line_of_credit_offer
    CheckResponse:
      title: CheckResponse
      type: object
      properties:
        is_compliant:
          type: boolean
          description: Boolean indicating whether the offer passes our limits.
        apr:
          type: integer
          nullable: true
          description: >-
            The annual percentage rate for the offer. Null if not compliant or
            not applicable.
      required:
        - is_compliant
    CheckOffersResponse:
      title: CheckOffersResponse
      type: object
      additionalProperties:
        $ref: '#/components/schemas/CheckResponse'
    Transaction:
      title: Transaction
      oneOf:
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - disbursement
            - $ref: '#/components/schemas/Disbursement'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - payment
            - $ref: '#/components/schemas/Payment'
          required:
            - type
    TransactionRefundResponse:
      title: TransactionRefundResponse
      type: object
      properties:
        original:
          $ref: '#/components/schemas/Transaction'
          description: The unique identifier of the transaction that was refunded
        refunded:
          $ref: '#/components/schemas/RefundedTransaction'
          description: The unique identifier of the transaction that was refunded
      required:
        - original
        - refunded
    FacilityId:
      title: FacilityId
      type: string
    DisbursementId:
      title: DisbursementId
      type: string
    Statement:
      title: Statement
      type: object
      properties:
        id:
          type: string
          description: The id of the statement
          example: stmt_deb6aba913d84feb987934f50c32bf03
        statement_date:
          type: string
          description: The end date of the statement (YYYY-MM-DD)
          example: '2023-03-17'
        statement_start_date:
          type: string
          format: date-time
          description: The start date of the statement (YYYY-MM-DD)
          example: '2024-06-17T00:00:00.000Z'
        balance_due:
          type: integer
          description: The balance due at the time of statement creation, in cents
          example: 500000
        current_principal_balance:
          type: integer
          description: The principal balance of the statement, in cents
          example: 500000
        current_interest_balance:
          type: integer
          description: The interest balance of the statement, in cents
          example: 10000
        interest_charged:
          type: integer
          description: The interest balance of the statement, in cents
          example: 0
        due_date:
          type: string
          description: The due date of the statement (YYYY-MM-DD)
          example: '2023-03-17'
        transactions:
          $ref: '#/components/schemas/FacilityTransactionItems'
          description: >-
            An array of transactions made (scoped to the period of the
            statement)
        payments:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
          description: An array of payments made (scoped to the period of the statement)
        disbursements:
          type: array
          items:
            $ref: '#/components/schemas/Disbursement'
          description: >-
            An array of disbursements made (scoped to the period of the
            statement)
        facility_id:
          $ref: '#/components/schemas/FacilityId'
        url:
          type: string
          description: The url of the statement pdf
          example: >-
            https://app.docspring.com/submissions/sub_gjX2LS7c6FjqZt12hQ/download
        created_on:
          type: string
          format: date-time
          description: Timestamp the statement object is created on
          example: '2023-02-27T00:00:00Z'
      required:
        - id
        - statement_date
        - statement_start_date
        - balance_due
        - current_principal_balance
        - current_interest_balance
        - interest_charged
        - due_date
        - transactions
        - payments
        - disbursements
        - facility_id
        - url
        - created_on
    Disbursement:
      title: Disbursement
      type: object
      properties:
        id:
          type: string
          description: The id of the disbursement
          example: dsb_18e5a3726b3943cda2635f40e1041ba4
        facility_id:
          $ref: '#/components/schemas/FacilityId'
        amount:
          type: integer
          description: The amount of the disbursement, in cents (e.g. 1000 = $10.00)
          example: 100000
        status:
          $ref: '#/components/schemas/TransferStatus'
          description: The status of the disbursement
        failure_reason:
          type: string
          nullable: true
          description: A reason for the failure if any exists
        date:
          type: string
          nullable: true
          description: The date of the disbursement (YYYY-MM-DD)
        created_on:
          type: string
          format: date-time
          description: Timestamp the disbursement object is created on
          example: '2023-02-27T00:00:00Z'
        transfer_type:
          $ref: '#/components/schemas/DisbursementTransferType'
          description: >-
            The type of transfer that the disbursement was (ACH, ledger only, or
            special cases like refunds)
      required:
        - id
        - facility_id
        - amount
        - status
        - created_on
        - transfer_type
    DisbursementRequest:
      title: DisbursementRequest
      type: object
      properties:
        amount:
          type: integer
          description: The amount of the disbursement, in cents (e.g. 1000 = $10.00)
          example: 100000
        disbursement_bank_account:
          $ref: '#/components/schemas/BankAccount'
          nullable: true
          description: The bank account to disburse to
        transfer_type:
          $ref: '#/components/schemas/TransferType'
          description: >-
            The type of transfer to use for the disbursement (ACH or none
            [ledger only])
        settlement_priority:
          $ref: '#/components/schemas/SettlementPriorities'
          nullable: true
          description: The speed at which the transfer should execute when ACH is used
      required:
        - amount
        - transfer_type
    Document:
      title: Document
      type: object
      properties:
        document_url:
          type: string
          description: The URL where the document can be accessed.
          example: https://example.com/document.pdf
        id:
          type: string
          description: The unique identifier for the document.
          example: doc_1234567890abcdef
      required:
        - document_url
        - id
    FacilityDocument:
      title: FacilityDocument
      type: object
      properties:
        document_url:
          type: string
          description: The URL where the document can be accessed.
          example: https://example.com/document.pdf
        document_id:
          type: string
          description: The unique identifier for the document.
          example: doc_1234567890abcdef
      required:
        - document_url
        - document_id
    Documents:
      title: Documents
      type: object
      properties:
        unsigned_credit_agreement:
          $ref: '#/components/schemas/FacilityDocument'
          nullable: true
          description: The URL and ID for the unsigned credit agreement document.
        signed_credit_agreement:
          $ref: '#/components/schemas/FacilityDocument'
          nullable: true
          description: The URL and ID for the signed credit agreement document.
        unsigned_ach_authorization:
          $ref: '#/components/schemas/FacilityDocument'
          nullable: true
          description: The URL and ID for the unsigned ACH authorization document.
        unsigned_autopay_ach_authorization:
          $ref: '#/components/schemas/FacilityDocument'
          nullable: true
          description: The URL and ID for the unsigned autopay ACH authorization document.
        signed_ach_authorization:
          $ref: '#/components/schemas/FacilityDocument'
          nullable: true
          description: The URL and ID for the signed ACH authorization document.
        signed_autopay_ach_authorization:
          $ref: '#/components/schemas/FacilityDocument'
          nullable: true
          description: The URL and ID for the signed autopay ACH authorization document.
    FacilityBalances:
      title: FacilityBalances
      type: object
      properties:
        current_balance:
          type: integer
          description: >-
            The current balance of the loan, in cents (includes everything -
            principal, interest, fees, etc.)
          example: 500000
        principal_balance:
          type: integer
          description: The principal balance of the loan, in cents
          example: 500000
        interest_balance:
          type: integer
          description: The interest balance of the loan, in cents
          example: 0
        payoff_balance:
          type: integer
          description: >-
            The payoff balance of the loan, in cents (if the facility is in
            grace then this balance is only principal; otherwise it matches
            current_balance)
          example: 500000
      required:
        - current_balance
        - principal_balance
        - interest_balance
        - payoff_balance
    Facility:
      title: Facility
      type: object
      properties:
        id:
          $ref: '#/components/schemas/FacilityId'
        application_id:
          $ref: '#/components/schemas/ApplicationId'
          description: >-
            The `application_id` of the corresponding loan application for the
            facility
        borrower_id:
          $ref: '#/components/schemas/ConsumerBorrowerId'
          description: The `borrower_id` of the corresponding borrower the facility is for
        loan_agreement_id:
          type: string
          description: >-
            The `loan_agreement_id` of the corresponding loan agreement the
            facility is for
          example: doc_43da3b3f95c745e1985a71e9a00d6c27
        credit_type:
          $ref: '#/components/schemas/CreditType'
          description: The type of credit production.
        created_on:
          type: string
          format: date-time
          description: Timestamp the loan agreement object is created on
          example: '2023-05-12T19:46:09.293Z'
        status:
          $ref: '#/components/schemas/CreditStatus'
          description: The status of the facility.
        account_number:
          type: string
          description: The account number of the credit facility
          example: '401542198'
        amortization_schedule:
          $ref: '#/components/schemas/AmmortizationSchedules'
          nullable: true
          description: The amortization schedule of the loan
        repayment_bank_details:
          $ref: '#/components/schemas/BankAccount'
          nullable: true
          description: The bank account information used to repay the loan
        transactions:
          $ref: '#/components/schemas/FacilityTransactionItems'
          description: An array of transactions made (empty if no payments are due)
        statements:
          type: array
          items:
            $ref: '#/components/schemas/Statement'
          description: An array of statements for the loan (empty if no statements exist)
        balance:
          type: integer
          nullable: true
          description: The remaining balance of the loan, in cents
        balances:
          $ref: '#/components/schemas/FacilityBalances'
          description: A deeper view of what makes up the facility balance, all in cents
        interest_balance:
          type: integer
          nullable: true
          description: >-
            The current interest balance of the loan, in cents (deprecated - see
            balances field)
        payoff_balance:
          type: integer
          nullable: true
          description: >-
            The current payoff balance of the loan, in cents (deprecated - see
            balances field)
        origination_date:
          type: string
          nullable: true
          description: The date the loan was originated (YYYY-MM-DD)
        disbursement_date:
          type: string
          nullable: true
          description: The date the loan was disbursed (YYYY-MM-DD)
        remaining_term:
          type: integer
          nullable: true
          description: The remaining term of the loan, in months
        payments_due:
          $ref: '#/components/schemas/PaymentsDue'
          description: An array of payments due (empty if no payments are due)
        next_payment_amount:
          type: integer
          nullable: true
          description: The amount of the next payment, in cents
        next_payment_due_date:
          type: string
          nullable: true
          description: The date the next payment is due (YYYY-MM-DD)
        current_payment_due_date:
          type: string
          nullable: true
          description: The date the current payment is due (YYYY-MM-DD)
        last_payment_date:
          type: string
          nullable: true
          description: The date the last payment was made (YYYY-MM-DD)
        principal_paid_thru:
          type: string
          nullable: true
          description: The date the principal is paid through (YYYY-MM-DD)
        next_billing_date:
          type: string
          nullable: true
          description: The next billing date of the loan (YYYY-MM-DD)
        interest_accrued_thru:
          type: string
          nullable: true
          description: The date the interest is accrued through (YYYY-MM-DD)
        next_accrual_cutoff_date:
          type: string
          nullable: true
          description: The next accrual cutoff date of the loan (YYYY-MM-DD)
        scheduled_payoff_date:
          type: string
          nullable: true
          description: The scheduled payoff date of the loan (YYYY-MM-DD)
        terms:
          $ref: '#/components/schemas/Offer'
          description: An object containing a summary of the terms of the facility.
        autopay:
          $ref: '#/components/schemas/Autopay'
          nullable: true
          description: Whether or not autopay is enabled for the facility.
        documents:
          $ref: '#/components/schemas/Documents'
          nullable: true
          description: The documents associated with the facility
        remaining_statement_balance:
          type: integer
          description: >-
            The amount, in cents, of the last statement balance, less any
            payments made after the statement was created. Will be set to null
            until first statement is created.
          example: 7500
        remaining_minimum_balance:
          type: integer
          description: >-
            The minimum due, in cents, of the last statement minimum, less any
            payments made since the statement was created. Will be set to null
            until first statement is created.
          example: 7500
        last_statement_info:
          $ref: '#/components/schemas/LastStatementInfo'
          nullable: true
          description: The last statement information including date/amount.
        in_grace_period:
          type: boolean
          nullable: true
          description: Whether the facility is in a grace period
        in_introductory_promo_period:
          type: boolean
          nullable: true
          description: Whether the facility is in an introductory promotional period
      required:
        - id
        - application_id
        - borrower_id
        - loan_agreement_id
        - credit_type
        - created_on
        - status
        - account_number
        - transactions
        - statements
        - balances
        - payments_due
        - terms
        - remaining_statement_balance
        - remaining_minimum_balance
    LastStatementInfo:
      title: LastStatementInfo
      type: object
      properties:
        last_statement_date:
          type: string
          description: The date of the last statement (2024-06-01T00:00:00.000Z)
          example: '2024-06-01T00:00:00.000Z'
        last_statement_amount:
          type: integer
          description: The amount of the last statement, in cents
          example: 47000
      required:
        - last_statement_date
        - last_statement_amount
    LimitReductionReasons:
      title: LimitReductionReasons
      type: string
      enum:
        - change_in_credit_score
        - high_credit_utilization
        - late_payments
        - inactivity
        - economic_downturn
        - negative_changes_in_financial_situation
        - increased_debt_levels
        - credit_report_changes
        - regulatory_or_internal_policy_changes
        - fraud_prevention
    CreditStatus:
      title: CreditStatus
      type: string
      enum:
        - active
        - closed
    FacilityTransactionItem:
      title: FacilityTransactionItem
      type: object
      properties:
        amount:
          type: integer
          description: The amount of the transaction, in cents (e.g. 1000 = $10.00)
        net_amount:
          type: integer
          description: >-
            The net amount of the transaction, meaning positive or negative
            depending on the effect on the ledger, in cents (e.g. 1000 = $10.00)
        transaction_date:
          type: string
          description: The date of the transaction (YYYY-MM-DD)
        effective_date:
          type: string
          description: The effective date of the transaction (YYYY-MM-DD)
        description:
          type: string
          description: A description of the transaction
        category:
          $ref: '#/components/schemas/FacilityTransactionCategory'
          description: The category of the transaction
        transaction_type:
          $ref: '#/components/schemas/FacilityTransactionType'
          description: >-
            The type of transaction relative to the effect on the balance
            (CREDIT = balance decrease; DEBIT = balance increase; NONE = no
            balance change)
        transaction_iso_timestamp:
          type: string
          format: date-time
          description: The ISO timestamp of the transaction
      required:
        - amount
        - net_amount
        - transaction_date
        - effective_date
        - description
        - category
        - transaction_type
        - transaction_iso_timestamp
    FacilityTransactionType:
      title: FacilityTransactionType
      type: string
      enum:
        - NONE
        - CREDIT
        - DEBIT
    FacilityTransactionCategory:
      title: FacilityTransactionCategory
      type: string
      enum:
        - DRAWER_RESERVE_PURCHASE_IN_FROM_RESERVE_BANK
        - REVERSE_PURCHASE_IN_FROM_RESERVE_BANK
        - CASH_DRAWER_SELL_OFF_FUNDS_OUT_TO_RESERVE
        - REVERSE_SELL_OFF_FUNDS_OUT_TO_RESERVE
        - CASH_DRAWER_RESERVE_BANK_DEPOSIT_OUT
        - REVERSE_BANK_DEPOSIT_OUT
        - CASH_DRAWER_RESERVE_RECONCILING_ERROR_CORRECTION
        - REVERSE_RECONCILING_ERROR_CORRECTION
        - TRUST_DEPOSIT
        - REVERSE_TRUST_DEPOSIT
        - TRUST_DISBURSEMENT
        - REVERSE_TRUST_DISBURSEMENT
        - TRUST_DISBURSEMENT_SERVICING_FEE
        - REVERSE_TRUST_DISBURSEMENT_SERVICING_FEE
        - TRUST_RECEIVABLE_SERVICING_FEE
        - REVERSE_TRUST_RECEIVABLE_SERVICING_FEE
        - SUBSIDIZED_INTEREST_RECEIVABLE
        - REVERSE_SUBSIDIZED_INTEREST_RECEIVABLE
        - SUBSIDIZED_INTEREST_PAYABLE
        - REVERSE_SUBSIDIZED_INTEREST_PAYABLE
        - REVERSE_DEALER_RESERVE_RECEIVABLE
        - DISBURSEMENT
        - REVERSE_DISBURSEMENT
        - CRED_LINE_LIMIT
        - REVERSE_CRED_LINE_LIMIT
        - PRECOMPUTED_INTEREST
        - REVERSE_PRECOMPUTED_INTEREST
        - FA_PRECOMPUTED_INTEREST
        - REVERSE_FA_PRECOMPUTED_INTEREST
        - PRINCIPAL_BILLING
        - REVERSE_PRINCIPAL_BILLING
        - INTEREST_BILLING
        - REVERSE_INTEREST_BILLING
        - PRINCIPAL_AND_INTEREST_BILLING
        - REVERSE_PRINCIPAL_AND_INTEREST_BILLING
        - PRINCIPAL_BALLOON_BILLING
        - REVERSE_PRINCIPAL_BALLOON_BILLING
        - INTEREST_BALLOON_BILLING
        - REVERSE_INTEREST_BALLOON_BILLING
        - DEFERRED_INTEREST_BILLING
        - REVERSE_DEFERRED_INTEREST_BILLING
        - ADB_INTEREST_BILLING
        - REVERSE_ADB_INTEREST_BILLING
        - ADB_INTEREST_BILLING_ADJUSTMENT
        - REVERSE_ADB_INTEREST_BILLING_ADJUSTMENT
        - LATE_FEE
        - REVERSE_LATE_FEE
        - CREDIT_LINE_ADVANCE_FEE
        - REVERSE_CREDIT_LINE_ADVANCE_FEE
        - CREDIT_LINE_OVERDRAFT_FEE
        - REVERSE_CREDIT_LINE_OVERDRAFT_FEE
        - IMPOUND_ASSESSMENT
        - REVERSE_IMPOUND_ASSESSMENT
        - NSF_FEE
        - REVERSE_NSF_FEE
        - AMORTIZED_INCOME_FEE
        - REVERSE_AMORTIZED_INCOME_FEE
        - AMORTIZATION_OF_INCOME_FEE
        - REVERSE_AMORTIZATION_OF_INCOME_FEE
        - AMORTIZED_EXPENSE_FEE
        - REVERSE_AMORTIZED_EXPENSE_FEE
        - AMORTIZATION_OF_EXPENSE_FEE
        - REVERSE_AMORTIZATION_OF_EXPENSE_FEE
        - PRINCIPAL_PAYMENT
        - REVERSE_PRINCIPAL_PAYMENT
        - INTEREST_PAYMENT
        - REVERSE_INTEREST_PAYMENT
        - P_PLUS_I_PRINCIPAL_PAYMENT
        - REVERSE_P_PLUS_I_PRINCIPAL_PAYMENT
        - P_PLUS_I_INTEREST_PAYMENT
        - REVERSE_P_PLUS_I_INTEREST_PAYMENT
        - PRINCIPAL_BALLOON_PAYMENT
        - REVERSE_PRINCIPAL_BALLOON_PAYMENT
        - INTEREST_BALLOON_PAYMENT
        - REVERSE_INTEREST_BALLOON_PAYMENT
        - DEFERRED_INTEREST_PAYMENT
        - REVERSE_DEFERRED_INTEREST_PAYMENT
        - RULE_OF_78S_ACTUARIAL_PAYMENT
        - REVERSE_RULE_OF_78S_ACTUARIAL_PAYMENT
        - PRINCIPAL_REDUCTION
        - REVERSE_PRINCIPAL_REDUCTION
        - INTEREST_REDUCTION
        - REVERSE_INTEREST_REDUCTION
        - FEE_REDUCTION
        - REVERSE_FEE_REDUCTION
        - LATE_FEE_REDUCTION
        - DEFERRED_INTEREST_REDUCTION
        - REVERSE_DEFERRED_INTEREST_REDUCTION
        - LATE_FEE_PAYMENT
        - REVERSE_LATE_FEE_PAYMENT
        - CREDIT_LINE_ADVANCE_FEE_PAYMENT
        - REVERSE_CREDIT_LINE_ADVANCE_FEE_PAYMENT
        - CREDIT_LINE_OVERDRAFT_FEE_PAYMENT
        - REVERSE_CREDIT_LINE_OVERDRAFT_FEE_PAYMENT
        - DOWN_PAYMENT
        - REVERSE_DOWN_PAYMENT
        - IMPOUND_PAYMENT
        - REVERSE_IMPOUND_PAYMENT
        - NSF_FEE_PAYMENT
        - REVERSE_NSF_FEE_PAYMENT
        - INTEREST_INCOME
        - REVERSE_INTEREST_INCOME
        - DISCOUNT_INCOME
        - REVERSE_DISCOUNT_INCOME
        - SHORT_TERM_CAPITAL_GAIN
        - REVERSE_SHORT_TERM_CAPITAL_GAIN
        - LONG_TERM_CAPITAL_GAIN
        - REVERSE_LONG_TERM_CAPITAL_GAIN
        - INTEREST_FREE_PRINCIPAL_ADJ
        - REVERSE_INTEREST_FREE_PRINCIPAL_ADJ
        - INTEREST_FREE_INTEREST_ADJ
        - REVERSE_INTEREST_FREE_INTEREST_ADJ
        - CAPITALIZE_OVERPAID_INTEREST
        - REVERSE_CAPITALIZE_OVERPAID_INTEREST
        - UNEARNED_ADDON_INTEREST_REDUCTION
        - REVERSE_UNEARNED_ADDON_INTEREST_REDUCTION
        - UNEARNED_ADDON_INTEREST_ADDITION
        - REVERSE_UNEARNED_ADDON_INTEREST_ADDITION
        - CAPITALIZE_INTEREST
        - REVERSE_CAPITALIZE_INTEREST
        - COMPOUND_INTEREST_BALANCE_ADJUSTMENT
        - REVERSE_COMPOUND_INTEREST_BALANCE_ADJUSTMENT
        - CAPITALIZE_DEFERRED_INTEREST
        - REVERSE_CAPITALIZE_DEFERRED_INTEREST
        - CAPITALIZE_OVERPAID_DEFERRED_INTEREST
        - REVERSE_CAPITALIZE_OVERPAID_DEFERRED_INTEREST
        - SERVICING_FEE
        - REVERSE_SERVICING_FEE
    FacilityTransactionItems:
      title: FacilityTransactionItems
      type: array
      items:
        $ref: '#/components/schemas/FacilityTransactionItem'
    PaymentDue:
      title: PaymentDue
      type: object
      properties:
        payment_amount:
          type: integer
          description: The amount of the payment, in cents (e.g. 1000 = $10.00)
        payment_amount_remaining:
          type: integer
          description: The amount of the payment remaining, in cents (e.g. 1000 = $10.00)
        payment_due_date:
          type: string
          description: The date the payment is due (YYYY-MM-DD)
      required:
        - payment_amount
        - payment_amount_remaining
        - payment_due_date
    PaymentsDue:
      title: PaymentsDue
      type: array
      items:
        $ref: '#/components/schemas/PaymentDue'
    PayoffAmount:
      title: PayoffAmount
      type: object
      properties:
        amount:
          type: integer
          description: The amount of the payoff, in cents (e.g. 1000 = $10.00)
          example: 100000
        date:
          type: string
          description: The date the payoff is due (YYYY-MM-DD)
          example: '2023-05-12'
      required:
        - amount
        - date
    PayoffAmounts:
      title: PayoffAmounts
      type: array
      items:
        $ref: '#/components/schemas/PayoffAmount'
    AmmortizationSchedules:
      title: AmmortizationSchedules
      type: array
      items:
        $ref: '#/components/schemas/AmortizationSchedule'
    TransactionId:
      title: TransactionId
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - disbursementId
            value:
              $ref: '#/components/schemas/DisbursementId'
          required:
            - type
        - type: object
          properties:
            type:
              type: string
              enum:
                - paymentId
            value:
              $ref: '#/components/schemas/PaymentId'
          required:
            - type
    RefundMetadata:
      title: RefundMetadata
      type: object
      properties:
        original_payment_id:
          $ref: '#/components/schemas/PaymentId'
          nullable: true
          description: The id of the original payment that was refunded
        original_disbursement_id:
          $ref: '#/components/schemas/DisbursementId'
          nullable: true
          description: The id of the original disbursement that was refunded
        memo:
          type: string
          nullable: true
          description: A memo about the refund
    RefundedDisbursement:
      title: RefundedDisbursement
      type: object
      properties:
        refund_metadata:
          $ref: '#/components/schemas/RefundMetadata'
          description: Metadata about the original transaction being refunded
      required:
        - refund_metadata
      allOf:
        - $ref: '#/components/schemas/Disbursement'
    RefundedPayment:
      title: RefundedPayment
      type: object
      properties:
        refund_metadata:
          $ref: '#/components/schemas/RefundMetadata'
          description: Metadata about the original transaction being refunded
      required:
        - refund_metadata
      allOf:
        - $ref: '#/components/schemas/Payment'
    RefundedTransaction:
      title: RefundedTransaction
      oneOf:
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - disbursement
            - $ref: '#/components/schemas/RefundedDisbursement'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - payment
            - $ref: '#/components/schemas/RefundedPayment'
          required:
            - type
    AmortizationSchedule:
      title: AmortizationSchedule
      type: object
      properties:
        payment_date:
          type: string
          description: The date of this payment in the schedule
          example: '2023-11-02'
        interest_payment_amount:
          type: integer
          description: >-
            The amount in cents of the payment going towards interest (e.g. 0 is
            $0.00)
          example: 0
        principal_payment_amount:
          type: integer
          description: >-
            The amount in cents of the payment going towards principal (e.g.
            8333 is $83.33)
          example: 8333
        other_payment_amount:
          type: integer
          description: Any other payments in cents to be made (e.g. 0 is $0.00)
          example: 0
        total_payment_amount:
          type: integer
          description: >-
            The total payment in cents to be made comprised of all of the other
            payment amount fields (e.g. 8333 is $83.33)
          example: 8333
        balance_amount:
          type: integer
          description: >-
            The balance in cents that is left after making the
            `total_payment_amount` (e.g. 91667 is $916.67)
          example: 91667
        item_index:
          type: integer
          description: >-
            The number representing the order of the item in the list (one
            based)
          example: 1
      required:
        - payment_date
        - interest_payment_amount
        - principal_payment_amount
        - other_payment_amount
        - total_payment_amount
        - balance_amount
        - item_index
    LoanAgreementId:
      title: LoanAgreementId
      type: string
    LoanAgreement:
      title: LoanAgreement
      type: object
      properties:
        id:
          $ref: '#/components/schemas/LoanAgreementId'
        application_id:
          type: string
          description: >-
            The `application_id` of the corresponding loan application the
            agreement is for
          example: app_a9d2f388030d4f4296f80fc327e08d0d
        created_on:
          type: string
          format: date-time
          description: Timestamp the loan agreement object is created on
          example: '2022-12-31T20:47:38.152Z'
        document_url:
          type: string
          description: Url where the loan agreement document is hosted
          example: https://example.com/document-endpoint-unique-hash
        signature_timestamp:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of when e-signature is completed
        status:
          $ref: '#/components/schemas/LoanAgreementStatus'
          description: The status of the document
        type:
          $ref: '#/components/schemas/DocumentType'
          description: The type of document
      required:
        - id
        - application_id
        - created_on
        - document_url
        - status
        - type
    LoanAgreementStatus:
      title: LoanAgreementStatus
      type: string
      enum:
        - pending_signature
        - signed
        - expired
    DocumentType:
      title: DocumentType
      type: string
      enum:
        - credit_agreement
        - ach_authorization
        - autopay_ach_authorization
        - credit_disclosure
    SignLoanAgreementResponse:
      title: SignLoanAgreementResponse
      type: object
      properties:
        status:
          $ref: '#/components/schemas/LoanAgreementStatus'
        id:
          $ref: '#/components/schemas/LoanAgreementId'
        application_id:
          $ref: '#/components/schemas/ApplicationId'
        signature_timestamp:
          type: string
          format: date-time
          nullable: true
        document_url:
          type: string
          example: https://example.com/document-endpoint-unique-hash
        created_on:
          type: string
          format: date-time
          example: '2022-12-31T21:07:16.642Z'
        type:
          $ref: '#/components/schemas/DocumentType'
      required:
        - status
        - id
        - application_id
        - document_url
        - created_on
        - type
    PaymentId:
      title: PaymentId
      type: string
    PaymentRequest:
      title: PaymentRequest
      type: object
      properties:
        facility_id:
          type: string
          description: The facility_id of the credit facility to make a payment for
          example: fac_18e5a3726b3943cda2635f40e1041ba4
        amount:
          type: integer
          description: The amount of the payment, in cents
          example: 100000
        transfer_type:
          $ref: '#/components/schemas/TransferType'
          description: >-
            The type of transfer to use for the payment (ACH or none [ledger
            only])
        settlement_priority:
          $ref: '#/components/schemas/SettlementPriorities'
          nullable: true
          description: The speed at which the transfer should execute when ACH is used
        ach_authorization_id:
          type: string
          nullable: true
          description: >-
            The Document ID of an unused ACH authorization document (only
            required when `transfer_type` is not `none`)
      required:
        - facility_id
        - amount
        - transfer_type
    Payment:
      title: Payment
      type: object
      properties:
        id:
          $ref: '#/components/schemas/PaymentId'
        amount:
          type: integer
          description: The amount of the payment, in cents
          example: 100000
        facility_id:
          type: string
          description: The facility_id of the credit facility to make a payment for
          example: fac_18e5a3726b3943cda2635f40e1041ba4
        status:
          $ref: '#/components/schemas/TransferStatus'
          description: The status of the payment
        transfer_type:
          $ref: '#/components/schemas/PaymentTransferType'
          description: The type of ACH transfer
        created_on:
          type: string
          format: date-time
          description: Timestamp the payment is created on
          example: '2023-02-27T00:00:00Z'
        failure_reason:
          type: string
          nullable: true
          description: A reason for the failure if one exists
        is_autopay:
          type: boolean
          nullable: true
          description: If the payment was a result of an autopay
      required:
        - id
        - amount
        - facility_id
        - status
        - transfer_type
        - created_on
    ISODate:
      title: ISODate
      type: string
      description: An ISO 8601 date string in the format YYYY-MM-DD
    ReconciliationReportCadence:
      title: ReconciliationReportCadence
      type: string
      enum:
        - daily
    ReconciliationReportType:
      title: ReconciliationReportType
      type: string
      enum:
        - transaction
        - balance
    BalanceReport:
      title: BalanceReport
      type: object
      properties:
        facility_id:
          $ref: '#/components/schemas/FacilityId'
          description: The ID of the facility
        borrower_id:
          $ref: '#/components/schemas/ConsumerBorrowerId'
          description: The ID of the borrower
        report_date:
          $ref: '#/components/schemas/ISODate'
          description: >-
            The date of the report - this is the same as the date in the path
            parameter.
        balance:
          type: integer
          description: >-
            The balance EOD in Pacific Time in cents for the facility.  This
            field matches the facility balance field and handles  showing
            balance based on if the facility is in grace period  or not.
          example: 100000
        payoff_balance:
          type: integer
          description: >-
            The payoff balance in cents for the facility. During grace  period
            this is the principal balance; out of grace this is  the
            current/total balance.
          example: 100000
        current_balance:
          type: integer
          description: >-
            The current balance in cents for the facility. Regardless of  grace
            period this always includes the entire balance (principal, interest,
            fees).
          example: 100000
        interest_balance:
          type: integer
          description: >-
            The interest balance in cents for the facility. This is the 
            interest accrued on the facility.
          example: 0
        in_grace_period:
          type: boolean
          description: >-
            A boolean indicating if the facility is in grace period. During
            grace period the payoff_balance is the facility's balance field and
            what is due without interest.
          example: true
        in_introductory_promo_period:
          type: boolean
          description: >-
            A boolean indicating if the facility is in the introductory promo
            period. During this period the facility terms can be different than
            the standard terms once the grace period is over. Typically this
            would be a 0% interest for a period of X days.
          example: false
      required:
        - facility_id
        - borrower_id
        - report_date
        - balance
        - payoff_balance
        - current_balance
        - interest_balance
        - in_grace_period
        - in_introductory_promo_period
    BalanceReportResponse:
      title: BalanceReportResponse
      type: object
      properties:
        facility_balances:
          type: array
          items:
            $ref: '#/components/schemas/BalanceReport'
          description: >-
            This is a list of balance reports for all the facilities for the
            given date.
        cadence:
          $ref: '#/components/schemas/ReconciliationReportCadence'
          description: >-
            The cadence that the report is generated in. For now, "daily"
            cadence is the only  one that exists.
        type:
          $ref: '#/components/schemas/ReconciliationReportType'
          description: >-
            The type of report that is being generated. For now, "balance" is
            the only type  that exists.
        report_date:
          $ref: '#/components/schemas/ISODate'
          description: >-
            The date of the report - this is the same as the date in the path
            parameter.
        last_updated:
          type: string
          format: date-time
          description: The timestamp when the report was last updated.
          example: '2024-10-02T00:00:00Z'
      required:
        - facility_balances
        - cadence
        - type
        - report_date
        - last_updated
    ReconciliationReportTransaction:
      title: ReconciliationReportTransaction
      type: object
      description: A transaction that make up the ledger of the facility
      properties:
        facility_id:
          $ref: '#/components/schemas/FacilityId'
          description: The ID of the facility
        borrower_id:
          $ref: '#/components/schemas/ConsumerBorrowerId'
          description: The ID of the borrower
      required:
        - facility_id
        - borrower_id
      allOf:
        - $ref: '#/components/schemas/FacilityTransactionItem'
    ReconciliationReportTransactions:
      title: ReconciliationReportTransactions
      type: array
      items:
        $ref: '#/components/schemas/ReconciliationReportTransaction'
      description: >-
        A list of transactions for the day that make up the ledger of the
        facility
    TransactionReportResponse:
      title: TransactionReportResponse
      type: object
      properties:
        facility_transactions:
          type: array
          items:
            $ref: '#/components/schemas/ReconciliationReportTransactions'
          description: >-
            A list of transactions for the day that make up the ledger of the
            facility
        payments:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
          description: A list of payments for the day
        disbursements:
          type: array
          items:
            $ref: '#/components/schemas/Disbursement'
          description: A list of disbursements for the day
        cadence:
          $ref: '#/components/schemas/ReconciliationReportCadence'
          description: >-
            The cadence that the report is generated in. For now, "daily"
            cadence is the only  one that exists.
        type:
          $ref: '#/components/schemas/ReconciliationReportType'
          description: >-
            The type of report that is being generated. For now, "balance" is
            the only type  that exists.
        report_date:
          $ref: '#/components/schemas/ISODate'
          description: >-
            The date of the report - this is the same as the date in the path
            parameter.
        last_updated:
          type: string
          format: date-time
          description: The timestamp when the report was last updated.
          example: '2024-10-02T00:00:00Z'
      required:
        - facility_transactions
        - payments
        - disbursements
        - cadence
        - type
        - report_date
        - last_updated
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
servers:
  - url: https://production.pier-finance.com/api
    description: Production
  - url: https://sandbox.pier-finance.com/api
    description: Sandbox
