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

# 银行列表 API：机构与能力

> Didit 的机构列表接口按国家返回银行及各机构支持的能力，包括业务类型、持续访问、同意期限、历史数据深度和可用字段。

Didit 的 List Institutions endpoint可按国家/地区返回银行列表，并说明每家银行支持的内容：细分、持续访问权限、同意期限、历史数据跨度以及返回的字段。
可使用 `country`、`segment`、`access` 和 `q` 进行过滤。
参见[银行覆盖范围](https://docs.didit.me/zh/core-technology/bank-verification/coverage.md)。


## OpenAPI

````yaml zh/openapi-25.json GET /v3/bank/institutions/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      银行数据服务涵盖银行链接、连接、账户、余额、交易、机构和覆盖范围。银行数据可用于沙盒应用。在宣布开放生产访问之前，生产应用的调用将返回
      `404`。沙盒环境不收费。使用 API
      密钥进行的调用，需要具备银行数据权限（`bank-data`）的密钥：读取操作需要读取权限，会更改数据的操作需要写入权限。账户核验是例外，它需要会话的写入权限或完全访问权限，而不需要银行数据权限。银行数据不属于完全访问权限的一部分：完全访问密钥会被拒绝，调用返回
      `403
      bank_data_access_denied`，直到您创建具备该权限的密钥为止。原始银行数据（账户、余额、交易以及变更流）同样会拒绝不携带 API
      密钥的请求。


      除账户核验外，`/v3/bank/` 下的每个拒绝响应都具有相同的 JSON
      结构（`code`、`message`、`request_id`、`field`、`next_action`、`retry_after`）。不是操作的路径、不是
      UUID 的 ID 或未知的子资源，对于所有方法都返回 `404 not_found`；任何意外错误都返回 `500 internal_error`
      及 `request_id`。在银行数据不可用时，每个操作都返回平台标准的 `404`，与访问未知路由时完全相同。
paths:
  /v3/bank/institutions/:
    get:
      tags:
        - Bank Data
      summary: 列出机构
      description: >-
        按国家列出银行及其能力：客户细分、访问模式、银行提供的最长同意期限和最长历史数据期限、是否返回待处理交易、已知会发送哪些交易字段，以及用户的登录方式。数值来自观测数据，每日更新；从未观测到的值为
        `null`。同一数据也用于银行选择器，因此在创建链接前可用它了解预期情况。仅当提供持续访问时，`access` 才会列出 `ongoing`。


        需要具备银行数据权限（`bank-data`）的 API
        密钥：此操作为读取权限。拥有完全访问权限的密钥不包含该权限：创建密钥时须单独授予，否则调用返回 `403
        bank_data_access_denied`。


        列表按名称排序，名称相同则按 ID 排序。


        在沙盒应用中，列表包含 Didit 测试银行，每个 Bank Link 服务的国家各一家，不包含任何真实银行。
      operationId: listBankInstitutions
      parameters:
        - name: country
          in: query
          required: false
          schema:
            type: string
            pattern: ^[A-Z]{3}$
          description: >-
            仅限该国家/地区的银行，使用 ISO 3166-1 alpha-3 代码。Bank Link 不支持的国家/地区会返回 `400
            invalid_request`，并附带 `field: country`。
        - name: segment
          in: query
          required: false
          schema:
            type: string
            enum:
              - personal
              - business
          description: 仅限服务此细分客群的银行。
        - name: access
          in: query
          required: false
          schema:
            type: string
            enum:
              - one_time
              - ongoing
          description: 仅限支持此访问模式的银行。
        - name: q
          in: query
          required: false
          schema:
            type: string
            maxLength: 100
          description: 按名称或 id 搜索，不区分大小写。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 500
          description: 每页条数，1 至 500。默认 100。
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: 不透明游标，取自上一页的 `next_cursor`。
      responses:
        '200':
          description: 银行列表的一页。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankInstitutionList'
              examples:
                Spain, ongoing access:
                  summary: 提供持续访问的西班牙银行
                  value:
                    items:
                      - id: es-banco-norte
                        name: Banco Norte
                        country: ESP
                        logo_url: https://static.example.com/banks/es-banco-norte.png
                        timezone: Europe/Madrid
                        segments:
                          - personal
                          - business
                        access:
                          - one_time
                          - ongoing
                        ongoing_access: true
                        consent_days_max: 180
                        history_days_max: 365
                        pending_transactions: true
                        pending_linkage: false
                        balance_types:
                          - booked
                          - available
                        transaction_fields:
                          - value_date
                          - counterparty_name
                          - counterparty_iban
                          - remittance
                          - bank_transaction_code
                          - bank_reference
                          - balance_after
                        sign_in: redirect
                        requires_end_user_email: true
                        corporate_accounts: true
                        bank_account_selection: false
                        separate_history_consent: false
                        reconfirmation: false
                        sync_frequency_hours: null
                        health: operational
                    next_cursor: null
        '400':
          description: 参数无效，或 `country` 不是 Bank Link 支持的国家/地区。`field` 指明具体字段。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Invalid cursor:
                  summary: 游标无效
                  value:
                    code: invalid_cursor
                    message: The cursor or page token is not valid.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: cursor
                    next_action: null
                    retry_after: null
                Invalid request:
                  summary: 请求无效
                  value:
                    code: invalid_request
                    message: The request is not valid.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: limit
                    next_action: null
                    retry_after: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/BankDataAccessDenied'
        '429':
          $ref: '#/components/responses/RateLimitedRead'
        '500':
          $ref: '#/components/responses/BankDataInternalError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl
            'https://verification.didit.me/v3/bank/institutions/?country=ESP&segment=business&access=ongoing'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.bank.list_institutions()
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.bank.listInstitutions();
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Bank.ListInstitutions(ctx, didit.BankListInstitutionsParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: |-
            import me.didit.Didit;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            var result = client.bank().listInstitutions();
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->bank->listInstitutions();
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.bank.list_institutions
            puts result.to_h
        - lang: csharp
          label: .NET
          source: |-
            using System;
            using System.Text.Json;
            using Didit;

            // Reads DIDIT_API_KEY.
            using var client = new DiditClient();

            var result = await client.Bank.ListInstitutionsAsync();
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    BankInstitutionList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BankInstitution'
        next_cursor:
          type: string
          nullable: true
      required:
        - items
        - next_cursor
    BankDataError:
      type: object
      description: 所有银行数据操作的错误响应体。每个字段始终存在。
      properties:
        code:
          type: string
          enum:
            - ongoing_access_not_available
            - segment_not_available
            - window_not_available
            - history_window_ambiguous
            - redirect_url_not_registered
            - link_origin_not_allowed
            - bank_data_access_denied
            - connection_not_active
            - consent_expired
            - renewal_not_needed
            - renewal_window_expired
            - access_removed
            - refresh_limit_reached
            - cursor_expired
            - page_expired
            - invalid_cursor
            - page_token_mismatch
            - contract_rate_missing
            - insufficient_credits
            - invalid_request
            - not_found
            - internal_error
          description: 机器可读的错误代码。请据此分支处理，切勿依据 `message`。
        message:
          type: string
          description: 面向开发者的通俗说明。措辞可能变化，请勿解析。
        request_id:
          type: string
          description: 本次请求的标识符。联系支持团队时请提供此标识符。
        field:
          type: string
          description: 需要更正的请求字段（如果错误与某个字段有关）。否则为 `null`。
          nullable: true
        next_action:
          type: string
          enum:
            - retry_later
            - renew_connection
            - create_link
            - restart_from_cursor
            - restart_read
            - top_up_balance
            - enable_bank_data_access
            - contact_support
            - null
          description: 下一步应执行的操作，便于客户端无需猜测即可执行。没有标准的下一步时为 `null`。
          nullable: true
        retry_after:
          type: integer
          description: 重试前需等待的秒数。仅在触发速率限制和出现临时错误时设置，否则为 `null`。
          nullable: true
      required:
        - code
        - message
        - request_id
        - field
        - next_action
        - retry_after
      example:
        code: ongoing_access_not_available
        message: >-
          This bank cannot keep access open. Use access one_time or choose
          another bank.
        request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
        field: institution_id
        next_action: create_link
        retry_after: null
    BankInstitution:
      type: object
      description: 银行及其支持的功能。取值来自已观察到的能力数据，每日刷新；从未观察到的值为 `null`，而不是猜测值。
      properties:
        id:
          type: string
          description: Didit 的银行标识符，为稳定的 slug。
          example: es-banco-norte
        name:
          type: string
        country:
          type: string
          pattern: ^[A-Z]{3}$
        logo_url:
          type: string
          format: uri
          nullable: true
        timezone:
          type: string
          description: 银行日期所使用的 IANA 时区。
          nullable: true
        segments:
          type: array
          items:
            type: string
            enum:
              - personal
              - business
        access:
          type: array
          items:
            type: string
            enum:
              - one_time
              - ongoing
          description: 只有对该银行开启了持续访问时，才会列出 `ongoing`。
        ongoing_access:
          type: boolean
          description: 该银行是否支持持续访问。
        consent_days_max:
          type: integer
          description: 该银行允许的最长同意期限，以天为单位。未观测到时为 `null`。
          nullable: true
        history_days_max:
          type: integer
          description: 该银行所提供的最长历史数据范围，以天为单位。未观测到时为 `null`。
          nullable: true
        pending_transactions:
          type: boolean
          nullable: true
          description: 银行是否返回待处理交易。
        pending_linkage:
          type: boolean
          nullable: true
          description: 银行是否将待处理交易与其已入账交易关联，这会设置 `pending_id`。
        balance_types:
          type: array
          items:
            type: string
            enum:
              - booked
              - available
              - expected
        transaction_fields:
          type: array
          items:
            type: string
          description: 已知银行会发送的交易字段。其他所有字段均为 `null`。
        sign_in:
          type: string
          enum:
            - redirect
            - app_approval
            - credentials
            - null
          description: 用户在银行的登录方式。
          nullable: true
        requires_end_user_email:
          type: boolean
          nullable: true
          description: Bank Link 是否需要该用户已验证的邮箱地址。
        corporate_accounts:
          type: boolean
          nullable: true
          description: 是否支持企业账户。
        bank_account_selection:
          type: boolean
          nullable: true
          description: 用户是在银行端而非 Bank Link 中选择账户。
        separate_history_consent:
          type: boolean
          nullable: true
          description: 银行是否要求再次确认才能释放更早的历史数据。
        reconfirmation:
          type: boolean
          nullable: true
          description: 续期能否在 Didit 的页面上重新确认，而无需再次登录银行。
        sync_frequency_hours:
          type: integer
          description: 在银行允许更高频率时，两次自动同步之间的小时数。`null` 表示每日默认频率。
          nullable: true
        health:
          type: string
          enum:
            - operational
            - degraded
            - down
      required:
        - id
        - name
        - country
        - logo_url
        - timezone
        - segments
        - access
        - ongoing_access
        - consent_days_max
        - history_days_max
        - pending_transactions
        - pending_linkage
        - balance_types
        - transaction_fields
        - sign_in
        - requires_end_user_email
        - corporate_accounts
        - bank_account_selection
        - separate_history_consent
        - reconfirmation
        - sync_frequency_hours
        - health
    RateLimitBudgetError:
      type: object
      description: 仅在速率限制中间件预算拒绝时返回。其他 429 错误（包括幂等性冲突和端点特定上限）不保证返回这些元数据字段。
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: 已有的可读预算拒绝信息。
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: 不透明的支持参考编号：RL- 后跟 32 个小写 UUID 十六进制字符。
        limit:
          type: integer
          description: 超出限额的作用域对应的预算；与 X-RateLimit-Limit 相同。
        remaining:
          type: integer
          minimum: 0
          description: 剩余额度，下限为零；与 X-RateLimit-Remaining 相同。
        reset:
          type: integer
          format: int64
          description: 窗口重置时间，以 Unix 秒表示；与 X-RateLimit-Reset 相同。
        window_seconds:
          type: integer
          description: 固定窗口时长（秒），不是剩余等待时间。重试前请遵循 Retry-After。
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
  responses:
    Unauthorized:
      description: 未授权
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: API 密钥无效
              value:
                detail: Invalid API Key.
    BankDataAccessDenied:
      description: >-
        API 密钥不具有银行数据权限（`bank-data`），或者，对于生产环境应用中的原始银行数据，应用设置“Bank data in the
        API”已关闭。银行数据不属于完全访问权限：完全访问权限的密钥、仅限其他资源的密钥，以及未使用 API
        密钥认证的请求（客户端凭证，访问原始数据时）均会被以此响应体拒绝，因此请创建密钥并显式授予该权限。此拒绝发生在任何查询之前，因此不能说明对象是否存在。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BankDataError'
          examples:
            Bank data not allowed:
              summary: 不允许访问银行数据
              value:
                code: bank_data_access_denied
                message: >-
                  Bank data calls need an API key that carries the Bank data
                  permission.
                request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                field: null
                next_action: enable_bank_data_access
                retry_after: null
    RateLimitedRead:
      description: 中间件读取额度已超出。重试前请先遵守 Retry-After。
      headers:
        Retry-After:
          $ref: '#/components/headers/BudgetRetryAfter'
        X-RateLimit-Scope:
          $ref: '#/components/headers/BudgetXRateLimitScope'
        X-RateLimit-Limit:
          $ref: '#/components/headers/BudgetXRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/BudgetXRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/BudgetXRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              GET request rate limit exceeded. You can make up to 600 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 600
            remaining: 0
            reset: 1794358860
            window_seconds: 60
    BankDataInternalError:
      description: >-
        Didit 端出现了问题。`/v3/bank/` 下的任何意外错误都以银行错误格式返回，绝不返回 HTML 页面：请将 `request_id`
        提供给支持团队。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BankDataError'
          examples:
            Internal error:
              summary: 意外错误
              value:
                code: internal_error
                message: >-
                  Something went wrong on our side. Quote the request_id to
                  support.
                request_id: 3f6a1c8e92b54d07a1e38c4b7f0d2e59
                field: null
                next_action: contact_support
                retry_after: null
  headers:
    BudgetRetryAfter:
      description: 需等待的秒数，向上取整到下一个时间窗口。出现在中间件预算拒绝响应中。
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: 已超出预算的范围。出现在中间件预算拒绝响应中。
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: 超出限额的作用域的预算；与请求体限制相同。出现在中间件预算拒绝响应中。
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: 剩余额度，下限为零；与响应体中的 remaining 相同。仅出现在中间件额度拒绝的响应中。
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: 以 Unix 秒表示的重置时间；与正文中的 reset 相同。出现在中间件预算拒绝响应中。
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的开发者 -> API
        密钥中获取。主密钥拥有完全访问权限。命名密钥可以设置范围：可按资源设置无权限、只读或读写，可限定为部分工作流或已批准的会话，可限定为一组 IP
        地址，并可设置过期日期。401 表示密钥错误、已被撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或执行该操作，或请求来自其 IP
        列表之外的地址；会话相关路由返回 404，表示该会话不在密钥的工作流或状态范围内。没有媒体访问权限的密钥会将图片、视频和 PDF 的 URL
        返回为 null；没有会话写入权限的密钥会将会话链接和令牌返回为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.