openapi: 3.0.0
info:
  title: Payout API
  contact:
    name: API Integration Support
    email: integration@dintero.com
  description: >
    API for the payout service


    # Changelog


    All notable changes to the API.


    ## 2025-10-21


    new: Generate proposals


    > - [POST
    /v/accounts/{aid}/payout/admin/payout/generate-proposals](/payout-api/admin-proposal/aid_admin_proposals_generate)


    ## 2025-06-26


    new: Fail a proposal-item


    > - [POST
    /v/accounts/{aid}/payout/admin/payout/proposal-item/{proposal-item-id}/fail](/payout-api/admin-proposal/aid_admin_proposal_item_fail)


    ## 2025-05-01


    new: Add support for new block rule types `owner-orgno` and
    `owner-verified-id`

    >

    > - [GET
    /v/accounts/{aid}/payout/admin/block-rules](/payout-api/admin-block-rule/aid_admin_block_rules_get)

    > - [POST
    /v/accounts/{aid}/payout/admin/block-rules](/payout-api/admin-block-rule/aid_admin_block_rule_post)

    > - [GET
    /v/accounts/{aid}/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_get)

    > - [PATCH
    /v/accounts/{aid}/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_patch)

    > - [POST
    /v/accounts/{aid}/payout/admin/block-rules-test](/payout-api/admin-block-rule/aid_admin_block_rule_test)


    ## 2025-02-20


    new: Add support for `payout_minimum_amount` configuration to limit

    payout for merchant account and specific payout destinations (sellers)


    > - [POST
    /v2/accounts/{aid}/payout/payout-destinations](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_configs_post)

    > - [GET
    /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_config_get)

    > - [PATCH
    /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_config_patch)


    ## 2025-02-10


    new: Update bank accounts with `owner_verified_id` field.


    ## 2025-02-03


    new: Add endpoints for managing retained transactions


    > - [GET
    /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/retained-transactions](/payout-api/v2-retained-transactions/v2_aid_payout_destination_retained_get)

    > - [PUT
    /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/retained-transactions/{payout_event_correlation_id}/release](/payout-api/v2-retained-transactions/v2_aid_payout_destination_retained_release_put)


    ## 2025-01-03


    new: Add description field to proposal response


    ## 2024-11-19


    new: Add admin endpoint for unpaid debt


    > - [GET
    /v2/accounts/{aid}/payout/admin/unpaid-debt](/payout-api/v2-admin-ledger/v2_aid_admin_unpaid_debt_get)


    ## 2024-10-01


    > change: Add new configuration option

    > `fund_transfers.allow_unknown_destination_payout_destination_id`, a new

    > configuration option to allow fund transfers to an unknown payout
    destination

    > - [PATCH
    /v/payout/admin/merchants/{mid}/config](/payout-api/admin-config-merchants/aid_admin_merchant_config_patch)


    > new: Add support for block rule based on payout destination.

    >

    > - [GET
    /v/accounts/{aid}/payout/admin/block-rules](/payout-api/admin-block-rule/aid_admin_block_rules_get)

    > - [POST
    /v/accounts/{aid}/payout/admin/block-rules](/payout-api/admin-block-rule/aid_admin_block_rule_post)

    > - [GET
    /v/accounts/{aid}/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_get)

    > - [PATCH
    /v/accounts/{aid}/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_patch)

    > - [POST
    /v/accounts/{aid}/payout/admin/block-rules-test](/payout-api/admin-block-rule/aid_admin_block_rule_test)


    ## 2024-09-01

    > new: Support merchants adding buffer amounts to their payout destinations

    > - [POST
    /v1/accounts/{aid}/payout/payout_destinations](/payout-api/config-payout-destinations/aid_payout_destination_configs_post)

    > - [POST
    /v2/accounts/{aid}/payout/payout_destinations](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_configs_post)

    > - [PATCH
    /v1/accounts/{aid}/payout/payout_destinations/{pid}](/payout-api/config-payout-destinations/aid_payout_destination_config_patch)

    > - [PATCH
    /v2/accounts/{aid}/payout/payout_destinations/{pid}](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_config_patch)


    ## 2024-07-01

    > new: Support adding a buffer amount to merchants and payout destinations

    > - [PATCH
    /v1/payout/admin/merchants/{mid}/config](/payout-api/admin-config-merchants/aid_admin_merchant_config_patch)

    > - [PATCH
    /v1/payout/admin/merchants/{mid}/payout_destinations/{pid}](/payout-api/admin-config-merchants/aid_admin_merchant_payout_destination_patch)


    ## 2024-03-01


    > new: New v2 of api endpoints using numbers in the smallest unit for the
    currency for monetary amounts


    > - [GET
    /v2/accounts/{aid}/payout/payout_destinations](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_configs_get)

    > - [POST
    /v2/accounts/{aid}/payout/payout_destinations](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_configs_post)

    > - [GET
    /v2/accounts/{aid}/payout/payout_destination/{pid}](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_config_get)

    > - [PATCH
    /v2/accounts/{aid}/payout/payout_destination/{pid}](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_config_patch)

    > - [DELETE
    /v2/accounts/{aid}/payout/payout_destination/{pid}](/payout-api/v2-config-payout-destinations/v2_aid_config_payout_destination_config_delete)

    > - [GET
    /v2/accounts/{aid}/payout/payout_destinations/{pid}/transfers](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_transfers_get)

    > - [GET
    /v2/accounts/{aid}/payout/payout_destinations/{pid}/balances](/payout-api/v2-config-payout-destinations/v2_aid_payout_destination_balance_get)

    > - [POST
    /v2/accounts/{aid}/payout/fund-transfers](/payout-api/v2-fund-transfers/v2_aid_payout_fund_transfers_post)



    ## 2024-02-15


    > new: Get a list of transfers for a payout destination configuration id

    > - [GET
    /v1/accounts/{aid}/payout/payout_destinations/{pid}/transfers](/payout-api/config-payout-destinations/aid_payout_destination_transfers_get)


    ## 2024-02-01


    > new: Filter on payout destination configurations by payout_destination_id
    and get et balances per payout destination configuration id

    > - [GET
    /v1/accounts/{aid}/payout/payout_destinations](/payout-api/config-payout-destinations/aid_payout_destination_configs_get)

    > - [GET
    /v1/accounts/{aid}/payout/payout_destinations/{pid}/balances](/payout-api/config-payout-destinations/aid_payout_destination_balance_get)


    ## 2023-11-01


    > **break**: Replace support for `write:payout:/admin/payment_approval`

    > scope with `write:payout:/admin/config_rfc_approval` in endpoints for

    > approving and rejecting a config RFC. The endpoints will now require

    > authorization with `admin:payout:/admin` and

    > `write:payout:/admin/config_rfc_approval` scope

    > - [POST
    /v/payout/admin/config-rfcs/:configRfcId/approve](/payout-api/admin-config-rfcs/aid_admin_config_rfc_approve)

    > - [POST
    /v/payout/admin/config-rfcs/:configRfcId/reject](/payout-api/admin-config-rfcs/aid_admin_config_rfc_reject)


    ## 2023-09-30


    > new: Support updating payout destination configuration

    > - [PATCH
    /v/payout/admin/merchants/{mid}/payout_destinations/{pid}](/payout-api/admin-config-merchants/aid_admin_merchant_payout_destination_patch)


    ## 2023-08-01


    > new: Support for syncing proposal status from items

    > - [POST
    /v/payout/admin/proposals/{proposal_id}/sync-status-from-items](/payout-api/admin-proposal/aid_admin_proposal_sync_status_from_items_post)


    ## 2022-10-06


    > Payout destinations are now referred to as Sellers, the data model is
    unchanged.


    ## 2022-07-01


    > new: Support for transfer funds between payout destinations

    > - [POST
    /v/payout/fund-transfers](/payout-api/fund-transfers/aid_payout_fund_transfers_post)


    > new: Support for creating `debt-transfer-correction` corrections

    > - [POST
    /v/payout/admin/ledger-corrections](/payout-api/admin-ledger/aid_ledger_corrections_post)


    > new: Route for admin merchant config

    > - [PATCH
    /v/payout/admin/merchants/{mid}/config](/payout-api/admin-config-merchants/aid_admin_merchant_config_patch)


    ## 2022-05-01


    > Added properties name, description to payout destinations

    > Updated return type of settlement data. Now includes original transaction
    payout split info.


    ## 2021-12-01


    > Sales location has been replaced with payout destination


    ## 2021-10-01


    > new: Route for report preview

    > - [GET
    /v/payout/report-preview](/payout-api/report/aid_report_preview_get)


    ## 2021-09-01


    > Replaced corrections with a more flexible alternative

    > Added route for manual matching


    > new: Routes for block rules

    > - [GET
    /v/payout/admin/block-rules](/payout-api/admin-block-rule/aid_admin_block_rules_get)

    > - [POST
    /v/payout/admin/block-rules](/payout-api/admin-block-rule/aid_admin_block_rule_post)

    > - [GET
    /v/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_get)

    > - [PATCH
    /v/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_patch)

    > - [DELETE
    /v/payout/admin/block-rules/{block_rule_id}](/payout-api/admin-block-rule/aid_admin_block_rule_delete)


    ## 2021-06-01


    > new: Routes for bankfile, payment, ledger

    > - [GET
    /v1/payout/admin/bankfiles](/payout-api/admin-bankfile/aid_bankfiles_get)

    > - [GET
    /v1/payout/admin/bankfiles/{bankfile_id}](/payout-api/admin-bankfile/aid_bankfile_get)

    > - [GET
    /v1/payout/admin/bankfiles/{bankfile_id}/content](/payout-api/admin-bankfile/aid_bankfile_content_get)

    > - [POST
    /v1/payout/admin/bankfiles/{bankfile_id}/lock](/payout-api/admin-bankfile/aid_bankfile_lock_post)

    > - [POST
    /v1/payout/admin/bankfiles/{bankfile_id}/unlock](/payout-api/admin-bankfile/aid_bankfile_unlock_post)


    > - [GET
    /v1/payout/admin/payments](/payout-api/admin-bankfile/aid_payments_get)

    > - [GET
    /v1/payout/admin/payments/{payment_id}](/payout-api/admin-bankfile/aid_payment_get)

    > - [GET
    /v1/payout/admin/payment-events](/payout-api/admin-bankfile/aid_payment_events_get)


    > - [GET
    /v1/payout/admin/ledger-accounts](/payout-api/admin-ledger/aid_ledger_accounts_get)

    > - [GET
    /v1/payout/admin/ledger-correctables](#operation/aid_ledger_correctables_get)

    > - [POST
    /v1/payout/admin/ledger-corrections](/payout-api/admin-ledger/aid_ledger_corrections_post)

    > - [GET
    /v1/payout/admin/ledger-entries](/payout-api/admin-ledger/aid_ledger_entries_get)

    > - [GET
    /v1/payout/admin/ledger-entries/{entry_id}](/payout-api/admin-ledger/aid_ledger_entry_get)



    ## 2021-06-01


    > new: Routes for settlements processed for payout

    > - [GET
    /v1/payout/admin/settlements](/payout-api/admin-settlement/aid_admin_settlements_get)

    > - [GET
    /v1/payout/admin/settlements/{settlement_id}](/payout-api/admin-settlement/aid_admin_settlement_get)

    > - [POST
    /v1/payout/admin/settlements/{settlement_id}/reject](/payout-api/admin-settlement/aid_admin_settlement_reject)

    > - [POST
    /v1/payout/admin/settlements/{settlement_id}/retry](/payout-api/admin-settlement/aid_admin_settlement_retry)


    ## 2021-04-07


    > Initial version
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
  x-logo:
    url: https://docs.dintero.com/img/dintero-dark-padded.svg
security:
  - JWT: []
tags:
  - name: config-rfcs
    x-displayName: RFCs
    description: Manage RFCs
  - name: config-bank-accounts
    x-displayName: Bank accounts
    description: Manage bank accounts
  - name: config-payout-destinations
    x-displayName: Sellers
    description: Manage sellers
  - name: config-account-payout-destination-links
    x-displayName: Bank account links
    description: Manage link between bank account and seller
  - name: config
    x-displayName: Config
    description: Manage configuration
  - name: report
    x-displayName: Reports
    description: Manage reports
  - name: admin-ledger
    x-displayName: Ledger
    description: Manage ledger
  - name: admin-bankfile
    x-displayName: Bankfiles
    description: Manage bankfiles
  - name: admin-proposal
    x-displayName: Proposals
    description: Manage proposals
  - name: admin-settlement
    x-displayName: Settlements
    description: Manage settlements
  - name: admin-config
    x-displayName: Config
    description: Manage the config
  - name: admin-block-rule
    x-displayName: Block rules
    description: Manage block rules
  - name: admin-config-rfcs
    x-displayName: RFCs
    description: Admin RFCs
  - name: admin-config-bank-accounts
    x-displayName: Bank accounts
    description: Admin bank accounts
  - name: admin-config-merchants
    x-displayName: Merchants
    description: Admin merchants
  - name: fund-transfers
    x-displayName: Fund transfers
    description: Transfer funds between sellers
  - name: v2-config-rfcs
    x-displayName: RFCs
    description: Manage RFCs
  - name: v2-config-bank-accounts
    x-displayName: Bank accounts
    description: Manage bank accounts
  - name: v2-config-payout-destinations
    x-displayName: Sellers
    description: Manage sellers
  - name: v2-config-account-payout-destination-links
    x-displayName: Bank account links
    description: Manage link between bank account and seller
  - name: v2-config
    x-displayName: Config
    description: Manage configuration
  - name: v2-report
    x-displayName: Reports
    description: Manage reports
  - name: v2-admin-ledger
    x-displayName: Ledger
    description: Manage ledger
  - name: v2-admin-bankfile
    x-displayName: Bankfiles
    description: Manage bankfiles
  - name: v2-admin-proposal
    x-displayName: Proposals
    description: Manage proposals
  - name: v2-admin-settlement
    x-displayName: Settlements
    description: Manage settlements
  - name: v2-admin-config
    x-displayName: Config
    description: Manage the config
  - name: v2-admin-block-rule
    x-displayName: Block rules
    description: Manage block rules
  - name: v2-admin-config-rfcs
    x-displayName: RFCs
    description: Admin RFCs
  - name: v2-admin-config-bank-accounts
    x-displayName: Bank accounts
    description: Admin bank accounts
  - name: v2-admin-config-merchants
    x-displayName: Merchants
    description: Admin merchants
  - name: v2-fund-transfers
    x-displayName: Fund transfers
    description: Transfer funds between sellers
  - name: v2-retained-transactions
    x-displayName: Retained transactions
    description: Manage retained transactions for payout destinations
paths:
  /v1/accounts/{aid}/payout/admin/bankfiles:
    get:
      operationId: aid_bankfiles_get
      summary: aid_bankfiles_get
      description: |
        Get bankfiles

        Filter identifiers:
        - id
        - proposal_id
        - external_id
        - file_name
        - is_outbound
        - status
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/bankfiles
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of bankfiles
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_files:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankFile'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get bankfiles
          sidebarTitle: Get bankfiles
  /v1/accounts/{aid}/payout/admin/bankfiles/{bankfile_id}:
    get:
      operationId: aid_bankfile_get
      summary: aid_bankfile_get
      description: |
        Get bankfile
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/bankfiles
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/bankFileId'
      responses:
        '200':
          description: Bankfile
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_file:
                    $ref: '#/components/schemas/BankFile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get bankfile
          sidebarTitle: Get bankfile
  /v1/accounts/{aid}/payout/admin/bankfiles/{bankfile_id}/content:
    get:
      operationId: aid_bankfile_content_get
      summary: aid_bankfile_content_get
      description: |
        Get bankfile content
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/bankfiles
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/bankFileId'
      responses:
        '200':
          description: Bankfile content as text
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get bankfile content
          sidebarTitle: Get bankfile content
  /v1/accounts/{aid}/payout/admin/bankfiles/{bankfile_id}/lock:
    post:
      operationId: aid_bankfile_lock_post
      summary: aid_bankfile_lock_post
      description: |
        Lock bankfile from further processing.
        For outbound files, this stops the file from being sent to the bank.
        For inbound files, this stops the file from being processed.
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/bankfiles
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/bankFileId'
      responses:
        '200':
          description: Bankfile
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_file:
                    $ref: '#/components/schemas/BankFile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Lock bankfile
          sidebarTitle: Lock bankfile
  /v1/accounts/{aid}/payout/admin/bankfiles/{bankfile_id}/unlock:
    post:
      operationId: aid_bankfile_unlock_post
      summary: aid_bankfile_unlock_post
      description: |
        Unlock bankfile for further processing.
        For outbound files, this causes the file to be sent to the bank.
        For inbound files, this causes the file to be processed.
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/bankfiles
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/bankFileId'
      responses:
        '200':
          description: Bankfile
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_file:
                    $ref: '#/components/schemas/BankFile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Unlock bankfile
          sidebarTitle: Unlock bankfile
  /v1/accounts/{aid}/payout/admin/block-rules-test:
    post:
      operationId: aid_admin_block_rule_test
      summary: aid_admin_block_rule_test
      description: |
        Test if target is blocked by active block rules
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/block-rules-test
      tags:
        - admin-block-rule
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockRuleTestTarget'
        description: Target to test
        required: true
      responses:
        '200':
          description: Block rule test response
          content:
            application/json:
              schema:
                type: object
                properties:
                  is_blocked:
                    type: boolean
                  target:
                    $ref: '#/components/schemas/BlockRuleTestTarget'
                  matching_rules:
                    type: array
                    items:
                      $ref: '#/components/schemas/BlockRuleData'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Test block rule target
          sidebarTitle: Test block rule target
  /v1/accounts/{aid}/payout/admin/block-rules:
    get:
      operationId: aid_admin_block_rules_get
      summary: aid_admin_block_rules_get
      description: |
        Get block rules
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/block-rules
      tags:
        - admin-block-rule
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of block rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  block_rules:
                    type: array
                    items:
                      $ref: '#/components/schemas/BlockRuleData'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get block rules
          sidebarTitle: Get block rules
    post:
      operationId: aid_admin_block_rule_post
      summary: aid_admin_block_rule_post
      description: |
        Post a block rule
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/block-rules
      tags:
        - admin-block-rule
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockRuleData'
        description: Block rule post
        required: true
      responses:
        '200':
          description: The created block rule
          content:
            application/json:
              schema:
                type: object
                properties:
                  block_rule:
                    $ref: '#/components/schemas/BlockRuleData'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post a block rule
          sidebarTitle: Post a block rule
  /v1/accounts/{aid}/payout/admin/block-rules/{block_rule_id}:
    get:
      operationId: aid_admin_block_rule_get
      summary: aid_admin_block_rule_get
      description: |
        Get block rule by id
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/block-rules
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/blockRuleId'
      tags:
        - admin-block-rule
      responses:
        '200':
          description: Block rule
          content:
            application/json:
              schema:
                type: object
                properties:
                  block_rule:
                    $ref: '#/components/schemas/BlockRuleData'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get block rule by id
          sidebarTitle: Get block rule by id
    patch:
      operationId: aid_admin_block_rule_patch
      summary: aid_admin_block_rule_patch
      description: |
        Update a block rule
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/block-rules
      tags:
        - admin-block-rule
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/blockRuleId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockRuleData'
        description: block rule patch
        required: true
      responses:
        '200':
          description: The updated block rule
          content:
            application/json:
              schema:
                type: object
                properties:
                  block_rule:
                    $ref: '#/components/schemas/BlockRuleData'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update a block rule
          sidebarTitle: Update a block rule
    delete:
      operationId: aid_admin_block_rule_delete
      summary: aid_admin_block_rule_delete
      description: |
        Delete block rule by id
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/block-rules
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/blockRuleId'
      tags:
        - admin-block-rule
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete block rule by id
          sidebarTitle: Delete block rule by id
  /v1/accounts/{aid}/payout/admin/config-rfcs:
    get:
      operationId: aid_admin_config_rfcs_get
      summary: aid_admin_config_rfcs_get
      description: |
        Get config rfcs
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/config-rfcs
      tags:
        - admin-config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfcs:
                    type: array
                    items:
                      $ref: '#/components/schemas/ConfigRfc'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get config rfcs
          sidebarTitle: Get config rfcs
  /v1/accounts/{aid}/payout/admin/config-rfcs/{config_rfc_id}:
    get:
      operationId: aid_admin_config_rfc_get
      summary: aid_admin_config_rfc_get
      description: |
        Get config rfc by id
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      tags:
        - admin-config-rfcs
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get config rfc by id
          sidebarTitle: Get config rfc by id
    put:
      operationId: aid_admin_config_rfc_put
      summary: aid_admin_config_rfc_put
      description: |
        Replace config RFC data. RFC cannot be approved/rejected.
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/config-rfcs
      tags:
        - admin-config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      requestBody:
        $ref: '#/components/requestBodies/ConfigRfcData'
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Replace config RFC data
          sidebarTitle: Replace config RFC data
    delete:
      operationId: aid_admin_config_rfc_delete
      summary: aid_admin_config_rfc_delete
      description: |
        Delete config RFC by id
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      tags:
        - admin-config-rfcs
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete config RFC by id
          sidebarTitle: Delete config RFC by id
  /v1/accounts/{aid}/payout/admin/config-rfcs/{config_rfc_id}/approve:
    post:
      operationId: aid_admin_config_rfc_approve
      summary: aid_admin_config_rfc_approve
      description: |
        Approve RFC

        scopes:
        - `admin:payout:/admin write:payout:/admin/config_rfc_approval`
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/config_rfc_approval
        - write:payout:/admin/config-rfcs-approval
      tags:
        - admin-config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - rfc_updated_at
              properties:
                rfc_updated_at:
                  type: string
                  format: date-time
                  description: >
                    Expected time of last update.

                    This ensures that the rfcs hasn't been unexpectedly updated
                    before approval.
        description: Config RFC approval info
        required: true
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Approve RFC
          sidebarTitle: Approve RFC
  /v1/accounts/{aid}/payout/admin/config-rfcs/{config_rfc_id}/reject:
    post:
      operationId: aid_admin_config_rfc_reject
      summary: aid_admin_config_rfc_reject
      description: |
        Reject RFC

        scopes:
        - `admin:payout:/admin write:payout:/admin/config_rfc_approval`
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/config_rfc_approval
        - write:payout:/admin/config-rfcs-approval
      tags:
        - admin-config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - rejected_reason
              properties:
                rejected_reason:
                  type: string
        description: Config RFC rejection data
        required: true
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Reject RFC
          sidebarTitle: Reject RFC
  /v1/accounts/{aid}/payout/admin/config:
    get:
      operationId: aid_admin_config_get
      summary: aid_admin_config_get
      description: |
        Get dintero global config
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/config
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - admin-config
      responses:
        '200':
          description: Dintero config
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    $ref: '#/components/schemas/ConfigDintero'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get dintero config
          sidebarTitle: Get dintero config
    patch:
      operationId: aid_admin_config_patch
      summary: aid_admin_config_patch
      description: |
        Update dintero config
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/config
      tags:
        - admin-config
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigDintero'
        description: Config patch data
        required: true
      responses:
        '200':
          description: Dintero config
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    $ref: '#/components/schemas/ConfigDintero'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update dintero config
          sidebarTitle: Update dintero config
  /v1/accounts/{aid}/payout/admin/dintero-bank-account-balance-estimates:
    get:
      operationId: aid_admin_dintero_bank_account_balance_estimates_get
      summary: aid_admin_dintero_bank_account_balance_estimates_get
      description: |
        Get dintero bank account balance estimates
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/dintero-bank-account-balance-estimates
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - admin-config-bank-accounts
      responses:
        '200':
          description: List of dintero bank account balance estimates
          content:
            application/json:
              schema:
                type: object
                properties:
                  estimates:
                    type: array
                    items:
                      $ref: '#/components/schemas/DinteroBankAccountBalanceEstimate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get dintero bank account balance estimates
          sidebarTitle: Get dintero bank account balance estimates
  /v1/accounts/{aid}/payout/admin/dintero-bank-account-balances:
    get:
      operationId: aid_admin_dintero_bank_account_balances_get
      summary: aid_admin_dintero_bank_account_balances_get
      description: |
        Get dintero bank account balances
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/dintero-bank-account-balances
      tags:
        - admin-config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of dintero bank account balances
          content:
            application/json:
              schema:
                type: object
                properties:
                  balances:
                    type: array
                    items:
                      $ref: '#/components/schemas/DinteroBankAccountBalance'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get dintero bank account balances
          sidebarTitle: Get dintero bank account balances
    post:
      operationId: aid_admin_dintero_bank_account_balances_post
      summary: aid_admin_dintero_bank_account_balances_post
      description: |
        Post dintero bank account balance
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/dintero-bank-account-balances
      tags:
        - admin-config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DinteroBankAccountBalance'
        description: Dintero bank account balance data
        required: true
      responses:
        '200':
          description: Dintero bank account balance
          content:
            application/json:
              schema:
                type: object
                properties:
                  balance:
                    $ref: '#/components/schemas/DinteroBankAccountBalance'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post dintero bank account balance
          sidebarTitle: Post dintero bank account balance
  /v1/accounts/{aid}/payout/admin/dintero-bank-account-balances/{dintero_bank_account_balance_id}:
    delete:
      operationId: aid_admin_dintero_bank_account_balance_delete
      summary: aid_admin_dintero_bank_account_balance_delete
      description: |
        (soft) Delete dintero bank account balance
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/dintero-bank-account-balances
      tags:
        - admin-config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/dinteroBankAccountBalanceId'
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete dintero bank account balance
          sidebarTitle: Delete dintero bank account balance
  /v1/accounts/{aid}/payout/admin/dintero-bank-accounts:
    get:
      operationId: aid_admin_dintero_bank_accounts_get
      summary: aid_admin_dintero_bank_accounts_get
      description: |
        Get dintero bank accounts
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/dintero-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - admin-config-bank-accounts
      responses:
        '200':
          description: List of dintero bank accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/ConfigDintero'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get dintero bank accounts
          sidebarTitle: Get dintero bank accounts
    post:
      operationId: aid_admin_dintero_bank_accounts_post
      summary: aid_admin_dintero_bank_accounts_post
      description: |
        Post dintero bank account
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/dintero-bank-accounts
      tags:
        - admin-config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        $ref: '#/components/requestBodies/DinteroBankAccount'
      responses:
        '200':
          description: Dintero bank account
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account:
                    $ref: '#/components/schemas/DinteroBankAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post dintero bank account
          sidebarTitle: Post dintero bank account
  /v1/accounts/{aid}/payout/admin/dintero-bank-accounts/{dintero_bank_account_id}:
    patch:
      operationId: aid_admin_dintero_bank_account_patch
      summary: aid_admin_dintero_bank_account_patch
      description: |
        Patch dintero bank account
      x-scopes:
        - write:payout:/admin
        - write:payout:/admin/dintero-bank-accounts
      tags:
        - admin-config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/dinteroBankAccountId'
      requestBody:
        $ref: '#/components/requestBodies/DinteroBankAccount'
      responses:
        '200':
          description: Dintero bank account
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account:
                    $ref: '#/components/schemas/ConfigDintero'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Patch dintero bank account
          sidebarTitle: Patch dintero bank account
    delete:
      operationId: aid_admin_dintero_bank_account_delete
      summary: aid_admin_dintero_bank_account_delete
      description: |
        (soft) Delete dintero bank account
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/dintero-bank-accounts
      tags:
        - admin-config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/dinteroBankAccountId'
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete dintero bank account
          sidebarTitle: Delete dintero bank account
  /v1/accounts/{aid}/payout/admin/ledger-accounts:
    get:
      operationId: aid_ledger_accounts_get
      summary: aid_ledger_accounts_get
      description: |
        Get ledger accounts
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/ledger-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - admin-ledger
      responses:
        '200':
          description: List of ledger accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  ledger_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/LedgerAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get ledger accounts
          sidebarTitle: Get ledger accounts
  /v1/accounts/{aid}/payout/admin/ledger-corrections:
    post:
      operationId: aid_ledger_corrections_post
      summary: aid_ledger_corrections_post
      description: |
        Post ledger correction
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/ledger-corrections
      tags:
        - admin-ledger
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LedgerCorrection'
        description: Ledger correction
        required: true
      responses:
        '200':
          description: Ledger entries
          content:
            application/json:
              schema:
                type: object
                properties:
                  entries:
                    type: array
                    items:
                      $ref: '#/components/schemas/LedgerEntry'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post ledger correction
          sidebarTitle: Post ledger correction
  /v1/accounts/{aid}/payout/admin/ledger-entries:
    get:
      operationId: aid_ledger_entries_get
      summary: aid_ledger_entries_get
      description: |
        Get ledger entries.

        Filter identifiers:
        - id
        - account_id
        - ledger_bundle_id
        - ledger_account_number
        - ledger_link_id
        - proposal_id
        - proposal_item_id
        - link_open
        - payout_destination_id
        - amount
        - currency
        - source
        - posted_at
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/ledger-entries
      tags:
        - admin-ledger
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of ledger entries
          content:
            application/json:
              schema:
                type: object
                properties:
                  entries:
                    type: array
                    items:
                      $ref: '#/components/schemas/LedgerEntry'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get ledger entries
          sidebarTitle: Get ledger entries
  /v1/accounts/{aid}/payout/admin/ledger-entries/{entry_id}:
    get:
      operationId: aid_ledger_entry_get
      summary: aid_ledger_entry_get
      description: |
        Get ledger entry
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/ledger-entries
      tags:
        - admin-ledger
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/entryId'
      responses:
        '200':
          description: Ledger entry
          content:
            application/json:
              schema:
                type: object
                properties:
                  entry:
                    $ref: '#/components/schemas/LedgerEntry'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get ledger entry
          sidebarTitle: Get ledger entry
  /v1/accounts/{aid}/payout/admin/ledger-matches:
    post:
      operationId: aid_ledger_match_post
      summary: aid_ledger_match_post
      description: |
        Post manual ledger match
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/ledger-matches
      tags:
        - admin-ledger
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LedgerManualMatch'
        description: Ledger match
        required: true
      responses:
        '200':
          description: Ledger entries
          content:
            application/json:
              schema:
                type: object
                properties:
                  entries:
                    type: array
                    items:
                      $ref: '#/components/schemas/LedgerEntry'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post manual ledger match
          sidebarTitle: Post manual ledger match
  /v1/accounts/{aid}/payout/admin/merchants:
    get:
      operationId: aid_admin_merchants_get
      summary: aid_admin_merchants_get
      description: |
        Get payout merchant configurations
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/merchants
      tags:
        - admin-config-merchants
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List merchants with a configuration in payout
          content:
            application/json:
              schema:
                type: object
                properties:
                  configs:
                    type: array
                    items:
                      $ref: '#/components/schemas/ConfigAccount'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get payout merchants
          sidebarTitle: Get payout merchants
  /v1/accounts/{aid}/payout/admin/merchants/{merchant_account_id}:
    get:
      operationId: aid_admin_merchant_get
      summary: aid_admin_merchant_get
      description: >
        Get payout merchant configuration by merchant accountId.

        Returns all sellers, bank accounts, rfcs and block-rule hits for the
        merchant.
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/merchants
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/merchantAccountId'
      tags:
        - admin-config-merchants
      responses:
        '200':
          description: >-
            Sellers, bank accounts, bank account seller links, rfcs, matching
            block-rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    $ref: '#/components/schemas/ConfigAccount'
                  bank_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccount'
                  payout_destinations:
                    type: array
                    items:
                      $ref: '#/components/schemas/PayoutDestinationConfig'
                  bank_account_payout_destinations:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccountPayoutDestination'
                  active_block_rule_matches:
                    type: array
                    items:
                      type: object
                      properties:
                        target:
                          $ref: '#/components/schemas/BlockRuleTestTarget'
                        matchingRules:
                          type: array
                          items:
                            $ref: '#/components/schemas/BlockRuleData'
                  rfcs:
                    type: array
                    items:
                      $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get payout merchant by merchant accountId
          sidebarTitle: Get payout merchant by merchant accountId
  /v1/accounts/{aid}/payout/admin/merchants/{merchant_account_id}/config:
    patch:
      operationId: aid_admin_merchant_config_patch
      summary: aid_admin_merchant_config_patch
      description: |
        Patch payout merchant configuration by merchant accountId.
        Returns configuration for the merchant after patch.
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/merchants
      tags:
        - admin-config-merchants
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/merchantAccountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminConfigAccountData'
        description: Config data
        required: true
      responses:
        '200':
          description: payout configuration patched
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    $ref: '#/components/schemas/ConfigAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Patch payout merchant config by merchant accountId
          sidebarTitle: Patch payout merchant config by merchant accountId
  /v1/accounts/{aid}/payout/admin/merchants/{merchant_account_id}/payout_destinations/{payout_destination_config_id}:
    patch:
      operationId: aid_admin_merchant_payout_destination_patch
      summary: aid_admin_merchant_payout_destination_patch
      description: >
        Patch merchant Seller (payout destination) config by merchant accountId.
        Returns the Seller config after patch
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin
        - write:payout:/admin/merchants
      tags:
        - admin-config-merchants
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/merchantAccountId'
        - $ref: '#/components/parameters/payoutDestinationConfigId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminConfigPayoutDestinationData'
        description: Config data
        required: true
      responses:
        '200':
          description: The updated seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfig'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Patch Seller by merchant accountId
          sidebarTitle: Patch Seller by merchant accountId
  /v1/accounts/{aid}/payout/admin/payment-events:
    get:
      operationId: aid_payment_events_get
      summary: aid_payment_events_get
      description: |
        Get payment events

        Filter identifiers:
        - id
        - account_id
        - proposal_id
        - proposal_item_id
        - original_message_id
        - message_id
        - group_id
        - transaction_id
        - iso_type
        - type
        - is_rejection
        - message
        - file_id
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/payment-events
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of payment events
          content:
            application/json:
              schema:
                type: object
                properties:
                  payment_events:
                    type: array
                    items:
                      $ref: '#/components/schemas/PaymentEvent'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get payment events
          sidebarTitle: Get payment events
  /v1/accounts/{aid}/payout/admin/payments:
    get:
      operationId: aid_payments_get
      summary: aid_payments_get
      description: |
        Get payments

        Filter identifiers:
        - id
        - account_id
        - proposal_id
        - proposal_item_id
        - file_id
        - is_outbound
        - payment_id
        - message_id
        - group_id
        - e2e_id
        - paid_at
        - sender_name
        - sender_country
        - sender_bank_account_number
        - sender_bank_account_type
        - sender_bank_account_bic
        - receiver_name
        - receiver_country
        - receiver_bank_account_number
        - receiver_bank_account_type
        - receiver_bank_account_bic
        - message
        - tx_amount
        - tx_currency
        - instructed_amount
        - instructed_currency
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/payments
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of payments
          content:
            application/json:
              schema:
                type: object
                properties:
                  payments:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payment'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get payments
          sidebarTitle: Get payments
  /v1/accounts/{aid}/payout/admin/payments/{payment_id}:
    get:
      operationId: aid_payment_get
      summary: aid_payment_get
      description: |
        Get payment
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/payments
      tags:
        - admin-bankfile
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/paymentId'
      responses:
        '200':
          description: Payment
          content:
            application/json:
              schema:
                type: object
                properties:
                  payment:
                    $ref: '#/components/schemas/Payment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get payment
          sidebarTitle: Get payment
  /v1/accounts/{aid}/payout/admin/proposal-items:
    get:
      operationId: aid_admin_proposal_items_get
      summary: aid_admin_proposal_items_get
      description: |
        Get list of proposal items based on search query

        Filter identifiers:
        - id
        - status
        - e2e_id
        - proposal_id
        - account_id
        - payout_destination_id
        - config_bank_account_id
        - amount
        - currency
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
        - amount
        - status
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/proposal-items
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of proposal items
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProposalItem'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get proposal items
          sidebarTitle: Get proposal items
  /v1/accounts/{aid}/payout/admin/proposal-items/{proposal_item_id}/approve:
    post:
      operationId: aid_admin_proposal_item_approve
      summary: aid_admin_proposal_item_approve
      description: |
        Approve / undo rejections a single proposal item
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalItemId'
      responses:
        '200':
          description: Successful approval
          content:
            application/json:
              schema:
                type: object
                properties:
                  item:
                    $ref: '#/components/schemas/ProposalItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Approve / undo rejections of proposal item
          sidebarTitle: Approve / undo rejections of proposal item
  /v1/accounts/{aid}/payout/admin/proposal-items/{proposal_item_id}/details:
    get:
      operationId: aid_admin_proposal_item_details
      summary: aid_admin_proposal_item_details
      description: |
        Proposal item details / report
      x-scopes:
        - admin:payout:/admin
        - read:payout:/admin/proposal-items
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalItemId'
      responses:
        '200':
          description: Proposal item details
          content:
            application/json:
              schema:
                type: object
                properties:
                  item:
                    $ref: '#/components/schemas/ProposalItem'
                  report:
                    $ref: '#/components/schemas/Report'
                  bank_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Proposal item details / report
          sidebarTitle: Proposal item details / report
  /v1/accounts/{aid}/payout/admin/proposal-items/{proposal_item_id}/reject:
    post:
      operationId: aid_admin_proposal_item_reject
      summary: aid_admin_proposal_item_reject
      description: |
        Reject a single proposal item
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
        - write:payout:/admin/proposal-items-approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalItemId'
      responses:
        '200':
          description: Successful rejection
          content:
            application/json:
              schema:
                type: object
                properties:
                  item:
                    $ref: '#/components/schemas/ProposalItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Reject proposal item
          sidebarTitle: Reject proposal item
  /v1/accounts/{aid}/payout/admin/proposal-items/{proposal_item_id}/fail:
    post:
      operationId: aid_admin_proposal_item_fail
      summary: aid_admin_proposal_item_fail
      description: |
        Fail a single proposal item
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
        - write:payout:/admin/proposal-items-approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalItemId'
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  item:
                    $ref: '#/components/schemas/ProposalItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Fail proposal item
          sidebarTitle: Fail proposal item
  /v1/accounts/{aid}/payout/admin/generate-proposals:
    post:
      operationId: aid_admin_proposals_generate
      summary: aid_admin_proposals_generate
      description: |
        Generate proposals
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
        - write:payout:/admin/proposals-approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
      responses:
        '200':
          description: List of proposals
          content:
            application/json:
              schema:
                properties:
                  proposals:
                    type: array
                    items:
                      $ref: '#/components/schemas/Proposal'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Generate proposals
          sidebarTitle: Generate proposals
  /v1/accounts/{aid}/payout/admin/proposals:
    get:
      operationId: aid_admin_proposals_get
      summary: aid_admin_proposals_get
      description: |
        Get list of proposals based on search query

        Filter identifiers:
        - id
        - status
        - e2e_id
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/proposals
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of proposals
          content:
            application/json:
              schema:
                type: object
                properties:
                  proposals:
                    type: array
                    items:
                      $ref: '#/components/schemas/Proposal'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get proposals
          sidebarTitle: Get proposals
  /v1/accounts/{aid}/payout/admin/proposals/{proposal_id}:
    get:
      operationId: aid_admin_proposal_get
      summary: aid_admin_proposal_get
      description: |
        Get a single proposal by id
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/proposals
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalId'
      responses:
        '200':
          description: A proposal and its items
          content:
            application/json:
              schema:
                type: object
                properties:
                  proposal:
                    $ref: '#/components/schemas/Proposal'
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProposalItem'
                  bank_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccount'
                  pending_items:
                    type: array
                    items:
                      $ref: '#/components/schemas/PendingItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get a proposal
          sidebarTitle: Get a proposal
  /v1/accounts/{aid}/payout/admin/proposals/{proposal_id}/approve:
    post:
      operationId: aid_admin_proposal_approve
      summary: aid_admin_proposal_approve
      description: |
        Approve a proposal
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
        - write:payout:/admin/proposals-approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalId'
      responses:
        '200':
          description: Successful approval
          content:
            application/json:
              schema:
                type: object
                properties:
                  proposal:
                    $ref: '#/components/schemas/Proposal'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Approve proposal
          sidebarTitle: Approve proposal
  /v1/accounts/{aid}/payout/admin/proposals/{proposal_id}/reject:
    post:
      operationId: aid_admin_proposal_reject
      summary: aid_admin_proposal_reject
      description: |
        Reject a proposal
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
        - write:payout:/admin/proposals-approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalId'
      responses:
        '200':
          description: Successful rejection
          content:
            application/json:
              schema:
                type: object
                properties:
                  proposal:
                    $ref: '#/components/schemas/Proposal'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Reject proposal
          sidebarTitle: Reject proposal
  /v1/accounts/{aid}/payout/admin/proposals/{proposal_id}/sync-status-from-items:
    post:
      operationId: aid_admin_proposal_sync_status_from_items_post
      summary: aid_admin_proposal_sync_status_from_items_post
      description: |
        Sync status from items
      x-scopes:
        - admin:payout:/admin
        - write:payout:/admin/payment_approval
        - write:payout:/admin/proposals-approval
      tags:
        - admin-proposal
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/proposalId'
      responses:
        '200':
          description: Successful sync
          content:
            application/json:
              schema:
                type: object
                properties:
                  proposal:
                    $ref: '#/components/schemas/Proposal'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Sync status from items
          sidebarTitle: Sync status from items
  /v1/accounts/{aid}/payout/admin/settlements:
    get:
      operationId: aid_admin_settlements_get
      summary: aid_admin_settlements_get
      description: |
        Get list of settlements processed for payout based on search query

        Filter identifiers:
        - account_id
        - payment_provider
        - payment_provider_reference
        - settlement_id
        - status
        - status_text
        - created_at
        - updated_at

        Sort identifiers:
        - created_at
        - updated_at
        - status
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/settlements
      tags:
        - admin-settlement
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/search_query'
      responses:
        '200':
          description: List of settlements
          content:
            application/json:
              schema:
                type: object
                properties:
                  settlements:
                    type: array
                    items:
                      $ref: '#/components/schemas/Settlement'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get settlements processed for payout
          sidebarTitle: Get settlements processed for payout
  /v1/accounts/{aid}/payout/admin/settlements/{settlement_id}:
    get:
      operationId: aid_admin_settlement_get
      summary: aid_admin_settlement_get
      description: |
        Get a single settlement processed for payout by id
      x-scopes:
        - read:payout:/admin
        - read:payout:/admin/settlements
      tags:
        - admin-settlement
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/settlementId'
      responses:
        '200':
          description: A settlement and its data
          content:
            application/json:
              schema:
                type: object
                properties:
                  settlement:
                    $ref: '#/components/schemas/Settlement'
                  data:
                    $ref: '#/components/schemas/SettlementData'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get a settlement processed for payout
          sidebarTitle: Get a settlement processed for payout
  /v1/accounts/{aid}/payout/admin/settlements/{settlement_id}/reject:
    post:
      operationId: aid_admin_settlement_reject
      summary: aid_admin_settlement_reject
      description: |
        Reject a settlement, preventing it from automatic retries.
      x-scopes:
        - write:payout:/admin
        - write:payout:/admin/settlements
      tags:
        - admin-settlement
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/settlementId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                reason:
                  type: string
        description: Settlement rejection data
        required: true
      responses:
        '200':
          description: Successful rejection
          content:
            application/json:
              schema:
                type: object
                properties:
                  settlement:
                    $ref: '#/components/schemas/Settlement'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Reject settlement
          sidebarTitle: Reject settlement
  /v1/accounts/{aid}/payout/admin/settlements/{settlement_id}/retry:
    post:
      operationId: aid_admin_settlement_retry
      summary: aid_admin_settlement_retry
      description: |
        Flag a settlement for automatic retry
      x-scopes:
        - write:payout:/admin
        - write:payout:/admin/settlements
      tags:
        - admin-settlement
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/settlementId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                reason:
                  type: string
        description: Settlement retry data
        required: true
      responses:
        '200':
          description: Successfully flagged settlement for retry
          content:
            application/json:
              schema:
                type: object
                properties:
                  settlement:
                    $ref: '#/components/schemas/Settlement'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Retry settlement
          sidebarTitle: Retry settlement
  /v1/accounts/{aid}/payout/bank-account-payout-destinations:
    get:
      operationId: aid_config_bank_account_payout_destinations_get
      summary: aid_config_bank_account_payout_destinations_get
      description: |
        Get links between bank account and seller |
        and the associated config
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - config-account-payout-destination-links
      responses:
        '200':
          description: List of bank account seller configs
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account_payout_destinations:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccountPayoutDestination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get links between bank account and seller
          sidebarTitle: Get links between bank account and seller
    post:
      operationId: aid_config_bank_account_payout_destinations_post
      summary: aid_config_bank_account_payout_destinations_post
      description: |
        Link bank account with seller, and add config for the link
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-account-payout-destination-links
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccountPayoutDestinationCreateData'
        description: Config bank account seller data
        required: true
      responses:
        '200':
          description: The seller that was posted
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account_payout_destination:
                    $ref: '#/components/schemas/BankAccountPayoutDestination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Link bank account with seller, and add config for the link
          sidebarTitle: Link bank account with seller, and add config for the link
  /v1/accounts/{aid}/payout/bank-account-payout-destinations/{config_bank_account_payout_destination_id}:
    get:
      operationId: aid_config_bank_account_payout_destination_get
      summary: aid_config_bank_account_payout_destination_get
      description: |
        Get single link between bank account and seller
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configBankAccountPayoutDestinationId'
      tags:
        - config-account-payout-destination-links
      responses:
        '200':
          description: A single bank account seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account_payout_destination:
                    $ref: '#/components/schemas/BankAccountPayoutDestination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get single link between bank account and seller
          sidebarTitle: Get single link between bank account and seller
    patch:
      operationId: aid_config_bank_account_payout_destination_patch
      summary: aid_config_bank_account_payout_destination_patch
      description: |
        Update link between bank account seller
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-account-payout-destination-links
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configBankAccountPayoutDestinationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccountPayoutDestinationUpdateData'
        description: Patch data for config bank account seller
        required: true
      responses:
        '200':
          description: A single bank account seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account_payout_destination:
                    $ref: '#/components/schemas/BankAccountPayoutDestination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update link between bank account seller
          sidebarTitle: Update link between bank account seller
    delete:
      operationId: aid_config_bank_account_payout_destination_delete
      summary: aid_config_bank_account_payout_destination_delete
      description: |
        Delete link between bank account and seller
      x-scopes:
        - write:payout
        - admin:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configBankAccountPayoutDestinationId'
      tags:
        - config-account-payout-destination-links
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete link between bank account and seller
          sidebarTitle: Delete link between bank account and seller
  /v1/accounts/{aid}/payout/bank-accounts:
    get:
      operationId: aid_config_bank_accounts_get
      summary: aid_config_bank_accounts_get
      description: |
        Get bank accounts
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - config-bank-accounts
      responses:
        '200':
          description: List of bank accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get bank accounts
          sidebarTitle: Get bank accounts
  /v1/accounts/{aid}/payout/bank-accounts/{config_bank_account_id}:
    get:
      operationId: aid_config_bank_account_get
      summary: aid_config_bank_account_get
      description: |
        Get single bank account
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configBankAccountId'
      tags:
        - config-bank-accounts
      responses:
        '200':
          description: A single bank account
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account:
                    $ref: '#/components/schemas/BankAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get single bank account
          sidebarTitle: Get single bank account
    patch:
      operationId: aid_config_bank_account_patch
      summary: aid_config_bank_account_patch
      description: |
        Update bank account
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-bank-accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configBankAccountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccountUpdateData'
        description: Patch data for bank account
        required: true
      responses:
        '200':
          description: A single bank account
          content:
            application/json:
              schema:
                type: object
                properties:
                  bank_account:
                    $ref: '#/components/schemas/BankAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update bank account
          sidebarTitle: Update bank account
    delete:
      operationId: aid_config_bank_account_delete
      summary: aid_config_bank_account_delete
      description: |
        Delete bank account
      x-scopes:
        - write:payout
        - admin:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configBankAccountId'
      tags:
        - config-bank-accounts
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete bank account
          sidebarTitle: Delete bank account
  /v1/accounts/{aid}/payout/config-rfcs:
    get:
      operationId: aid_config_rfcs_get
      summary: aid_config_rfcs_get
      description: |
        Get config rfcs
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - config-rfcs
      responses:
        '200':
          description: List of config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfcs:
                    type: array
                    items:
                      $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get config rfcs
          sidebarTitle: Get config rfcs
    post:
      operationId: aid_config_rfc__post
      summary: aid_config_rfc__post
      description: |
        Post a config RFC
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        $ref: '#/components/requestBodies/ConfigRfcData'
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post a config RFC
          sidebarTitle: Post a config RFC
  /v1/accounts/{aid}/payout/config-rfcs/{config_rfc_id}:
    get:
      operationId: aid_config_rfc_get
      summary: aid_config_rfc_get
      description: |
        Get config rfc by id
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      tags:
        - config-rfcs
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get config rfc by id
          sidebarTitle: Get config rfc by id
    put:
      operationId: aid_config_rfc_put
      summary: aid_config_rfc_put
      description: |
        Replace config RFC data. RFC cannot be approved/rejected.
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-rfcs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      requestBody:
        $ref: '#/components/requestBodies/ConfigRfcData'
      responses:
        '200':
          description: A single config RFC
          content:
            application/json:
              schema:
                type: object
                properties:
                  rfc:
                    $ref: '#/components/schemas/ConfigRfc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Replace config RFC data
          sidebarTitle: Replace config RFC data
    delete:
      operationId: aid_config_rfc_delete
      summary: aid_config_rfc_delete
      description: |
        Delete config RFC by id
      x-scopes:
        - write:payout
        - admin:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/configRfcId'
      tags:
        - config-rfcs
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete config RFC by id
          sidebarTitle: Delete config RFC by id
  /v1/accounts/{aid}/payout/config:
    get:
      operationId: aid_config_get
      summary: aid_config_get
      description: |
        Get config
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - config
      responses:
        '200':
          description: Config
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    $ref: '#/components/schemas/ConfigAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get config
          sidebarTitle: Get config
    patch:
      operationId: aid_config_patch
      summary: aid_config_patch
      description: |
        Update config
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigAccount'
        description: Config patch data
        required: true
      responses:
        '200':
          description: Config
          content:
            application/json:
              schema:
                type: object
                properties:
                  config:
                    $ref: '#/components/schemas/ConfigAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update config
          sidebarTitle: Update config
  /v1/accounts/{aid}/payout/fund-transfers:
    post:
      operationId: aid_payout_fund_transfers_post
      summary: aid_payout_fund_transfers_post
      description: >
        You can use the endpoint to programmatically initiate a fund transfer

        between two sellers


        Requests for fund transfers are processed asynchronously so in the
        response,

        we only inform you that we received your request. You'll get the result
        in

        the settlement report
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - fund-transfers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundTransferCreateData'
        description: Initiate fund transfer data
        required: true
      responses:
        '200':
          description: Transfer fund initiated
          content:
            application/json:
              schema:
                type: object
                properties:
                  fund_transfer:
                    $ref: '#/components/schemas/FundTransfer'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Initiate fund transfer
          sidebarTitle: Initiate fund transfer
  /v1/accounts/{aid}/payout/payout-destinations:
    get:
      operationId: aid_payout_destination_configs_get
      summary: aid_payout_destination_configs_get
      description: |
        Get sellers
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: payout_destination_id
          in: query
          description: The id of the seller as defined elsewhere in dintero.
          schema:
            type: string
      tags:
        - config-payout-destinations
      responses:
        '200':
          description: List of sellers
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_configs:
                    type: array
                    items:
                      $ref: '#/components/schemas/PayoutDestinationConfig'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Get sellers
          sidebarTitle: Get sellers
    post:
      operationId: aid_payout_destination_configs_post
      summary: aid_payout_destination_configs_post
      description: |
        Add a seller
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-payout-destinations
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutDestinationConfigCreateData'
        description: Seller data
        required: true
      responses:
        '200':
          description: The seller that was posted
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfig'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Add a seller
          sidebarTitle: Add a seller
  /v1/accounts/{aid}/payout/payout-destinations/{payout_destination_config_id}:
    get:
      operationId: aid_payout_destination_config_get
      summary: aid_payout_destination_config_get
      description: |
        Get seller config
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationConfigId'
      tags:
        - config-payout-destinations
      responses:
        '200':
          description: A single seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfig'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get seller config
          sidebarTitle: Get seller config
    patch:
      operationId: aid_payout_destination_config_patch
      summary: aid_payout_destination_config_patch
      description: |
        Update seller config
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - config-payout-destinations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationConfigId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutDestinationConfigUpdateData'
        description: Seller update data
        required: true
      responses:
        '200':
          description: The updated seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfig'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update seller config
          sidebarTitle: Update seller config
    delete:
      operationId: aid_config_payout_destination_config_delete
      summary: aid_config_payout_destination_config_delete
      description: |
        Delete seller config
      x-scopes:
        - write:payout
        - admin:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationConfigId'
      tags:
        - config-payout-destinations
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete seller config
          sidebarTitle: Delete seller config
  /v1/accounts/{aid}/payout/payout-destinations/{payout_destination_config_id}/balances:
    get:
      operationId: aid_payout_destination_balance_get
      summary: aid_payout_destination_balance_get
      description: |
        Get seller balance per currency
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationConfigId'
      tags:
        - config-payout-destinations
      responses:
        '200':
          description: Payout destination balances response
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_balances:
                    $ref: '#/components/schemas/PayoutDestinationBalances'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List seller balances
          sidebarTitle: List seller balances
  /v1/accounts/{aid}/payout/payout-destinations/{payout_destination_config_id}/transfers:
    get:
      operationId: aid_payout_destination_transfers_get
      summary: aid_payout_destination_transfers_get
      description: |
        Get list of transfers for a seller
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationConfigId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - name: currency
          in: query
          description: Filter by currency
          schema:
            type: string
            minLength: 3
            maxLength: 3
            pattern: ^[A-Z]{3}$
      tags:
        - config-payout-destinations
      responses:
        '200':
          description: Payout destination transfers response
          content:
            application/json:
              schema:
                type: object
                properties:
                  entries:
                    $ref: '#/components/schemas/PayoutDestinationTransfers'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get seller transfers
          sidebarTitle: Get seller transfers
  /v1/accounts/{aid}/payout/report-preview:
    get:
      operationId: aid_report_preview_get
      summary: aid_report_preview_get
      description: |
        Get a preview of the next proposed payment report
      x-scopes:
        - admin:payout
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - report
      responses:
        '200':
          description: Report preview
          content:
            application/json:
              schema:
                type: object
                properties:
                  preview:
                    $ref: '#/components/schemas/ReportPreview'
                  bank_accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/BankAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get report preview
          sidebarTitle: Get report preview
  /v2/accounts/{aid}/payout/fund-transfers:
    post:
      operationId: v2_aid_payout_fund_transfers_post
      summary: v2_aid_payout_fund_transfers_post
      description: >
        You can use the endpoint to programmatically initiate a fund transfer

        between two sellers


        Requests for fund transfers are processed asynchronously so in the
        response,

        we only inform you that we received your request. You'll get the result
        in

        the settlement report
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - v2-fund-transfers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundTransferCreateDataV2'
        description: Initiate fund transfer data
        required: true
      responses:
        '200':
          description: Transfer fund initiated
          content:
            application/json:
              schema:
                type: object
                properties:
                  fund_transfer:
                    $ref: '#/components/schemas/FundTransferV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Initiate fund transfer
          sidebarTitle: Initiate fund transfer
  /v2/accounts/{aid}/payout/payout-destinations:
    get:
      operationId: v2_aid_payout_destination_configs_get
      summary: v2_aid_payout_destination_configs_get
      description: |
        Get sellers
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: payout_destination_id
          in: query
          description: The id of the seller as defined elsewhere in dintero.
          schema:
            type: string
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: List of sellers
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_configs:
                    type: array
                    items:
                      $ref: '#/components/schemas/PayoutDestinationConfigV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Get sellers
          sidebarTitle: Get sellers
    post:
      operationId: v2_aid_payout_destination_configs_post
      summary: v2_aid_payout_destination_configs_post
      description: |
        Add a seller
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - v2-config-payout-destinations
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutDestinationConfigCreateDataV2'
        description: Seller data
        required: true
      responses:
        '200':
          description: The seller that was posted
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfigV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Add a seller
          sidebarTitle: Add a seller
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}:
    get:
      operationId: v2_aid_payout_destination_config_get
      summary: v2_aid_payout_destination_config_get
      description: |
        Get seller config
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: A single seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfigV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Get seller config
          sidebarTitle: Get seller config
    patch:
      operationId: v2_aid_payout_destination_config_patch
      summary: v2_aid_payout_destination_config_patch
      description: |
        Update seller config
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - v2-config-payout-destinations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutDestinationConfigUpdateDataV2'
        description: Seller update data
        required: true
      responses:
        '200':
          description: The updated seller config
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_config:
                    $ref: '#/components/schemas/PayoutDestinationConfigV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update seller config
          sidebarTitle: Update seller config
    delete:
      operationId: v2_aid_config_payout_destination_config_delete
      summary: v2_aid_config_payout_destination_config_delete
      description: |
        Delete seller config
      x-scopes:
        - write:payout
        - admin:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: Empty object
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Delete seller config
          sidebarTitle: Delete seller config
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/balances:
    get:
      operationId: v2_aid_payout_destination_balance_get
      summary: v2_aid_payout_destination_balance_get
      description: |
        Get seller balance per currency
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: Payout destination balances response
          content:
            application/json:
              schema:
                type: object
                properties:
                  payout_destination_balances:
                    $ref: '#/components/schemas/PayoutDestinationBalancesV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: List seller balances
          sidebarTitle: List seller balances
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/transfers:
    get:
      operationId: v2_aid_payout_destination_transfers_get
      summary: v2_aid_payout_destination_transfers_get
      description: |
        Get list of transfers for a seller
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
        - $ref: '#/components/parameters/limitV2'
        - $ref: '#/components/parameters/page'
        - name: currency
          in: query
          description: Filter by currency
          schema:
            type: string
            minLength: 3
            maxLength: 3
            pattern: ^[A-Z]{3}$
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: Payout destination transfers response
          content:
            application/json:
              schema:
                type: object
                properties:
                  entries:
                    $ref: '#/components/schemas/PayoutDestinationTransfersV2'
                  next_page_token:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: List seller transfers
          sidebarTitle: List seller transfers
  /v2/accounts/{aid}/payout/admin/ledger-unpaid-debt:
    get:
      operationId: v2_aid_admin_unpaid_debt_get
      summary: v2_aid_admin_unpaid_debt_get
      description: |
        List unpaid debt grouped by account and payout destination.
      x-scopes:
        - read:payout:/admin
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: older_than
          description: Aggregate ledger entries older than given ISO timestamp.
          in: query
          schema:
            type: string
            format: date-time
      tags:
        - v2-admin-ledger
      responses:
        '200':
          description: List unpaid debt for account and payout destination
          content:
            application/json:
              schema:
                type: object
                properties:
                  unpaid_debt:
                    type: array
                    items:
                      $ref: '#/components/schemas/UnpaidDebt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get unpaid debt
          sidebarTitle: Get unpaid debt
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/retained-transactions:
    get:
      operationId: v2_aid_payout_destination_retained_get
      summary: v2_aid_payout_destination_retained_get
      description: >
        Get retained transactions for a payout destination. A retained
        transactions

        is on hold and will not be payed untill explicitly released.
      x-scopes:
        - read:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
      tags:
        - v2-retained-transactions
      responses:
        '200':
          description: Payout destination retained transactions response
          content:
            application/json:
              schema:
                type: object
                properties:
                  retained_transactions:
                    type: array
                    items:
                      $ref: '#/components/schemas/RetainedTransaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Get retained transactions
          sidebarTitle: Get retained transactions
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/retained-transactions/{payout_event_correlation_id}/release:
    put:
      operationId: v2_aid_payout_destination_retained_release_put
      summary: v2_aid_payout_destination_retained_release_put
      description: |
        Release a retained transaction. The transaction will be part of the next
        scheduled payout.
      x-scopes:
        - write:payout
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/payoutDestinationId'
        - $ref: '#/components/parameters/payoutEventCorrelationId'
      tags:
        - v2-retained-transactions
      responses:
        '202':
          description: OK
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com
      x-mint:
        metadata:
          title: Release a retained transaction
          sidebarTitle: Release a retained transaction
x-tagGroups:
  - name: Payout v1
    tags:
      - config-rfcs
      - config-bank-accounts
      - config-payout-destinations
      - config-account-payout-destination-links
      - config
      - fund-transfers
      - report
  - name: Admin Payout v1
    tags:
      - admin-ledger
      - admin-bankfile
      - admin-proposal
      - admin-settlement
      - admin-config-rfcs
      - admin-config-bank-accounts
      - admin-config-merchants
      - admin-config
      - admin-block-rule
  - name: Payout v2
    tags:
      - v2-config-payout-destinations
      - v2-admin-ledger
      - v2-fund-transfers
      - v2-retained-transactions
servers:
  - url: https://api.dintero.com
components:
  parameters:
    accountId:
      name: aid
      description: |
        An id that uniquely identifies the account.
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{8}$
        minLength: 9
        maxLength: 9
    limit:
      name: limit
      in: query
      description: |
        A limit on the number of objects to be returned. Limit can range
        between 1 and 1000 items, and the default is 10 items.
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 10
    page:
      name: page
      in: query
      description: The page (as defined by the next_page_token in the api response)
      required: false
      schema:
        type: string
    search_query:
      name: search_query
      in: query
      required: false
      description: |
        add filters and sorters as a json string with the following format

        * filters is a list of filters
          * each filter can be a simple where clause,
            or a combination of different where clauses using the "logic" filter type
          * each filter in the list is joined using a logic "and". If you need to do a logic "or", use the logic filter type
          * a "where" clause has a left side (the property you want to filter on),
            and a right side (the value of the filter)
          * a "where" clause has an operator, which includes the normal comparison operators, but also:
            * "in" - the right side is now a list of things to filter on
            * "like" - the right side is now a fuzzy search
            * "isnull" / "isnotnull" - the right side is now empty
          * a "logic" clause has a left side (a filter), a right side (a filter), and an operator joining the two (and/or)
        * sorters is a list of sorters
          * each sorter sorts the result set either ascending or descending (asc/desc).
            Multiple sorters are applied one after the other, breaking ties.
          * a sorter has a left side, which is the property you want to sort on

        ```
        {
          "filters": [{
            "type": "where",
            "left": "name",
            "operator": "=", // or !=, >, <, >=, <=, in, like, isnull, isnotnull
            "right": 5 // or [5] if using operator in, or undefined if using isnull/isnotnull
          }, {
            "type": "logic",
            "left": {
              // ... another filter
            },
            "operator": "or" // or and
            "right": {
              // ... another filter
            }
          }],
          "sorters": [{
            "left": "name",
            "direction": "asc" // or desc
          }]
        }
        ```
      schema:
        type: string
        format: search_query
    bankFileId:
      name: bankfile_id
      description: Bankfile id
      in: path
      required: true
      schema:
        type: string
    blockRuleId:
      name: block_rule_id
      description: Block rule id
      in: path
      required: true
      schema:
        type: string
    configRfcId:
      name: config_rfc_id
      description: RFC id
      in: path
      required: true
      schema:
        type: string
    dinteroBankAccountBalanceId:
      name: dintero_bank_account_balance_id
      description: Dintero bank account balance id
      in: path
      required: true
      schema:
        type: string
    dinteroBankAccountId:
      name: dintero_bank_account_id
      description: Dintero bank account id
      in: path
      required: true
      schema:
        type: string
    entryId:
      name: entry_id
      description: Ledger entry id
      in: path
      required: true
      schema:
        type: string
    merchantAccountId:
      name: merchant_account_id
      description: accountId of a merchant in payout
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{8}$
        minLength: 9
        maxLength: 9
    payoutDestinationConfigId:
      name: payout_destination_config_id
      description: Seller config id
      in: path
      required: true
      schema:
        type: string
    paymentId:
      name: payment_id
      description: Payment id
      in: path
      required: true
      schema:
        type: string
    proposalItemId:
      name: proposal_item_id
      description: Proposal item id
      in: path
      required: true
      schema:
        type: string
    proposalId:
      name: proposal_id
      description: Proposal id
      in: path
      required: true
      schema:
        type: string
    settlementId:
      name: settlement_id
      description: Settlement id
      in: path
      required: true
      schema:
        type: string
    configBankAccountPayoutDestinationId:
      name: config_bank_account_payout_destination_id
      description: ID for configuration/link between bank account and seller
      in: path
      required: true
      schema:
        type: string
    configBankAccountId:
      name: config_bank_account_id
      description: Bank account id
      in: path
      required: true
      schema:
        type: string
    payoutDestinationId:
      name: payout_destination_id
      description: Seller id
      in: path
      required: true
      schema:
        type: string
    limitV2:
      name: limit
      in: query
      description: |
        A limit on the number of objects to be returned. Limit can range
        between 1 and 1000 items, and the default is 10 items.
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 10
    payoutEventCorrelationId:
      name: payout_event_correlation_id
      description: Payout event correlation id
      in: path
      required: true
      schema:
        type: string
  responses:
    BadRequest:
      description: Bad / Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AccessForbidden:
      description: Access forbidden, invalid JWT token was used
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  requestBodies:
    DinteroBankAccount:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DinteroBankAccount'
      description: Dintero bank account data
      required: true
    ConfigRfcData:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConfigRfcData'
      description: Config RFC data
      required: true
  securitySchemes:
    JWT:
      type: http
      description: >
        Bearer authentication (token authentication) should be used for
        accessing the API.


        Use [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post)
        to get an access token for client credentials.

        Pass the token in the request header:

            Authorization: Bearer {access_token}

        where the **access_token** is JSON Web Tokens (JWT).
      scheme: bearer
      bearerFormat: JWT
  schemas:
    AdditionalItemChargeback:
      x-discriminator-value: chargeback
      type: object
      description: |
        A chargeback. Amount is denoted using a positive number.
      allOf:
        - $ref: '#/components/schemas/AdditionalItemBase'
        - $ref: '#/components/schemas/AdditionalItemCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - chargeback
              readOnly: true
            original_transaction_id:
              type: string
              description: >-
                Id of the checkout transaction for which this chargeback was
                made
              readOnly: true
      title: chargeback
    AdditionalItemCommission:
      x-discriminator-value: commission
      type: object
      description: |
        Commission on fees etc.
      allOf:
        - $ref: '#/components/schemas/AdditionalItemBase'
        - $ref: '#/components/schemas/AdditionalItemCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - commission
              readOnly: true
            sub_type:
              type: string
              enum:
                - dinteroPayoutCommission
              readOnly: true
      title: commission
    AdditionalItemCommon:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: string
          readOnly: true
          example: '5.69'
          description: Amount in decimal string
        currency:
          type: string
          readOnly: true
          example: NOK
        account_id:
          type: string
          readOnly: true
        payout_destination_id:
          type: string
          readOnly: true
        date:
          type: string
          readOnly: true
        reference:
          type: string
          readOnly: true
          description: Reference code/number, where applicable
        description:
          type: string
          readOnly: true
        id:
          type: string
          readOnly: true
        created_at:
          type: string
          readOnly: true
        updated_at:
          type: string
          readOnly: true
    AdditionalItemFee:
      x-discriminator-value: fee
      type: object
      description: |
        A fee. Amount is denoted using a positive number.
      allOf:
        - $ref: '#/components/schemas/AdditionalItemBase'
        - $ref: '#/components/schemas/AdditionalItemCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - fee
              readOnly: true
            sub_type:
              type: string
              enum:
                - dinteroPayoutFee
                - payexOneTimeFee
              readOnly: true
      title: fee
    AdditionalItemPayoutFundTransfer:
      x-discriminator-value: payoutFundTransfer
      type: object
      description: |
        A payout fund transfer, usually between two sellers
      allOf:
        - $ref: '#/components/schemas/AdditionalItemBase'
        - $ref: '#/components/schemas/AdditionalItemCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - payoutFundTransfer
              readOnly: true
      title: payoutFundTransfer
    AdditionalItemUnknown:
      x-discriminator-value: unknown
      type: object
      description: >
        An item of unknown origin, or otherwise lacking a category. Description
        will usually contain more information.
      allOf:
        - $ref: '#/components/schemas/AdditionalItemBase'
        - $ref: '#/components/schemas/AdditionalItemCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - unknown
              readOnly: true
      title: unknown
    BankAccountRfcCreateData:
      type: object
      allOf:
        - $ref: '#/components/schemas/BankAccount'
        - type: object
          additionalProperties: false
          properties:
            bank_account_number:
              type: string
            bank_account_type:
              type: string
            bank_account_bic:
              type: string
            bank_account_country_code:
              type: string
            bank_account_currency:
              type: string
            nickname:
              type: string
            is_default_for_currency:
              type: boolean
            owner_name:
              type: string
            owner_country_code:
              type: string
            owner_city:
              type: string
            owner_postal_code:
              type: string
            owner_address:
              type: string
            owner_orgno:
              type: string
            owner_verified_id:
              type: string
          required:
            - bank_account_number
            - bank_account_type
            - bank_account_bic
            - bank_account_country_code
            - bank_account_currency
            - nickname
            - is_default_for_currency
            - owner_name
            - owner_country_code
            - owner_city
            - owner_postal_code
            - owner_address
    BankAccountRfcUpdateData:
      type: object
      description: |
        Bank account update data. Requires approval through the RFC process.
      properties:
        bank_account_type:
          type: string
          enum:
            - bban
            - iban
          description: Bank account type
        bank_account_bic:
          type: string
          description: Bank identifier code
          maxLength: 11
          pattern: ^[A-Z\d]+$
          example: DNBANOKKXXX
        bank_account_country_code:
          type: string
          description: Which country the bank account is registered in
          maxLength: 2
          minLength: 2
          pattern: ^[A-Z]{2}$
          example: 'NO'
        bank_account_currency:
          type: string
          description: |
            The currency of the bank account.
            This is used to determine which bank account to use for a payment.
            See also is_default_for_currency.
          maxLength: 3
          minLength: 3
          pattern: ^[A-Z]{3}$
          example: NOK
        nickname:
          type: string
          description: >-
            Give a nickname to the bank account to more easily remember its
            purpose
          minLength: 2
          maxLength: 40
          example: My bank account
        is_default_for_currency:
          type: boolean
          description: >
            If set, will default to this bank account for payouts in the
            currency of the bank account.


            The default is chosen when all of the below are true:


            - The transaction does not have a payout_destination_id set

            - The currency of the transaction is equal to this bank account


            You should set is_default_for_currency when:


            - You don't use sellers

            - You have bank accounts in multiple currencies. If you only have
            one, you can use the global default bank account instead.


            You should not set is_default_for_currency when:


            - You always use sellers for all transactions


            Warning: Payouts without a matching bank account will be put on hold
            until there is a match.
        owner_name:
          type: string
          description: Name of the company that receives payments on this bank account
          minLength: 2
          maxLength: 60
          example: My company
        owner_country_code:
          type: string
          description: >-
            Country code of the company that receives payments on this bank
            account
          maxLength: 2
          minLength: 2
          pattern: ^[A-Z]{2}$
          example: 'NO'
        owner_city:
          type: string
          description: City of the company that receives payments on this bank account
          minLength: 1
          maxLength: 35
          example: Old Town
        owner_postal_code:
          type: string
          description: >-
            Postal code of the company that receives payments on this bank
            account
          minLength: 1
          maxLength: 16
          example: '1540'
        owner_address:
          type: string
          description: Address of the company that receives payments on this bank account
          minLength: 1
          maxLength: 70
          example: Corner street 25
        owner_orgno:
          type: string
          maxLength: 20
          description: >
            Organization number of the company that receives payments on this
            bank account.

            If country is Norway, the orgno should exist in
            Brønnøysundregisteret.
          example: '12345678'
        owner_verified_id:
          type: string
          maxLength: 60
          description: >
            A globally unique id for the account owner if the owner is an
            individual.
    BlockRuleDataBankAccount:
      x-discriminator-value: bank-account
      type: object
      allOf:
        - $ref: '#/components/schemas/BlockRuleDataBase'
        - $ref: '#/components/schemas/BlockRuleReadOnly'
        - type: object
          additionalProperties: false
          required:
            - type
            - value
            - description
          properties:
            type:
              type: string
              enum:
                - bank-account
            value:
              type: object
              additionalProperties: false
              required:
                - bank_account_number
              properties:
                bank_account_number:
                  type: string
                  maxLength: 34
                  pattern: ^[\w\.\- ]+$
                  example: '12345678912'
            description:
              type: string
              example: Known money laundering account
      title: bank-account
    BlockRuleDataDinteroAccount:
      x-discriminator-value: dintero-account
      type: object
      allOf:
        - $ref: '#/components/schemas/BlockRuleDataBase'
        - $ref: '#/components/schemas/BlockRuleReadOnly'
        - type: object
          additionalProperties: false
          required:
            - type
            - value
            - description
          properties:
            type:
              type: string
              enum:
                - dintero-account
            value:
              type: object
              additionalProperties: false
              required:
                - account_id
              properties:
                account_id:
                  type: string
                  pattern: ^[PT]{1}\d{8}$
            description:
              type: string
              example: Known money laundering account
      title: dintero-account
    BlockRuleDataPayoutDestination:
      x-discriminator-value: payout-destination
      type: object
      allOf:
        - $ref: '#/components/schemas/BlockRuleDataBase'
        - $ref: '#/components/schemas/BlockRuleReadOnly'
        - type: object
          additionalProperties: false
          required:
            - type
            - value
            - description
          properties:
            type:
              type: string
              enum:
                - payout-destination
            value:
              type: object
              additionalProperties: false
              required:
                - payout_destination_id
                - account_id
              properties:
                payout_destination_id:
                  type: string
                  pattern: ^(?!\s*$).+
                account_id:
                  type: string
                  pattern: ^[PT]{1}\d{8}$
            description:
              type: string
              example: Known money laundering account
      title: payout-destination
    BlockRuleDataOwnerOrgNo:
      x-discriminator-value: owner-orgno
      type: object
      allOf:
        - $ref: '#/components/schemas/BlockRuleDataBase'
        - $ref: '#/components/schemas/BlockRuleReadOnly'
        - type: object
          additionalProperties: false
          required:
            - type
            - value
            - description
          properties:
            type:
              type: string
              enum:
                - owner-orgno
            value:
              type: object
              additionalProperties: false
              required:
                - owner_orgno
              properties:
                owner_orgno:
                  type: string
                  maxLength: 20
                  description: |
                    Organization number of the company owning bank accounts.
                    If country is Norway, the orgno should exist in
                    Brønnøysundregisteret.
                  example: '123456785'
            description:
              type: string
              example: Known money laundering account
      title: owner-orgno
    BlockRuleDataOwnerVerifiedId:
      x-discriminator-value: owner-verified-id
      type: object
      allOf:
        - $ref: '#/components/schemas/BlockRuleDataBase'
        - $ref: '#/components/schemas/BlockRuleReadOnly'
        - type: object
          additionalProperties: false
          required:
            - type
            - value
            - description
          properties:
            type:
              type: string
              enum:
                - owner-verified-id
            value:
              type: object
              additionalProperties: false
              required:
                - owner_verified_id
              properties:
                owner_verified_id:
                  type: string
                  maxLength: 60
                  description: |
                    A globally unique id for the account owner if the
                    owner is an individual.
                  example: PQ1234567.individual.E7DA8CC1F41F2784069FDDC6
            description:
              type: string
              example: Known money laundering account
      title: owner-verified-id
    ConfigAccountRfcData:
      type: object
      additionalProperties: false
      required:
        - payout_interval_type
        - payout_interval_value
        - split_payout_enabled
        - default_bank_account_number
      properties:
        payout_interval_type:
          $ref: '#/components/schemas/PayoutIntervalType'
        payout_interval_value:
          type: string
          description: Reserved for future use. Leave as empty string for now.
          example: ''
        split_payout_enabled:
          type: boolean
          description: >
            Explicitly enable split payouts.

            When split is enabled, the payout service will require order data
            for all transactions.
        default_bank_account_number:
          $ref: '#/components/schemas/DefaultBankAccountId'
    ConfigRfcDataBankAccountCreate:
      x-discriminator-value: configBankAccountCreate
      type: object
      description: |
        RFC used to describe a creation of bank accounts.
      allOf:
        - $ref: '#/components/schemas/ConfigRfcDataBase'
        - type: object
          additionalProperties: false
          required:
            - type
            - bank_accounts
          properties:
            type:
              type: string
              enum:
                - configBankAccountCreate
            payout_destinations:
              type: array
              items:
                type: object
                description: >
                  This config is used to describe the mapping between sellers
                  and bank accounts.

                  The mapping is used to determine which bank account will
                  receive payouts for a given seller.
                required:
                  - payout_destination_id
                  - bank_account_numbers
                  - default_bank_account_number
                properties:
                  payout_destination_id:
                    type: string
                    maxLength: 40
                    description: |
                      The id of the seller as defined elsewhere in dintero.
                  reference:
                    type: string
                    maxLength: 60
                    description: >
                      A static reference that will be included on bank payments
                      made to this seller
                  name:
                    type: string
                    maxLength: 60
                    description: |
                      The name of the seller
                  description:
                    type: string
                    maxLength: 1000
                    description: |
                      Description of the seller
                  bank_account_numbers:
                    type: array
                    items:
                      type: string
                  default_bank_account_number:
                    description: |
                      Bank account number to set as default for this seller.
                      The number must exist in bank_account_numbers.
                    nullable: true
                    type: string
            bank_accounts:
              type: array
              items:
                $ref: '#/components/schemas/BankAccountRfcCreateData'
      title: configBankAccountCreate
    ConfigRfcDataBankAccountUpdate:
      x-discriminator-value: configBankAccountUpdate
      type: object
      description: |
        RFC used to describe an update to a bank account.
      allOf:
        - $ref: '#/components/schemas/ConfigRfcDataBase'
        - type: object
          additionalProperties: false
          required:
            - id
            - type
            - bank_account
          properties:
            id:
              type: string
              description: ID of the bank account that should be updated
            type:
              type: string
              enum:
                - configBankAccountUpdate
            bank_account:
              $ref: '#/components/schemas/BankAccountRfcUpdateData'
      title: configBankAccountUpdate
    ConfigRfcDataOnboarding:
      x-discriminator-value: onboarding
      type: object
      allOf:
        - $ref: '#/components/schemas/ConfigRfcDataBase'
        - type: object
          additionalProperties: false
          required:
            - type
            - payout_destinations
            - bank_accounts
            - config_account
          properties:
            type:
              type: string
              enum:
                - onboarding
            config_account:
              $ref: '#/components/schemas/ConfigAccountRfcData'
            payout_destinations:
              type: array
              items:
                type: object
                description: >
                  This config is used to describe the mapping between sellers
                  and bank accounts.

                  The mapping is used to determine which bank account will
                  receive payouts for a given seller.
                required:
                  - payout_destination_id
                  - bank_account_numbers
                  - default_bank_account_number
                properties:
                  payout_destination_id:
                    type: string
                    maxLength: 40
                    description: |
                      The id of the seller as defined elsewhere in dintero.
                  reference:
                    type: string
                    maxLength: 60
                    description: >
                      A static reference that will be included on bank payments
                      made to this seller
                  name:
                    type: string
                    maxLength: 60
                    description: |
                      The name of the seller
                  description:
                    type: string
                    maxLength: 1000
                    description: |
                      Description of the seller
                  bank_account_numbers:
                    type: array
                    items:
                      type: string
                  default_bank_account_number:
                    description: |
                      Bank account number to set as default for this seller.
                      The number must exist in bank_account_numbers.
                    nullable: true
                    type: string
            bank_accounts:
              type: array
              items:
                $ref: '#/components/schemas/BankAccountRfcCreateData'
      title: onboarding
    Entity:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        deleted_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
    BankFile:
      type: object
      description: >
        The bankfile model contains metadata about a file sent or received from
        a bank.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            proposal_id:
              readOnly: true
              description: >-
                If bankfile is outbound, it is generated based on a proposal
                with this id.
              nullable: true
              type: string
            external_id:
              type: string
              readOnly: true
              description: |
                Id used to identify the content of the bankfile
            file_name:
              type: string
              readOnly: true
              description: |
                The original file name.
            file_hash:
              type: string
              readOnly: true
              description: A SHA256 hash of the file content
            status:
              type: string
              readOnly: true
              enum:
                - created
                - processed
              description: >
                Current status of the file.

                An outbound file will be set to processed when it is sent to the
                bank (or manually set via api).

                An inbound file will be set to processed when its contents have
                been parsed and processed (or manually set via api).
            status_text:
              type: string
              readOnly: true
            is_outbound:
              type: boolean
              readOnly: true
              description: |
                True if sent by us, false if sent by bank.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            code:
              type: string
              description: The code used to identify the error/warning
            errors:
              type: array
              description: The nested error(s) encountered during validation
              items:
                type: object
            message:
              type: string
              description: The human readable description of the error/warning
    BlockRuleTestTarget:
      type: object
      description: Target to test active block rules with
      properties:
        account_id:
          type: string
        bank_account_number:
          type: string
        owner_orgno:
          type: string
        owner_verified_id:
          type: string
        payout_destination:
          type: object
          additionalProperties: false
          required:
            - payout_destination_id
            - account_id
          properties:
            payout_destination_id:
              type: string
            account_id:
              type: string
    BlockRuleData:
      discriminator:
        propertyName: type
        mapping:
          bank-account: '#/components/schemas/BlockRuleDataBankAccount'
          dintero-account: '#/components/schemas/BlockRuleDataDinteroAccount'
          payout-destination: '#/components/schemas/BlockRuleDataPayoutDestination'
          owner-orgno: '#/components/schemas/BlockRuleDataOwnerOrgNo'
          owner-verified-id: '#/components/schemas/BlockRuleDataOwnerVerifiedId'
      oneOf:
        - $ref: '#/components/schemas/BlockRuleDataBankAccount'
        - $ref: '#/components/schemas/BlockRuleDataDinteroAccount'
        - $ref: '#/components/schemas/BlockRuleDataPayoutDestination'
        - $ref: '#/components/schemas/BlockRuleDataOwnerOrgNo'
        - $ref: '#/components/schemas/BlockRuleDataOwnerVerifiedId'
    Auditable:
      type: object
      properties:
        created_by:
          type: string
          description: User id of the user who created the resource
          readOnly: true
        updated_by:
          type: string
          description: User id of the user who last updated the resource
          readOnly: true
        deleted_at:
          format: date-time
          description: Time of deletion
          readOnly: true
          nullable: true
          type: string
        deleted_by:
          description: User id of the user who deleted the resource
          readOnly: true
          nullable: true
          type: string
    ConfigRfcData:
      discriminator:
        propertyName: type
        mapping:
          configBankAccountCreate: '#/components/schemas/ConfigRfcDataBankAccountCreate'
          configBankAccountUpdate: '#/components/schemas/ConfigRfcDataBankAccountUpdate'
          onboarding: '#/components/schemas/ConfigRfcDataOnboarding'
      oneOf:
        - $ref: '#/components/schemas/ConfigRfcDataBankAccountCreate'
        - $ref: '#/components/schemas/ConfigRfcDataBankAccountUpdate'
        - $ref: '#/components/schemas/ConfigRfcDataOnboarding'
    ConfigRfc:
      type: object
      description: >
        Some config in the payout service has to be approved by Dintero before
        use.

        The main purpose is anti money laundering ensurance.

        The way this is implemented is as config rfcs (request for change).

        For example, you can request a change or creation of a bank account.

        This will then be sent for approval by dintero, approved/rejected, and
        then applied.

        The RFC concept is also used for onboarding purposes, where the payout
        service is

        enabled for the merchant by sending an onboarding RFC.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          properties:
            account_id:
              type: string
              readOnly: true
            data:
              $ref: '#/components/schemas/ConfigRfcData'
            approved:
              description: >
                True/false if the RFC has been approved or rejected. Null if the
                RFC has yet to be processed.
              readOnly: true
              nullable: true
              type: string
            applied:
              type: boolean
              description: >
                When the changes requested by the RFC are applied, this property
                is set to true.
              readOnly: true
            rejected_reason:
              type: string
              description: |
                If the RFC was rejected, the reason is given here.
              readOnly: true
    ConfigDintero:
      type: object
      additionalProperties: false
      description: >
        Dintero config is internal, used to configure global settings in the
        payout service.
      properties:
        dintero_fee_account_id:
          type: string
          example: P00000000
          readOnly: true
          minLength: 9
          maxLength: 9
          description: |
            The account that will receive fee payouts.
            This account is more or less treated the same as a merchant,
            so it needs to have bank accounts set up in the same way.
        rounding_limit_rate:
          type: number
          minimum: 0
          maximum: 9
          description: >
            Decimal that defines what is considered a rounding error.

            The number is given as a rate of a unit in any currency.

            For example: 0.1 and currency USD means that anything below 0.1 USD
            is considered a rounding error
        updated_at:
          type: string
          format: date-time
          description: Time of last update
          readOnly: true
        updated_by:
          type: string
          description: User id of the user who last updated the config
          readOnly: true
    DinteroBankAccountBalance:
      type: object
      description: |
        Dintero bank account balance
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          required:
            - currency
            - amount
            - dintero_bank_account_id
            - read_at
          properties:
            currency:
              type: string
              minLength: 3
              maxLength: 3
              pattern: ^[A-Z]{3}$
            amount:
              type: string
              pattern: ^-?\d+\.\d+$
            dintero_bank_account_id:
              type: string
            read_at:
              type: string
              format: date-time
    DinteroBankAccountBalanceEstimate:
      type: object
      description: |
        Dintero bank account balance estimate
      required:
        - currency
        - amount
        - dintero_bank_account_id
      properties:
        currency:
          type: string
          readOnly: true
        amount:
          type: string
          readOnly: true
        dintero_bank_account_id:
          type: string
          readOnly: true
        known_balance:
          $ref: '#/components/schemas/DinteroBankAccountBalance'
        balance_drift:
          type: object
          readOnly: true
          required:
            - currency
            - amount
          properties:
            currency:
              type: string
              readOnly: true
            amount:
              type: string
              readOnly: true
    DinteroBankAccount:
      type: object
      description: >
        Bank account used as debtor account for payouts. One per supported
        currency.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          required:
            - bank_account_currency
            - bank_account_type
            - bank_account_number
            - bank_account_bic
            - bank_account_country_code
            - nickname
          properties:
            bank_account_currency:
              type: string
              minLength: 3
              maxLength: 3
              pattern: ^[A-Z]{3}$
            bank_account_type:
              type: string
              enum:
                - bban
                - iban
            bank_account_number:
              type: string
              maxLength: 34
              pattern: ^[\w\.\- ]+$
            bank_account_bic:
              type: string
              description: Bank identifier code
              maxLength: 11
              pattern: ^[A-Z\d]+$
            bank_account_country_code:
              type: string
              description: Which country the bank account is registered in
              maxLength: 2
              minLength: 2
              pattern: ^[A-Z]{2}$
            nickname:
              type: string
              minLength: 2
              maxLength: 40
    LedgerAccount:
      type: object
      description: |
        A ledger account is a typical accounting concept.
        It is used to categorize the different entries in a bundle,
        and defines a way to interpret the numbers within an account.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            account_number:
              type: string
              readOnly: true
            description:
              type: string
              readOnly: true
    LedgerCorrectionEntry:
      type: object
      description: |
        A correction entry
      required:
        - account_id
        - payout_destination_id
        - amount
        - reason
      properties:
        account_id:
          nullable: true
          type: string
        payout_destination_id:
          description: |
            Public seller id
          nullable: true
          type: string
        key:
          type: string
          maxLength: 40
          minLength: 10
          example: Idempotency key and uniqueness key for ledger
        amount:
          type: string
          pattern: ^-?\d+\.\d+$
        reason:
          type: string
          description: Why was the correction made?
    LedgerCorrection:
      type: object
      description: |
        A correction is changes made to the ledger.
      required:
        - type
        - account_id
        - payout_destination_id
        - currency
        - key
        - correction_entries
        - link_to_entry_ids
      properties:
        type:
          type: string
          enum:
            - settlement-correction
            - inbound-payment-correction
            - debt-correction
            - debt-transfer-correction
        account_id:
          nullable: true
          type: string
        payout_destination_id:
          description: |
            Use the public seller id
          nullable: true
          type: string
        currency:
          type: string
          maxLength: 3
          minLength: 3
          pattern: ^[A-Z]{3}$
          example: NOK
        key:
          type: string
          maxLength: 40
          minLength: 10
          example: Idempotency key and uniqueness key for ledger
        correction_entries:
          type: array
          items:
            $ref: '#/components/schemas/LedgerCorrectionEntry'
        link_to_entry_ids:
          type: array
          items:
            type: string
    PaymentMatchReportData:
      type: object
      properties:
        start_at:
          type: string
          description: Time of first payment event in this transfer
        end_at:
          type: string
          description: Time of last payment event in this transfer
        settled_at:
          type: string
          description: Settlement date
        created_at:
          type: string
          description: Time of creation of the transfer report
        provider:
          type: string
          description: Name of payment provider.
        provider_reference:
          type: string
          description: The provider's unique id of the settlement
        attachments:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Unique id of the attachment
              key:
                type: string
                description: Attachment path
              content_type:
                type: string
                example: application/xml
              extension:
                type: string
              created_by:
                type: string
                description: >
                  Where the attachment was created. Might be created by dintero,

                  or might be created by the providers, e.g. payex, vipps,
                  collector
                example: payex
        amounts:
          type: array
          items:
            type: object
            properties:
              amount:
                type: number
                description: |
                  The amount paid out, unless payment_status is postponed.

                  `amount = capture - refund - fee`
              capture:
                type: number
                description: |
                  The amount captured on the orders in the settlement period.
              refund:
                type: number
                description: |
                  The amount refunded on the orders in the settlement period.
              fee:
                type: number
                description: |
                  The sum of fees on the orders in the settlement period.
              currency:
                type: string
                format: iso4217-code
                example: NOK
        payment_status:
          type: string
          description: |
            Whether the amount in the report has actually been paid or not.
            The payment might be postponed for later.
          enum:
            - paid
            - postponed
        store_id:
          type: string
          description: |
            The sales location this report is for. Will only be set if all
            transactions share the same store_id.
        payout_destination_id:
          type: string
          description: |
            The seller id this report is for. Will only be set if all
            transactions share the same payout_destination_id.
    LedgerEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            account_id:
              type: string
              readOnly: true
              description: >-
                The dintero account id, or just empty string if there is no
                meaningful account.
            ledger_bundle_id:
              type: string
              readOnly: true
              description: >
                In double entry accounting, one must post two or more entries
                that together sum to 0.

                We call these entries a bundle.
            ledger_account_number:
              type: number
              readOnly: true
              description: The ledger account id
            ledger_link_id:
              readOnly: true
              description: >
                Ledger entries within the same account may be linked together.

                The purpose is to "close" a group of entries that cancel each
                other.

                Mostly relevant for ledger accounts that are supposed to have a
                balance of 0 over time,

                such as short term receivables/debt (1500/2400).
              nullable: true
              type: string
            payout_destination_id:
              type: string
              readOnly: true
              description: |
                The public dintero seller id, or just empty string.
            amount:
              type: string
              readOnly: true
              description: |
                Note that amount can be positive or negative.
                The interpretation is found from the ledger account.
            currency:
              type: string
              readOnly: true
              description: |
                Our ledger supports different currencies.
                Bundles and links must have all entries in the same currency.
            source:
              type: string
              readOnly: true
              description: Source/cause of the entry posting
            key:
              type: string
              readOnly: true
              description: Deduplication key
            meta:
              type: object
              description: Data related to entry. Everything is optional.
              readOnly: true
              properties:
                payment_id:
                  type: string
                  description: For entries posted due to inbound/outbound payments
                settlement_id:
                  type: string
                  description: For entries posted due to settlement
                settlement_item_id:
                  type: string
                  description: For entries posted due to settlement
                payment_provider:
                  readOnly: true
                  description: Payment provider as defined in settlement and payment
                  nullable: true
                  type: string
                payment_provider_reference:
                  readOnly: true
                  description: >-
                    Payment provider reference as defined in settlement and
                    payment
                  nullable: true
                  type: string
                payment_provider_agreement_id:
                  readOnly: true
                  description: Payment provider agreement id as defined in payment
                  nullable: true
                  type: string
                dintero_fee:
                  type: string
                  description: The calculated dintero fee
                total_fee:
                  type: string
                  description: The calculated total fee (dintero + psp)
                proposal_id:
                  type: string
                  description: For outbound payment postings
                proposal_item_id:
                  type: string
                  description: For outbound payment postings
                matched_entry_ids:
                  type: array
                  description: For payment-settlement match postings
                  items:
                    type: string
                correctionReason:
                  type: string
                  description: If entry was a correction, this is the reason
                dintero_bank_account_id:
                  readOnly: true
                  description: >-
                    Id of the dintero bank account which was the source of this
                    posting
                  nullable: true
                  type: string
            posted_at:
              type: string
              readOnly: true
              description: >
                The ledger entry should reflect reality as best as possible,

                so this field contains the time at which the real world event
                took place.

                For example, it would describe the time when a payment was
                actually paid,

                even though the entry may be posted significantly later.
            payment_match_report_data:
              $ref: '#/components/schemas/PaymentMatchReportData'
    LedgerManualMatch:
      type: object
      description: |
        A manual match of settlement entries with inbound payment entries
      required:
        - settlement_entry_ids
        - payment_entry_ids
      properties:
        settlement_entry_ids:
          type: array
          items:
            type: string
        payment_entry_ids:
          type: array
          items:
            type: string
    PayoutIntervalType:
      type: string
      enum:
        - millisecond
        - second
        - minute
        - hour
        - day
        - week
        - month
      description: >
        Describes how often payouts are to be made. Only week and month
        supported for now.

        The setting only controls how often a payment is to be prepared.

        It won't necessarily be sent at in given interval.
    DefaultBankAccountId:
      description: >
        If set, will default to this bank account for payouts.


        The default bank account is chosen when all of the below are true:


        - The transaction does not have a payout_destination_id set

        - There are no default bank accounts for the transaction currency (see
        bank_account.is_default_for_currency)


        You should set default_bank_account_number when:


        - You don't use sellers, and all your payments are in the same currency


        You should not set default_bank_account_number when:


        - You always use sellers for all transactions

        - You have bank accounts in multiple currencies. Use
        is_default_for_currency on the bank account instead.


        Warning: Payouts without a matching bank account will be put on hold
        until there is a match.
      nullable: true
      type: string
    PaymentMatchReportConfig:
      type: object
      description: >
        Creates reports for payments received by a payout destination (but not
        settled yet).


        Example use case: reports for marketplaces with multiple sellers, but
        receives all

        payments to a single escrow account, and then disburses the payments to
        the sellers via the

        transfers API. Since this flows bypasses payouts directly to the
        sellers, we will not be able

        go generate settlement reports for the merchant or sellers. The payment
        macth report

        can be used by the marketplace to see the data for payments received by
        their escrow account.
      additionalProperties: false
      required:
        - payout_destination
      properties:
        payout_destination:
          type: string
          description: The destination that has received payments.
          example: platform-escrow
    PayoutBuffer:
      type: object
      additionalProperties: false
      description: >
        The payout buffer amounts are used to determine the amount of money to
        keep in the account

        to ensure that payouts can be made even if there are chargebacks or
        refunds.
      properties:
        buffers:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - currency
              - fixed_amount
            properties:
              currency:
                type: string
                minLength: 3
                maxLength: 3
                pattern: ^[A-Z]{3}$
              fixed_amount:
                type: string
                description: >
                  Minimum amount that should be held back for payouts in this
                  currency. Should be set in increments of the average
                  transaction value for the customer.


                  For example, if the average transaction value is 1000 NOK, we
                  want to set the buffer to 10 000 NOK.
                example: '10000.00'
    ConfigAccount:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          additionalProperties: false
          properties:
            account_id:
              type: string
              readOnly: true
            payout_interval_type:
              $ref: '#/components/schemas/PayoutIntervalType'
            payout_interval_value:
              type: string
              description: Reserved for future use. Leave as empty string for now.
              example: ''
            payout_minimum_hold_days:
              type: integer
              minimum: 0
              readOnly: true
              description: >
                Minimum number of days the payout service will put payout on
                hold

                for all transactions.
            split_payout_enabled:
              type: boolean
              description: >
                Explicitly enable split payouts. |

                When split is enabled, the payout service will require order
                data for all transactions.
            fund_transfers:
              type: object
              readOnly: true
              properties:
                allow_unknown_destination_payout_destination_id:
                  type: boolean
                  description: >
                    Allow funds to be transfered to a destination that is
                    unknown

                    to payout, i.e. not yet been added as an approved payout

                    destination. Note that payout is not performed while the
                    payout

                    destination is not approved.
            default_bank_account_id:
              $ref: '#/components/schemas/DefaultBankAccountId'
            payment_match_report_configs:
              type: array
              items:
                $ref: '#/components/schemas/PaymentMatchReportConfig'
            payout_buffer:
              $ref: '#/components/schemas/PayoutBuffer'
    BankAccountCountryCode:
      type: string
      description: |
        Which country the bank account is registered in.
        Must be a two letter ISO 3166-1-alpha-2 country code.

        Supported bank account country codes:
          * `AT` (Austria)
          * `BE` (Belgium)
          * `HR` (Croatia)
          * `CY` (Cyprus)
          * `DK` (Denmark)
          * `EE` (Estonia)
          * `FI` (Finland)
          * `FR` (France)
          * `DE` (Germany)
          * `GR` (Greece)
          * `IE` (Ireland)
          * `IS` (Iceland)
          * `IT` (Italy)
          * `LV` (Latvia)
          * `LT` (Lithuania)
          * `LU` (Luxembourg)
          * `MT` (Malta)
          * `NL` (Netherlands)
          * `NO` (Norway)
          * `PT` (Portugal)
          * `SK` (Slovakia)
          * `SI` (Slovenia)
          * `ES` (Spain)
          * `SE` (Sweden)
          * `UK` (United Kingdoms)
          * `US` (United States of America)
      maxLength: 2
      minLength: 2
      pattern: ^[A-Z]{2}$
      example: 'NO'
    BankAccount:
      type: object
      description: >
        This object describes a bank account that will be used to receive
        payouts from the payout service.

        The bank account info can only be set through a config RFC (request for
        change).
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          properties:
            account_id:
              type: string
              readOnly: true
            bank_account_number:
              type: string
              description: Bank account number. Cannot be updated.
              maxLength: 34
              pattern: ^[\w\.\- ]+$
              example: NO9386011117947
            bank_account_type:
              type: string
              enum:
                - bban
                - iban
              description: |
                Bank account type.
                Use bban for accounts in Norway.
                Use iban for other countries.
            bank_account_bic:
              type: string
              description: Bank identifier code
              maxLength: 11
              pattern: ^[A-Z\d]+$
              example: DNBANOKKXXX
            bank_account_country_code:
              $ref: '#/components/schemas/BankAccountCountryCode'
            bank_account_currency:
              type: string
              description: >
                The currency of the bank account.

                This is used to determine which bank account to use for a
                payment.

                See also is_default_for_currency
              maxLength: 3
              minLength: 3
              pattern: ^[A-Z]{3}$
              example: NOK
            nickname:
              type: string
              description: >-
                Give a nickname to the bank account to more easily remember its
                purpose
              minLength: 2
              maxLength: 40
              example: My bank account
            is_default_for_currency:
              type: boolean
              description: >
                If set, will default to this bank account for payouts in the
                currency of the bank account.


                The default is chosen when all of the below are true:


                - The transaction does not have a payout_destination_id set

                - The currency of the transaction is equal to this bank account


                You should set is_default_for_currency when:


                - You don't use sellers

                - You have bank accounts in multiple currencies. If you only
                have one, you can use the global default bank account instead.


                You should not set is_default_for_currency when:


                - You always use sellers for all transactions


                Warning: Payouts without a matching bank account will be put on
                hold until there is a match.
            owner_name:
              type: string
              description: Name of the company that receives payments on this bank account
              minLength: 2
              maxLength: 60
              example: My company
            owner_country_code:
              type: string
              description: >-
                Country code of the company that receives payments on this bank
                account
              maxLength: 2
              minLength: 2
              pattern: ^[A-Z]{2}$
              example: 'NO'
            owner_city:
              type: string
              description: City of the company that receives payments on this bank account
              minLength: 1
              maxLength: 35
              example: Old Town
            owner_postal_code:
              type: string
              description: >-
                Postal code of the company that receives payments on this bank
                account
              minLength: 1
              maxLength: 16
              example: '1540'
            owner_address:
              type: string
              description: >-
                Address of the company that receives payments on this bank
                account
              minLength: 1
              maxLength: 70
              example: Corner street 25
            owner_orgno:
              type: string
              maxLength: 20
              description: >
                Organization number of the company that receives payments on
                this bank account.

                If country is Norway, the orgno should exist in
                Brønnøysundregisteret.
              example: '123456785'
            owner_verified_id:
              type: string
              maxLength: 60
              description: >
                A globally unique id for the account owner if the owner is an
                individual.
              example: PQ1234567.individual.E7DA8CC1F41F2784069FDDC6
    PayoutDestinationConfig:
      type: object
      description: >
        This object contains config pertaining to a seller.

        The interesting part of the config is in the relation to bank accounts.

        See
        [BankAccountPayoutDestination](./payout-api/config-account-payout-destination-links/aid_config_bank_account_payout_destinations_post)
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          additionalProperties: false
          properties:
            account_id:
              type: string
              readOnly: true
            payout_destination_id:
              type: string
              maxLength: 40
              description: |
                The id of the seller as defined elsewhere in dintero.
            reference:
              type: string
              maxLength: 60
              description: >
                A static reference that will be included on bank payments made
                to this seller
            name:
              type: string
              maxLength: 60
              description: |
                The name of the seller
            description:
              type: string
              maxLength: 1000
              description: |
                Description of the seller
            payout_interval_type:
              $ref: '#/components/schemas/PayoutIntervalType'
            payout_interval_value:
              type: string
              description: Reserved for future use. Leave as empty string for now.
              example: ''
    BankAccountPayoutDestination:
      type: object
      description: >
        This relational object describes how sellers are connected to bank
        accounts.

        If a payment is to made to a seller, the bank account is selected using
        this config.

        For bank account selection, the currency of the payment must also match
        the currency of the bank account.

        The is_default flag may be used for the cases where there are no bank
        accounts in the payment currency.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          properties:
            account_id:
              type: string
              readOnly: true
            is_default:
              type: boolean
              description: >
                If set, will default to this bank account for payouts to this
                seller.


                The default is chosen when all of the below are true:


                - The transaction has the correct seller set

                - The currency of the transaction does not match any of the bank
                accounts linked to the seller


                You should set is_default when:


                - You have potentially unknown currencies, and still want the
                money transferred


                You should not set is_default when:


                - You want all payments in the same currency as the bank account


                Warning: Payouts without a matching bank account will be put on
                hold until there is a match.
            config_bank_account_id:
              type: string
              description: Id of the related bank account
            payout_destination_config_id:
              type: string
              description: Id of the related seller config
    AdminConfigAccountData:
      type: object
      additionalProperties: false
      properties:
        payout_interval_type:
          $ref: '#/components/schemas/PayoutIntervalType'
        payout_interval_value:
          type: string
          description: Reserved for future use. Leave as empty string for now.
          example: ''
        payout_minimum_hold_days:
          type: integer
          minimum: 0
          description: |
            Minimum number of days the payout service will put payout on hold
            for all transactions.
        split_payout_enabled:
          type: boolean
          description: >
            Explicitly enable split payouts.

            When split is enabled, the payout service will require order data
            for all transactions.
        fund_transfers:
          type: object
          properties:
            allow_unknown_destination_payout_destination_id:
              type: boolean
              description: |
                Allow funds to be transfered to a destination that is unknown
                to payout, i.e. not yet been added as an approved payout
                destination. Note that payout is not performed while the payout
                destination is not approved.
        default_bank_account_id:
          $ref: '#/components/schemas/DefaultBankAccountId'
        payout_buffer:
          $ref: '#/components/schemas/PayoutBuffer'
    AdminConfigPayoutDestinationData:
      type: object
      additionalProperties: false
      properties:
        reference:
          type: string
          maxLength: 60
          description: >
            A static reference that will be included on bank payments made to
            this seller
        name:
          type: string
          maxLength: 60
          description: |
            The name of the seller
        description:
          type: string
          maxLength: 1000
          description: |
            Description of the seller
        payout_interval_type:
          $ref: '#/components/schemas/PayoutIntervalType'
        payout_interval_value:
          type: string
          description: Reserved for future use. Leave as empty string for now.
          example: ''
        payout_buffer:
          $ref: '#/components/schemas/PayoutBuffer'
    PaymentEvent:
      type: object
      description: >
        Bankfiles sent to the bank will result in various payment events
        described by this model.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            account_id:
              readOnly: true
              description: Dintero account id
              nullable: true
              type: string
            proposal_id:
              type: string
              readOnly: true
              description: The causing proposal
            proposal_item_id:
              readOnly: true
              description: The causing proposal item
              nullable: true
              type: string
            file_id:
              type: string
              readOnly: true
              description: The payment event was parsed from this bankfile.
            message_id:
              type: string
              readOnly: true
              description: |
                Id of the entire message specified by the bankfile
            group_id:
              readOnly: true
              description: |
                Id of the payment group (one group per sender bank account)
              nullable: true
              type: string
            transaction_id:
              readOnly: true
              description: |
                The original end to end id of the transaction.
                This should match one of our proposal item e2e_id's
              nullable: true
              type: string
            iso_type:
              type: string
              readOnly: true
              description: >
                The original status type.


                Copy pasta from bits-standards.org:


                Message:

                ACCP -  AcceptedCustomerProfile Preciding check of technical
                        validation was successful. Customer profile check was
                        also successful.
                        The financial institution has taken the responsibility to
                        forward the transaction(s) for settlement on instructed
                        date.
                ACTC -  AcceptedTechnicalValidation.  Authentication and
                        syntactical and semantical validation are successful.
                        Syntax control accepted
                PART -  Partially accepted and rejected (detailed information
                        on payment information or transaction level)
                RJCT -  The whole message has been rejected.


                Group/Payment:

                ACWC –  Accepted with change

                PART -  Partially accepted and rejected (detailed information
                        on transaction level)
                RJCT -  Rejected Payment initiation or individual transaction
                        included in the payment initiation has been rejected.
                PDNG -  Payment initiation or individual transaction included in
                the
                        payment initiation is pending. Further checks and status
                        update will be performed.

                Transaction:

                ACCP -  Accepted

                ACSC -  Accepted Settlement Completed

                ACSP -  Accepted Settlement In Process

                ACWC –  Accepted with change

                PDNG -  Pending further processing (lack of funding)

                RJCT -  Rejected Payment initiation or individual transaction
                        included in the payment initiation has been rejected.
            type:
              type: string
              readOnly: true
              description: Simplified status type
              enum:
                - info
                - error
            is_rejection:
              type: boolean
              readOnly: true
              description: |
                True if the payment rejected by the bank
            message:
              type: string
              readOnly: true
              description: |
                Free text field with info/reason why the event occurred
    Payment:
      type: object
      description: |
        A payment describes an actual bank payment (either sent or received).
        It is the result of parsing a bankfile, and so is closely related.
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            account_id:
              readOnly: true
              nullable: true
              type: string
            proposal_id:
              readOnly: true
              description: >
                If the payment is outbound, the payment is the result of this
                proposal.
              nullable: true
              type: string
            proposal_item_id:
              readOnly: true
              description: >
                If the payment is outbound, the payment is the result of this
                proposal item.
              nullable: true
              type: string
            file_id:
              type: string
              readOnly: true
              description: The payment was parsed from this bankfile.
            is_outbound:
              type: boolean
              readOnly: true
              description: |
                If true, sent by use.
                If false, received from bank.
            payment_id:
              type: string
              readOnly: true
              description: >
                The payment id is supposed to be unique for all payments.

                It is generated based on the payment information in the
                bankfile.
            message_id:
              type: string
              readOnly: true
              description: |
                The message id identifies the message sent as a bankfile.
            group_id:
              readOnly: true
              description: >
                The group id identifies the group of payments made from a given
                bank account.
              nullable: true
              type: string
            e2e_id:
              type: string
              readOnly: true
              description: >
                The end to end id identifies the monetary transaction from the
                original sender to final receiver
            paid_at:
              type: string
              readOnly: true
            dintero_bank_account_id:
              type: string
              readOnly: true
            sender_name:
              type: string
              readOnly: true
            sender_country:
              readOnly: true
              nullable: true
              type: string
            sender_bank_account_number:
              readOnly: true
              nullable: true
              type: string
            sender_bank_account_type:
              readOnly: true
              nullable: true
              type: string
            sender_bank_account_bic:
              readOnly: true
              nullable: true
              type: string
            receiver_name:
              readOnly: true
              nullable: true
              type: string
            receiver_country:
              readOnly: true
              nullable: true
              type: string
            receiver_bank_account_number:
              readOnly: true
              nullable: true
              type: string
            receiver_bank_account_type:
              readOnly: true
              nullable: true
              type: string
            receiver_bank_account_bic:
              readOnly: true
              nullable: true
              type: string
            message:
              type: string
              readOnly: true
              description: |
                Free text message attached to the transaction.
            tx_amount:
              type: string
              readOnly: true
              description: >
                The transaction amount is the actual amount that entered or left
                the bank account.

                See also instructed amount.
            tx_currency:
              type: string
              readOnly: true
            instructed_amount:
              readOnly: true
              description: >
                The instructed amount is the amount that the sender asked the
                bank to send.

                However, it might not be the amount that left the bank account,
                nor the amount that was ultimately received.

                The reason they may be different is because of currency exchange
                and bank fees.
              nullable: true
              type: string
            instructed_currency:
              readOnly: true
              nullable: true
              type: string
    ProposalItemStatus:
      type: string
      description: Current status of the proposal item
      example: created
      readOnly: true
      enum:
        - created
        - rejected
        - payment-succeeded
        - payment-failed
        - posted
    ProposalItem:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            e2e_id:
              type: string
              description: End to end id for the payment following the proposal
              readOnly: true
            payment_group_id:
              type: string
              readOnly: true
              description: >-
                Items with the same payment_group_id are sent from the same bank
                account
            status:
              $ref: '#/components/schemas/ProposalItemStatus'
            status_text:
              type: string
              readOnly: true
            proposal_id:
              type: string
              readOnly: true
            account_id:
              type: string
              readOnly: true
            payout_destination_id:
              readOnly: true
              nullable: true
              type: string
            reference:
              type: string
              readOnly: true
              description: Human-readable reference. Also used in payments and reports.
            config_bank_account_id:
              type: string
              description: Id of the bank account. See payout bank account config
              readOnly: true
            dintero_bank_account_id:
              type: string
              description: Id of the dintero bank account that will be used as sender
              readOnly: true
            amount:
              type: string
              example: '1.23'
              readOnly: true
            currency:
              type: string
              example: NOK
              readOnly: true
    AdditionalItem:
      discriminator:
        propertyName: type
        mapping:
          chargeback: '#/components/schemas/AdditionalItemChargeback'
          commission: '#/components/schemas/AdditionalItemCommission'
          fee: '#/components/schemas/AdditionalItemFee'
          payoutFundTransfer: '#/components/schemas/AdditionalItemPayoutFundTransfer'
          unknown: '#/components/schemas/AdditionalItemUnknown'
      description: >
        An additional item describes a transaction that is not a checkout
        transaction.

        Examples include chargebacks, commission, other fees, fund transfers,
        and more.

        Chargeback and fees are denoted using positive signage. For balance
        calculations, these must be multiplied by -1.

        When an additional item is included in a settlement, the balance
        (excluding fees) will be aggregated into "other_amount"
      oneOf:
        - $ref: '#/components/schemas/AdditionalItemChargeback'
        - $ref: '#/components/schemas/AdditionalItemCommission'
        - $ref: '#/components/schemas/AdditionalItemFee'
        - $ref: '#/components/schemas/AdditionalItemPayoutFundTransfer'
        - $ref: '#/components/schemas/AdditionalItemUnknown'
    ReportSummary:
      type: object
      properties:
        currency:
          type: string
          readOnly: true
        plannedAmount:
          type: string
          readOnly: true
        performedAmount:
          type: string
          readOnly: true
        grossAmount:
          type: string
          readOnly: true
        netAmount:
          type: string
          readOnly: true
        totalFee:
          type: string
          readOnly: true
        capturedAmount:
          type: string
          readOnly: true
        refundedAmount:
          type: string
          readOnly: true
        vat:
          type: string
          readOnly: true
    ReportItem:
      type: object
      properties:
        accountId:
          type: string
          readOnly: true
        payoutDestinationId:
          readOnly: true
          nullable: true
          type: string
        plannedPayment:
          type: object
          properties:
            accountId:
              type: string
              readOnly: true
            payoutDestinationId:
              readOnly: true
              nullable: true
              type: string
            amount:
              type: string
              readOnly: true
            currency:
              type: string
              readOnly: true
            plannedAt:
              type: string
              readOnly: true
            reference:
              type: string
              readOnly: true
        performedPayments:
          type: array
          items:
            type: object
            properties:
              accountId:
                readOnly: true
                nullable: true
                type: string
              amount:
                readOnly: true
                nullable: true
                type: string
              currency:
                readOnly: true
                nullable: true
                type: string
              bankAccountNumber:
                readOnly: true
                nullable: true
                type: string
              paidAt:
                type: string
                readOnly: true
              reference:
                type: string
                readOnly: true
        details:
          type: array
          items:
            type: object
            properties:
              accountId:
                type: string
                readOnly: true
              payoutDestinationId:
                readOnly: true
                nullable: true
                type: string
              grossAmount:
                type: string
                readOnly: true
              netAmount:
                type: string
                readOnly: true
              totalFee:
                type: string
                readOnly: true
              capturedAmount:
                type: string
                readOnly: true
              refundedAmount:
                type: string
                readOnly: true
              vat:
                type: string
                readOnly: true
              currency:
                type: string
                readOnly: true
              transactions:
                type: array
                items:
                  type: object
                  properties:
                    grossAmount:
                      type: string
                      readOnly: true
                    netAmount:
                      type: string
                      readOnly: true
                    totalFee:
                      type: string
                      readOnly: true
                    sourceTransaction:
                      type: object
                      description: The checkout transaction
                      properties:
                        id:
                          type: string
                          readOnly: true
                        transactionId:
                          readOnly: true
                          nullable: true
                          type: string
                        capturedAmount:
                          type: string
                          readOnly: true
                        refundedAmount:
                          type: string
                          readOnly: true
                        vat:
                          type: string
                          readOnly: true
                        storeId:
                          readOnly: true
                          nullable: true
                          type: string
                        payoutDestinationId:
                          readOnly: true
                          nullable: true
                          type: string
                        transactionDate:
                          type: string
                          readOnly: true
                        merchantReference:
                          type: string
                          readOnly: true
                        merchantReference2:
                          readOnly: true
                          nullable: true
                          type: string
                        paymentProductType:
                          type: string
                          readOnly: true
                        eventReference:
                          readOnly: true
                          nullable: true
                          type: string
              additional_items:
                type: array
                items:
                  $ref: '#/components/schemas/AdditionalItem'
        additionalEntries:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                readOnly: true
              type:
                type: string
                readOnly: true
                example: paymentAdjusted
                enum:
                  - paymentAdjusted
                  - correction
                  - fee
                  - unknown
              accountId:
                type: string
                readOnly: true
              payoutDestinationId:
                readOnly: true
                nullable: true
                type: string
              amount:
                type: string
                readOnly: true
              currency:
                type: string
                readOnly: true
              date:
                type: string
                readOnly: true
              reason:
                type: string
                description: >
                  Some transactions in the report may not be based on a checkout
                  transaction.

                  These could be fee's or manual adjustments/correction
                  (depending on the type).
                readOnly: true
        summaries:
          type: array
          items:
            $ref: '#/components/schemas/ReportSummary'
    Report:
      type: object
      properties:
        version:
          type: string
          readOnly: true
        items:
          type: array
          items:
            $ref: '#/components/schemas/ReportItem'
        summaries:
          type: array
          items:
            $ref: '#/components/schemas/ReportSummary'
    ProposalStatus:
      type: string
      description: Current status of the proposal
      example: approved
      readOnly: true
      enum:
        - created
        - approved
        - rejected
        - payment-initated
        - payment-succeeded
        - payment-failed
        - posted
    ProposalItemsTotal:
      type: object
      description: Total per currency for items in a given proposal
      properties:
        amount:
          type: string
          readOnly: true
          example: '1.23'
        currency:
          type: string
          readOnly: true
          example: NOK
    Proposal:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            e2e_id:
              type: string
              description: End to end id for the payment following the proposal
              readOnly: true
            status:
              $ref: '#/components/schemas/ProposalStatus'
            status_text:
              type: string
              readOnly: true
            description:
              type: string
              readOnly: true
            items_totals:
              description: Lists total amount of items in proposal per currency
              type: array
              items:
                $ref: '#/components/schemas/ProposalItemsTotal'
    PendingItem:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            payment_group_id:
              type: string
              readOnly: true
              description: >-
                Items with the same payment_group_id are sent from the same bank
                account
            proposal_id:
              type: string
              readOnly: true
            account_id:
              type: string
              readOnly: true
            payout_destination_id:
              readOnly: true
              nullable: true
              type: string
            config_bank_account_id:
              type: string
              description: Id of the bank account. See payout bank account config
              readOnly: true
            dintero_bank_account_id:
              type: string
              description: Id of the dintero bank account that will be used as sender
              readOnly: true
            amount:
              type: string
              example: '1.23'
              readOnly: true
            currency:
              type: string
              example: NOK
              readOnly: true
            pending_reason:
              required:
                - type
              type: object
              readOnly: true
              description: Reason why the item is pending
              properties:
                type:
                  type: string
                  readOnly: true
                  description: Type of pending reason
                  enum:
                    - payoutBuffer
                    - payoutMinimumHoldDays
                payout_buffer:
                  $ref: '#/components/schemas/PayoutBuffer'
                payout_minimum_hold_days:
                  type: integer
                  minimum: 0
                  description: >
                    Minimum number of days the payout service will put payout on
                    hold

                    for all transactions.
    SettlementStatus:
      type: string
      description: Current status of the settlement processed for payout
      example: succeeded
      readOnly: true
      enum:
        - initiated
        - rejected
        - failed
        - succeeded
    Settlement:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            account_id:
              type: string
              readOnly: true
            settlement_id:
              type: string
              description: id of the settlement that was processed
              readOnly: true
            status:
              $ref: '#/components/schemas/SettlementStatus'
            status_text:
              type: string
              description: >-
                Describes reason for status. Usually only applicable for status
                failed or rejected
              readOnly: true
            settled_at:
              type: string
              format: date-time
              description: The date-time when the settlement was settled
              readOnly: true
            payment_provider_reference:
              type: string
              readOnly: true
            payment_provider:
              type: string
              readOnly: true
    SettlementDataItem:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        version:
          type: string
          readOnly: true
          description: Only model version 3 is shown
        account_id:
          type: string
          readOnly: true
        payout_destination_id:
          type: string
          readOnly: true
        gross_amount:
          type: string
          readOnly: true
        net_amount:
          type: string
          readOnly: true
        psp_fee:
          type: string
          readOnly: true
        dintero_fee:
          type: string
          readOnly: true
        total_fee:
          type: string
          readOnly: true
        vat:
          type: string
          readOnly: true
        captured_amount:
          type: string
          readOnly: true
        refunded_amount:
          type: string
          readOnly: true
        currency:
          type: string
          example: NOK
          readOnly: true
        transactions:
          type: array
          readOnly: true
          items:
            type: object
            properties:
              gross_amount:
                type: string
                readOnly: true
              net_amount:
                type: string
                readOnly: true
              total_fee:
                type: string
                readOnly: true
              psp_fee:
                type: string
                readOnly: true
              dintero_fee:
                type: string
                readOnly: true
              source_transaction:
                type: array
                readOnly: true
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: >-
                        Id assigned by payout. The source transaction can appear
                        in multiple settlement item transactions due to split
                        etc.
                    payment_product_type:
                      type: string
                      readOnly: true
                    captured_amount:
                      type: string
                      readOnly: true
                    refunded_amount:
                      type: string
                      readOnly: true
                    psp_fee:
                      type: string
                      readOnly: true
                    transaction_date:
                      type: string
                      format: date-time
                      readOnly: true
                    merchant_reference:
                      type: string
                      readOnly: true
                    merchant_reference2:
                      type: string
                      readOnly: true
                      description: Optional
                    store_id:
                      type: string
                      readOnly: true
                      description: Optional
                    payout_destination_id:
                      type: string
                      readOnly: true
                      description: Optional
                    transaction_id:
                      type: string
                      readOnly: true
                      description: Optional
                    vat:
                      type: string
                      readOnly: true
                    event_reference:
                      type: string
                      readOnly: true
                      description: Optional
                    payout_splits:
                      type: array
                      readOnly: true
                      description: Splits per item as provided in the checkout service
                      items:
                        type: object
                        readOnly: true
                        properties:
                          fee_split:
                            type: object
                            readOnly: true
                            properties:
                              type:
                                type: string
                                enum:
                                  - proportional
                                  - equal_fee_only
                                readOnly: true
                              destinations:
                                type: array
                                readOnly: true
                                items:
                                  type: string
                                  readOnly: true
                          splits:
                            type: array
                            readOnly: true
                            items:
                              type: object
                              readOnly: true
                              properties:
                                amount:
                                  type: string
                                  readOnly: true
                                  description: >-
                                    Stringified amount, given as a decimal
                                    number
                                payout_destination_id:
                                  type: string
                                  readOnly: true
              subscription:
                type: object
                readOnly: true
                description: Optional
                properties:
                  account_id:
                    type: string
                    readOnly: true
                  payment_provider:
                    type: string
                    readOnly: true
                  payment_provider_product_type:
                    type: string
                    readOnly: true
                  prices:
                    type: array
                    readOnly: true
                    items:
                      type: object
                      readOnly: true
                      properties:
                        currency:
                          type: string
                          readOnly: true
                        amount:
                          type: string
                          readOnly: true
                        type:
                          type: string
                          readOnly: true
                        up_to:
                          type: string
                          readOnly: true
        additional_items:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalItem'
    SettlementData:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            processed_settlement_id:
              type: string
              description: Id of the processed settlement
              readOnly: true
            settled_amount:
              type: string
              readOnly: true
            gross_amount:
              type: string
              readOnly: true
            psp_fee:
              type: string
              readOnly: true
            dintero_fee:
              type: string
              readOnly: true
            total_fee:
              type: string
              readOnly: true
            currency:
              type: string
              example: NOK
              readOnly: true
            items:
              type: array
              items:
                $ref: '#/components/schemas/SettlementDataItem'
    BankAccountPayoutDestinationCreateData:
      type: object
      allOf:
        - $ref: '#/components/schemas/BankAccountPayoutDestination'
        - type: object
          additionalProperties: false
          properties:
            is_default:
              type: boolean
            config_bank_account_id:
              type: string
            payout_destination_config_id:
              type: string
          required:
            - is_default
            - config_bank_account_id
            - payout_destination_config_id
    BankAccountPayoutDestinationUpdateData:
      type: object
      additionalProperties: false
      properties:
        is_default:
          type: boolean
          description: >
            If set, will default to this bank account for payouts to this
            seller.


            The default is chosen when all of the below are true:


            - The transaction has the correct seller set

            - The currency of the transaction does not match any of the bank
            accounts linked to the seller


            You should set is_default when:


            - You have potentially unknown currencies, and still want the money
            transferred


            You should not set is_default when:


            - You want all payments in the same currency as the bank account


            Warning: Payouts without a matching bank account will be put on hold
            until there is a match.
      required:
        - is_default
    BankAccountUpdateData:
      type: object
      additionalProperties: false
      properties:
        nickname:
          type: string
          description: >-
            Give a nickname to the bank account to more easily remember its
            purpose
          maxLength: 40
        is_default_for_currency:
          type: boolean
          description: >
            If set, will default to this bank account for payouts in the
            currency of the bank account.


            The default is chosen when all of the below are true:


            - The transaction does not have a payout_destination_id set

            - The currency of the transaction is equal to this bank account


            You should set is_default_for_currency when:


            - You don't use sellers

            - You have bank accounts in multiple currencies. If you only have
            one, you can use the global default bank account instead.


            You should not set is_default_for_currency when:


            - You always use sellers for all transactions


            Warning: Payouts without a matching bank account will be put on hold
            until there is a match.
    FundTransferCreateData:
      type: object
      required:
        - fund_transfer_id
        - type
        - source_payout_destination_id
        - destination_payout_destination_id
        - amount
        - currency
        - reference
      properties:
        fund_transfer_id:
          type: string
          description: >
            A string id that uniquely identifies the fund transfer. The `id` is
            used

            for idempotent processing so you can safely retry the request with
            same

            id if you don't receive a response (for example, in case of a
            timeout)
        type:
          type: string
          enum:
            - payout-destination
        source_payout_destination_id:
          type: string
        destination_payout_destination_id:
          type: string
        amount:
          type: string
          pattern: ^\d+\.\d+$
          description: The amount of the fund transfer
        currency:
          type: string
        reference:
          type: string
          maxLength: 60
          description: >
            A static reference that will be included on settlements made to the
            sellers
    FundTransfer:
      description: |
        This object contains the result from initiating a transfer fund
      allOf:
        - $ref: '#/components/schemas/FundTransferCreateData'
        - required:
            - account_id
            - created_at
            - created_by
          properties:
            account_id:
              type: string
            created_at:
              type: string
              format: date-time
              description: The date-time when the resource was created
              readOnly: true
            created_by:
              type: string
              description: User id of the user who created the resource
              readOnly: true
    PayoutDestinationConfigCreateData:
      type: object
      allOf:
        - type: object
          required:
            - payout_destination_id
            - reference
          additionalProperties: false
          properties:
            payout_destination_id:
              type: string
            reference:
              type: string
            name:
              type: string
            description:
              type: string
            payout_buffer:
              $ref: '#/components/schemas/PayoutBuffer'
    PayoutDestinationConfigUpdateData:
      type: object
      additionalProperties: false
      properties:
        reference:
          type: string
          maxLength: 60
          description: >
            A static reference that will be included on bank payments made to
            this seller
        name:
          type: string
          maxLength: 60
          description: |
            The name of the seller
        description:
          type: string
          maxLength: 1000
          description: |
            Description of the seller
        payout_buffer:
          $ref: '#/components/schemas/PayoutBuffer'
    PayoutDestinationBalance:
      type: object
      description: |
        Seller balance for a currency
      allOf:
        - type: object
          required:
            - account_id
            - payout_destination_config_id
            - payout_destination_id
            - currency
            - amount
          properties:
            account_id:
              type: string
              readOnly: true
            payout_destination_config_id:
              type: string
              description: >-
                A string id that uniquely identifies the payout destination
                configuration id
              readOnly: true
            payout_destination_id:
              type: string
              maxLength: 40
              description: |
                The id of the seller as defined elsewhere in dintero.
            currency:
              type: string
              minLength: 3
              maxLength: 3
              pattern: ^[A-Z]{3}$
            amount:
              type: string
              pattern: ^-?\d+\.\d+$
    PayoutDestinationBalances:
      type: array
      items:
        $ref: '#/components/schemas/PayoutDestinationBalance'
    PayoutDestinationTransferEntry:
      type: object
      description: |
        Seller transfer entry
      required:
        - ledger_entry_id
        - account_id
        - payout_destination_config_id
        - payout_destination_id
        - created_at
        - currency
        - amount
        - type
        - inbound_payment_provider
        - transfer_id
        - transfer_source_payout_destination_id
        - transfer_destination_payout_destination_id
        - transfer_reference
        - outbound_receiver_country
        - outbound_receiver_bank_account_type
        - outbound_receiver_bank_account_number
        - outbound_receiver_bank_account_bic
        - outbound_message
      properties:
        ledger_entry_id:
          type: string
          readOnly: true
          description: A string id that uniquely identifies the entry in the ledger
        account_id:
          type: string
          readOnly: true
          description: The Dintero account id
        payout_destination_config_id:
          type: string
          readOnly: true
          description: >-
            A string id that uniquely identifies the payout destination
            configuration id
        payout_destination_id:
          type: string
          readOnly: true
          maxLength: 40
          description: |
            The id of the seller as defined elsewhere in dintero.
        created_at:
          type: string
          format: date-time
          description: The date-time when the resource was created
          readOnly: true
        currency:
          type: string
          readOnly: true
          minLength: 3
          maxLength: 3
          pattern: ^[A-Z]{3}$
        amount:
          type: string
          readOnly: true
          pattern: ^-?\d+\.\d+$
        type:
          type: string
          readOnly: true
          enum:
            - inbound
            - transfer
            - outbound
          description: >
            The type of the transfer.

            - `inbound` is a transfer from a payment provider to the sellers
            account in Dintero

            - `transfer` is a transfer between two Dintero sellers

            - `outbound` is a transfer from the seller account in Dintero to the
            sellers bank account
        inbound_payment_provider:
          type: string
          readOnly: true
          description: >
            The underlying payment provider for the inbound payment, eg.
            `collector`, `bambora`, `payex`.

            Only applicable for type `inbound`
          nullable: true
        transfer_id:
          type: string
          readOnly: true
          description: |
            The id of the transfer.
            Only applicable for type `transfer`
          nullable: true
        transfer_source_payout_destination_id:
          type: string
          readOnly: true
          description: >
            The id of the seller that money was transferred from as defined
            elsewhere in dintero.

            Only applicable for type `transfer`
          nullable: true
        transfer_destination_payout_destination_id:
          type: string
          readOnly: true
          description: >
            The id of the seller that money was transferred to as defined
            elsewhere in dintero.

            Only applicable for type `transfer`
          nullable: true
        transfer_reference:
          type: string
          readOnly: true
          description: |
            The reference of the transfer.
            Only applicable for type `transfer`
          nullable: true
        outbound_receiver_country:
          type: string
          readOnly: true
          description: |
            The country of the bank account that will receive the funds.
            Only applicable for type `outbound`
          nullable: true
        outbound_receiver_bank_account_type:
          type: string
          readOnly: true
          description: >
            The bank account number type that will receive the funds, eg. `iban`
            or `bban`.

            Only applicable for type `outbound`
          nullable: true
        outbound_receiver_bank_account_number:
          type: string
          readOnly: true
          description: |
            The bank account number that will receive the funds.
            Only applicable for type `outbound`
          nullable: true
        outbound_receiver_bank_account_bic:
          type: string
          readOnly: true
          description: >
            The bic for the bank account will receive the funds.

            Only applicable for type `outbound` if the bank account type is
            `iban`
          nullable: true
        outbound_message:
          type: string
          readOnly: true
          description: |
            Text message attached to the bank transaction.
            Only applicable for type `outbound`
          nullable: true
        payment_match_report_data:
          $ref: '#/components/schemas/PaymentMatchReportData'
    PayoutDestinationTransfers:
      type: array
      items:
        $ref: '#/components/schemas/PayoutDestinationTransferEntry'
    ReportPreview:
      type: object
      properties:
        version:
          type: string
          readOnly: true
        items:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/ReportItem'
              - type: object
                properties:
                  config_bank_account_id:
                    type: string
                    readOnly: true
        summaries:
          type: array
          items:
            $ref: '#/components/schemas/ReportSummary'
    FundTransferCreateDataV2:
      type: object
      required:
        - fund_transfer_id
        - type
        - source_payout_destination_id
        - destination_payout_destination_id
        - amount
        - currency
        - reference
      properties:
        fund_transfer_id:
          type: string
          description: >
            A string id that uniquely identifies the fund transfer. The `id` is
            used

            for idempotent processing so you can safely retry the request with
            same

            id if you don't receive a response (for example, in case of a
            timeout)
        type:
          type: string
          enum:
            - payout-destination
        source_payout_destination_id:
          type: string
        destination_payout_destination_id:
          type: string
        amount:
          type: integer
          minimum: 1
          description: The amount of the fund transfer in the smallest unit of the currency
        currency:
          type: string
        reference:
          type: string
          maxLength: 60
          description: >
            A static reference that will be included on settlements made to the
            sellers
    FundTransferV2:
      description: |
        This object contains the result from initiating a transfer fund
      allOf:
        - $ref: '#/components/schemas/FundTransferCreateDataV2'
        - required:
            - account_id
            - created_at
            - created_by
          properties:
            account_id:
              type: string
            created_at:
              type: string
              format: date-time
              description: The date-time when the resource was created
              readOnly: true
            created_by:
              type: string
              description: User id of the user who created the resource
              readOnly: true
    MinimumAmounts:
      type: object
      additionalProperties: false
      properties:
        limits:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - amount
              - currency
            properties:
              currency:
                type: string
                minLength: 3
                maxLength: 3
                pattern: ^[A-Z]{3}$
              amount:
                type: integer
                minimum: 0
                description: Amount in the smallest unit for the currency
    PayoutDestinationConfigV2:
      type: object
      description: >
        This object contains config pertaining to a seller.

        The interesting part of the config is in the relation to bank accounts.

        See
        [BankAccountPayoutDestination](./payout-api/config-account-payout-destination-links/aid_config_bank_account_payout_destinations_post)
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Auditable'
        - type: object
          additionalProperties: false
          properties:
            account_id:
              type: string
              readOnly: true
            payout_destination_id:
              type: string
              maxLength: 40
              description: |
                The id of the seller as defined elsewhere in dintero.
            reference:
              type: string
              maxLength: 60
              description: >
                A static reference that will be included on bank payments made
                to this seller
            name:
              type: string
              maxLength: 60
              description: |
                The name of the seller
            description:
              type: string
              maxLength: 1000
              description: |
                Description of the seller
            payout_interval_type:
              $ref: '#/components/schemas/PayoutIntervalType'
            payout_interval_value:
              type: string
              description: Reserved for future use. Leave as empty string for now.
              example: ''
            payout_minimum_amount:
              description: >
                Minimum amount per currency for payout to the payout
                destination.
              type: array
              items:
                $ref: '#/components/schemas/MinimumAmounts'
    PayoutBufferV2:
      type: object
      additionalProperties: false
      properties:
        buffers:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - fixed_amount
              - currency
            properties:
              currency:
                type: string
                minLength: 3
                maxLength: 3
                pattern: ^[A-Z]{3}$
              fixed_amount:
                type: integer
                minimum: 0
                description: Amount in the smallest unit of the currency
    PayoutDestinationConfigCreateDataV2:
      type: object
      allOf:
        - type: object
          additionalProperties: false
          required:
            - payout_destination_id
            - reference
          properties:
            payout_destination_id:
              type: string
            reference:
              type: string
            name:
              type: string
            description:
              type: string
            payout_buffer:
              $ref: '#/components/schemas/PayoutBufferV2'
            payout_minimum_amount:
              $ref: '#/components/schemas/MinimumAmounts'
    PayoutDestinationConfigUpdateDataV2:
      type: object
      additionalProperties: false
      properties:
        reference:
          type: string
          maxLength: 60
          description: >
            A static reference that will be included on bank payments made to
            this seller
        name:
          type: string
          maxLength: 60
          description: |
            The name of the seller
        description:
          type: string
          maxLength: 1000
          description: |
            Description of the seller
        payout_buffer:
          $ref: '#/components/schemas/PayoutBufferV2'
        payout_minimum_amount:
          $ref: '#/components/schemas/MinimumAmounts'
    PayoutDestinationBalanceV2:
      type: object
      description: |
        Seller balance for a currency
      allOf:
        - type: object
          required:
            - account_id
            - payout_destination_config_id
            - payout_destination_id
            - currency
            - amount
          properties:
            account_id:
              type: string
              readOnly: true
            payout_destination_config_id:
              type: string
              description: >-
                A string id that uniquely identifies the payout destination
                configuration id
              readOnly: true
            payout_destination_id:
              type: string
              maxLength: 40
              description: |
                The id of the seller as defined elsewhere in dintero.
            currency:
              type: string
              minLength: 3
              maxLength: 3
              pattern: ^[A-Z]{3}$
            amount:
              type: integer
              description: Amount in the smallest unit of the currency
    PayoutDestinationBalancesV2:
      type: array
      items:
        $ref: '#/components/schemas/PayoutDestinationBalanceV2'
    PaymentMatchReportDataV2:
      type: object
      properties:
        start_at:
          type: string
          description: Time of first payment event in this transfer
        end_at:
          type: string
          description: Time of last payment event in this transfer
        settled_at:
          type: string
          description: Settlement date
        created_at:
          type: string
          description: Time of creation of the transfer report
        provider:
          type: string
          description: Name of payment provider.
        provider_reference:
          type: string
          description: The provider's unique id of the settlement
        attachments:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Unique id of the attachment
              key:
                type: string
                description: Attachment path
              content_type:
                type: string
                example: application/xml
              extension:
                type: string
              created_by:
                type: string
                description: >
                  Where the attachment was created. Might be created by dintero,

                  or might be created by the providers, e.g. payex, vipps,
                  collector
                example: payex
        amounts:
          type: array
          items:
            type: object
            properties:
              amount:
                type: number
                description: |
                  The amount paid out, unless payment_status is postponed.

                  `amount = capture - refund - fee`
              capture:
                type: number
                description: |
                  The amount captured on the orders in the settlement period.
              refund:
                type: number
                description: |
                  The amount refunded on the orders in the settlement period.
              fee:
                type: number
                description: |
                  The sum of fees on the orders in the settlement period.
              currency:
                type: string
                format: iso4217-code
                example: NOK
        payment_status:
          type: string
          description: |
            Status of the payment.
          enum:
            - payment-match
        store_id:
          type: string
          description: |
            The sales location this report is for. Will only be set if all
            transactions share the same store_id.
        payout_destination_id:
          type: string
          description: |
            The seller id this report is for. Will only be set if all
            transactions share the same payout_destination_id.
    PayoutDestinationTransferEntryV2:
      type: object
      description: |
        Seller transfer entry
      required:
        - ledger_entry_id
        - account_id
        - payout_destination_config_id
        - payout_destination_id
        - created_at
        - currency
        - amount
        - type
        - inbound_payment_provider
        - transfer_id
        - transfer_source_payout_destination_id
        - transfer_destination_payout_destination_id
        - transfer_reference
        - outbound_receiver_country
        - outbound_receiver_bank_account_type
        - outbound_receiver_bank_account_number
        - outbound_receiver_bank_account_bic
        - outbound_message
      properties:
        ledger_entry_id:
          type: string
          readOnly: true
          description: A string id that uniquely identifies the entry in the ledger
        account_id:
          type: string
          readOnly: true
          description: The Dintero account id
        payout_destination_config_id:
          type: string
          readOnly: true
          description: >-
            A string id that uniquely identifies the payout destination
            configuration id
        payout_destination_id:
          type: string
          readOnly: true
          maxLength: 40
          description: |
            The id of the seller as defined elsewhere in dintero.
        created_at:
          type: string
          format: date-time
          description: The date-time when the resource was created
          readOnly: true
        currency:
          type: string
          readOnly: true
          minLength: 3
          maxLength: 3
          pattern: ^[A-Z]{3}$
        amount:
          type: integer
          readOnly: true
          description: Amount in the smallest unit of the currency
        type:
          type: string
          readOnly: true
          enum:
            - inbound
            - transfer
            - outbound
          description: >
            The type of the transfer.

            - `inbound` is a transfer from a payment provider to the sellers
            account in Dintero

            - `transfer` is a transfer between two Dintero sellers

            - `outbound` is a transfer from the seller account in Dintero to the
            sellers bank account
        inbound_payment_provider:
          type: string
          readOnly: true
          description: >
            The underlying payment provider for the inbound payment, eg.
            `collector`, `bambora`, `payex`.

            Only applicable for type `inbound`
          nullable: true
        transfer_id:
          type: string
          readOnly: true
          description: |
            The id of the transfer.
            Only applicable for type `transfer`
          nullable: true
        transfer_source_payout_destination_id:
          type: string
          readOnly: true
          description: >
            The id of the seller that money was transferred from as defined
            elsewhere in dintero.

            Only applicable for type `transfer`
          nullable: true
        transfer_destination_payout_destination_id:
          type: string
          readOnly: true
          description: >
            The id of the seller that money was transferred to as defined
            elsewhere in dintero.

            Only applicable for type `transfer`
          nullable: true
        transfer_reference:
          type: string
          readOnly: true
          description: |
            The reference of the transfer.
            Only applicable for type `transfer`
          nullable: true
        outbound_receiver_country:
          type: string
          readOnly: true
          description: |
            The country of the bank account that will receive the funds.
            Only applicable for type `outbound`
          nullable: true
        outbound_receiver_bank_account_type:
          type: string
          readOnly: true
          description: >
            The bank account number type that will receive the funds, eg. `iban`
            or `bban`.

            Only applicable for type `outbound`
          nullable: true
        outbound_receiver_bank_account_number:
          type: string
          readOnly: true
          description: |
            The bank account number that will receive the funds.
            Only applicable for type `outbound`
          nullable: true
        outbound_receiver_bank_account_bic:
          type: string
          readOnly: true
          description: >
            The bic for the bank account will receive the funds.

            Only applicable for type `outbound` if the bank account type is
            `iban`
          nullable: true
        outbound_message:
          type: string
          readOnly: true
          description: |
            Text message attached to the bank transaction.
            Only applicable for type `outbound`
          nullable: true
        payment_match_report_data:
          $ref: '#/components/schemas/PaymentMatchReportDataV2'
    PayoutDestinationTransfersV2:
      type: array
      items:
        $ref: '#/components/schemas/PayoutDestinationTransferEntryV2'
    UnpaidDebt:
      type: object
      description: |
        Stale unpaid debt
      required:
        - account_id
        - currency
        - amount
      properties:
        account_id:
          type: string
          readOnly: true
        payout_destination_id:
          type: string
          readOnly: true
        currency:
          type: string
          readOnly: true
        amount:
          type: integer
          readOnly: true
          description: Amount in the smallest unit of the currency
    RetainedTransaction:
      type: object
      description: A retained transaction to be released
      properties:
        amount:
          type: integer
          readOnly: true
          description: Amount in the smallest unit of the currency
        currency:
          type: string
          readOnly: true
          x-example: NOK
        payout_event_correlation_id:
          type: string
          readOnly: true
          description: A unique id for the retained transaction.
    BlockRuleReadOnly:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        created_by:
          type: string
          description: User id of the user who created the resource
          readOnly: true
        updated_by:
          type: string
          description: User id of the user who last updated the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          description: Time of deletion
          readOnly: true
          nullable: true
        deleted_by:
          type: string
          description: User id of the user who deleted the resource
          readOnly: true
          nullable: true
    BlockRuleDataBase:
      type: object
      properties:
        type:
          type: string
          enum:
            - bank-account
            - dintero-account
            - owner-orgno
            - owner-verified-id
            - payout-destination
          example: bank-account
    ConfigRfcDataBase:
      type: object
      properties:
        type:
          type: string
          enum:
            - configBankAccountUpdate
            - configBankAccountCreate
            - onboarding
    AdditionalItemBase:
      type: object
      description: >
        An additional item describes a transaction that is not a checkout
        transaction.

        Examples include chargebacks, commission, other fees, fund transfers,
        and more.

        Chargeback and fees are denoted using positive signage. For balance
        calculations, these must be multiplied by -1.

        When an additional item is included in a settlement, the balance
        (excluding fees) will be aggregated into "other_amount"
      properties:
        type:
          type: string
          enum:
            - chargeback
            - fee
            - commission
            - payoutFundTransfer
            - unknown
