> ## 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.

# Bank Link作成API：銀行の接続・再接続

> Didit の Create a Bank Link エンドポイントは、サーバー側で Bank Link の1回の実行を開始し、ユーザーが銀行を接続するホスト型の url を返します。

Didit の Create a Bank Link エンドポイントは、サーバー側で Bank Link の 1 回分の処理を開始し、銀行への接続または接続の更新を行うためのホスト型の `url` を返します。
すべてのフィールドにはデフォルト値があるため、最小のリクエストは `{}` に必要な項目を加えたものになります。
返された `id` はユーザーと紐付けて保存し、結果は [Get a bank link](https://docs.didit.me/ja/standalone-apis/bank-link-get.md) または `bank.link.completed` Webhook で自分で確認してください。
詳細は [クイックスタート](https://docs.didit.me/ja/core-technology/bank-verification/quickstart.md) と [Bank Link](https://docs.didit.me/ja/core-technology/bank-verification/bank-link.md) を参照してください。


## OpenAPI

````yaml ja/openapi-25.json POST /v3/bank/links/
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: >-
      Bank
      Link、接続、アカウント、残高、取引、金融機関、カバレッジ。銀行データはサンドボックスアプリケーションで利用できます。本番アプリケーションの呼び出しは、本番アクセスが発表されるまで
      `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` を返し、予期しないエラーは `request_id` を伴う `500 internal_error`
      を返します。銀行データが利用できない場合、すべての操作はプラットフォームの標準 `404` を返します。これは未知のルートの場合とまったく同じです。
paths:
  /v3/bank/links/:
    post:
      tags:
        - Bank Data
      summary: 銀行リンクを作成する
      description: >-
        Bank Linkを作成します。本人が銀行を接続する、または接続を更新するための一連の流れを1回実行します。本人を `url`
        に案内してください。`client_token` は、まだ提供されていないDiditの埋め込み型Bank Link向けです。現時点では
        `url` を開いてください。リンクが完了すると接続が作成されます。


        最小のリクエストは `{}` に必要な項目を加えたものです。デフォルト値は次のとおりです。`mode` はconnect、`access`
        はone_time、`data` は口座のみ、`history_days` は90、`ownership.compare`
        はnone、`segment` はany、`duplicates` はreuse、`allow_one_time_fallback`
        はfalseです。継続的なアクセスの場合は、銀行が許可する期間の同意が設定されます。


        レスポンスには見積もりが含まれます。価格はリンクに固定され、見積もりどおりに請求されます。APIキーがブラウザやアプリに渡されることはありません。渡されるのは
        `url` だけです。


        結果は `get_link` または `bank.link.completed`
        のWebhookで自分で確認してください。ブラウザから送られたリンクIDを信頼してはいけません。履歴は `history_from` か
        `history_days`
        のいずれかを送信してください。両方は送らないでください。銀行が許可している場合、継続的なアクセスは同意が終わるまで有効です。正確な日付は各接続に記載されています。


        銀行データ権限（`bank-data`）を持つAPIキーが必要です。この操作はデータを変更するため、書き込み権限として扱われます。フルアクセスのキーにはこの権限は含まれません。キーを作成する際に明示的に付与してください。付与しない場合、呼び出しは
        `403 bank_data_access_denied` を返します。
      operationId: createBankLink
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankLinkCreateRequest'
            example:
              mode: connect
              access: ongoing
              country: ESP
              segment: business
              data:
                - accounts
                - balances
                - transactions
              history_from: '2026-01-01'
              consent_days: 180
              ownership:
                compare: none
              end_user:
                reference: client-7731
                email: ana@example.com
              redirect_url: https://app.example.com/bank/return
              allowed_origins:
                - https://app.example.com
              language: es
              vendor_data: client-7731
      responses:
        '201':
          description: リンクが作成されました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankLink'
              examples:
                Ongoing business connection:
                  summary: スペインの法人口座の継続的アクセス
                  value:
                    id: 0b9c4f1e-6a2d-4e8b-9f31-7c5d2e1a8b40
                    mode: connect
                    access: ongoing
                    status: created
                    url: https://verify.didit.me/bank/link/example-link-token
                    client_token: example-client-token
                    expires_at: '2026-11-21T13:00:00Z'
                    connection_id: null
                    check_id: null
                    reused: false
                    error: null
                    quote:
                      id: 7a3e9c52-1d84-4b06-8f2a-c5e0b9d17a43
                      lines:
                        - meter: bank_data_connection_month
                          unit: connection_month
                          price_usd: '0.9000'
                      fallback_lines: null
                      total_usd: '0.9000'
                      valid_until: '2026-11-21T13:00:00Z'
                      scopes:
                        - accounts
                        - balances
                        - transactions
                    vendor_data: client-7731
        '400':
          description: >-
            画面が表示される前にリクエストが拒否されました。`field`には修正すべき箇所が入ります。範囲外の値や許可されていない組み合わせには`invalid_request`が入り、それ以外の場合は以下に示す、より具体的なコードが入ります。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Bank cannot keep access open:
                  summary: 銀行がアクセスを維持できません
                  value:
                    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
                History window ambiguous:
                  summary: 履歴期間があいまい
                  value:
                    code: history_window_ambiguous
                    message: Send history_from or history_days, not both.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: history_from
                    next_action: null
                    retry_after: null
                Redirect URL not registered:
                  summary: リダイレクトURLが登録されていません
                  value:
                    code: redirect_url_not_registered
                    message: >-
                      This redirect_url is not one of the return addresses
                      registered for your application. Addresses are matched
                      exactly (scheme, host, port, path and query); in sandbox a
                      plain http localhost address needs no registration. Send a
                      registered address, or leave redirect_url out (automatic
                      return to your page is then not promised).
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: redirect_url
                    next_action: null
                    retry_after: null
                Segment not available:
                  summary: セグメントは利用できません
                  value:
                    code: segment_not_available
                    message: >-
                      This bank does not offer this kind of account through Bank
                      Link.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: segment
                    next_action: null
                    retry_after: null
                Window not available:
                  summary: 利用可能な期間がありません
                  value:
                    code: window_not_available
                    message: This bank cannot deliver the requested history window.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: history_from
                    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: expires_in
                    next_action: null
                    retry_after: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: 残高では見積価格を賄えません。チャージしてから、もう一度お試しください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Insufficient credits:
                  summary: クレジットが不足しています
                  value:
                    code: insufficient_credits
                    message: The balance cannot cover the quoted price.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: top_up_balance
                    retry_after: null
        '403':
          description: 拒否されました。契約にこの国の料金が設定されていないか、キーに銀行データの権限がありません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                No contract rate:
                  summary: 契約料金がありません
                  value:
                    code: contract_rate_missing
                    message: Your contract has no rate for bank data in this country.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: null
                    retry_after: null
                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
        '404':
          description: このアプリケーションおよび環境には、このリソースが存在しません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Not found:
                  summary: 見つかりません
                  value:
                    code: not_found
                    message: The resource does not exist.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: null
                    retry_after: null
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
        '500':
          $ref: '#/components/responses/BankDataInternalError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/bank/links/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "mode": "connect",
                "access": "ongoing",
                "country": "ESP",
                "segment": "business",
                "data": [
                  "accounts",
                  "balances",
                  "transactions"
                ],
                "history_from": "2026-01-01",
                "consent_days": 180,
                "ownership": {
                  "compare": "none"
                },
                "end_user": {
                  "reference": "client-7731",
                  "email": "ana@example.com"
                },
                "redirect_url": "https://app.example.com/bank/return",
                "allowed_origins": [
                  "https://app.example.com"
                ],
                "language": "es",
                "vendor_data": "client-7731"
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.bank.create_link(
                mode="connect",
                access="ongoing",
                country="ESP",
                segment="business",
                data=["accounts", "balances", "transactions"],
                history_from="2026-01-01",
                consent_days=180,
                ownership={
                    "compare": "none",
                },
                end_user={
                    "reference": "client-7731",
                    "email": "ana@example.com",
                },
                redirect_url="https://app.example.com/bank/return",
                allowed_origins=["https://app.example.com"],
                language="es",
                vendor_data="client-7731",
            )
            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.createLink({
              mode: "connect",
              access: "ongoing",
              country: "ESP",
              segment: "business",
              data: ["accounts", "balances", "transactions"],
              history_from: "2026-01-01",
              consent_days: 180,
              ownership: {
                compare: "none",
              },
              end_user: {
                reference: "client-7731",
                email: "ana@example.com",
              },
              redirect_url: "https://app.example.com/bank/return",
              allowed_origins: ["https://app.example.com"],
              language: "es",
              vendor_data: "client-7731",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Bank.CreateLink(ctx, didit.BankCreateLinkParams{\n\tBody: didit.BankLinkCreateRequest{\n\t\tMode:        didit.Some(didit.BankLinkCreateRequestMode(\"connect\")),\n\t\tAccess:      didit.Some(didit.BankLinkCreateRequestAccess(\"ongoing\")),\n\t\tCountry:     didit.String(\"ESP\"),\n\t\tSegment:     didit.Some(didit.BankLinkCreateRequestSegment(\"business\")),\n\t\tData:        didit.Some([]didit.BankLinkCreateRequestData{\"accounts\", \"balances\", \"transactions\"}),\n\t\tHistoryFrom: didit.String(\"2026-01-01\"),\n\t\tConsentDays: didit.Int(180),\n\t\tOwnership: didit.Some(didit.BankLinkOwnershipRequest{\n\t\t\tCompare: didit.Some(didit.BankLinkOwnershipRequestCompare(\"none\")),\n\t\t}),\n\t\tEndUser: didit.Some(didit.BankLinkEndUser{\n\t\t\tReference: didit.String(\"client-7731\"),\n\t\t\tEmail:     didit.String(\"ana@example.com\"),\n\t\t}),\n\t\tRedirectURL:    didit.String(\"https://app.example.com/bank/return\"),\n\t\tAllowedOrigins: didit.Some([]string{\"https://app.example.com\"}),\n\t\tLanguage:       didit.String(\"es\"),\n\t\tVendorData:     didit.String(\"client-7731\"),\n\t},\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.time.LocalDate;

            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.BankLinkCreateRequest;

            import me.didit.types.BankLinkEndUser;

            import me.didit.types.BankLinkOwnershipRequest;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.bank().createLink(BankLinkCreateRequest.builder()
                    .mode(BankLinkCreateRequest.Mode.of("connect"))
                    .access(BankLinkCreateRequest.Access.of("ongoing"))
                    .country("ESP")
                    .segment(BankLinkCreateRequest.Segment.of("business"))
                    .data(List.of(BankLinkCreateRequest.Data.of("accounts"), BankLinkCreateRequest.Data.of("balances"), BankLinkCreateRequest.Data.of("transactions")))
                    .historyFrom(LocalDate.parse("2026-01-01"))
                    .consentDays(180L)
                    .ownership(BankLinkOwnershipRequest.builder()
                            .compare(BankLinkOwnershipRequest.Compare.of("none"))
                            .build())
                    .endUser(BankLinkEndUser.builder()
                            .reference("client-7731")
                            .email("ana@example.com")
                            .build())
                    .redirectUrl("https://app.example.com/bank/return")
                    .allowedOrigins(List.of("https://app.example.com"))
                    .language("es")
                    .vendorData("client-7731")
                    .build());
            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->createLink([
                'mode' => 'connect',
                'access' => 'ongoing',
                'country' => 'ESP',
                'segment' => 'business',
                'data' => ['accounts', 'balances', 'transactions'],
                'history_from' => '2026-01-01',
                'consent_days' => 180,
                'ownership' => [
                    'compare' => 'none',
                ],
                'end_user' => [
                    'reference' => 'client-7731',
                    'email' => 'ana@example.com',
                ],
                'redirect_url' => 'https://app.example.com/bank/return',
                'allowed_origins' => ['https://app.example.com'],
                'language' => 'es',
                'vendor_data' => 'client-7731',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.bank.create_link(
              mode: "connect",
              access: "ongoing",
              country: "ESP",
              segment: "business",
              data: ["accounts", "balances", "transactions"],
              history_from: "2026-01-01",
              consent_days: 180,
              ownership: {
                compare: "none",
              },
              end_user: {
                reference: "client-7731",
                email: "ana@example.com",
              },
              redirect_url: "https://app.example.com/bank/return",
              allowed_origins: ["https://app.example.com"],
              language: "es",
              vendor_data: "client-7731"
            )
            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.CreateLinkAsync(new
            BankLinkCreateRequest

            {
                Mode = new BankLinkCreateRequestMode("connect"),
                Access = new BankLinkCreateRequestAccess("ongoing"),
                Country = "ESP",
                Segment = new BankLinkCreateRequestSegment("business"),
                Data = new BankLinkCreateRequestData[] { "accounts", "balances", "transactions" },
                HistoryFrom = "2026-01-01",
                ConsentDays = 180,
                Ownership = new BankLinkOwnershipRequest
                {
                    Compare = new BankLinkOwnershipRequestCompare("none"),
                },
                EndUser = new BankLinkEndUser
                {
                    Reference = "client-7731",
                    Email = "ana@example.com",
                },
                RedirectUrl = "https://app.example.com/bank/return",
                AllowedOrigins = new string[] { "https://app.example.com" },
                Language = "es",
                VendorData = "client-7731",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        1回の操作に対して任意で指定する、再試行の安全性を確保するためのキーです。255文字まで指定でき、UUIDも使用できます。同じキー、エンドポイント、クエリ、ボディで繰り返されたリクエストには、最初のレスポンスが同じステータスと同じボディで返され、2回目は実行も課金も行われません。同じキーを別のエンドポイント、クエリ、ボディで使うと
        `409` `idempotency_key_reused` が返されます。最初のリクエストがまだ処理中の場合は、`Retry-After`
        付きの `409` `idempotency_key_in_progress` が返されます。失敗したリクエスト（`4xx` または
        `5xx`）は保存されないため、同じキーで再送できます。キーは、APIキーとアクセストークンのどちらで呼び出す場合でも、お使いのアプリケーションに属します。詳しくは
        [再試行と冪等性](/ja/integration/api-errors#再試行と冪等性) を参照してください。
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    BankLinkCreateRequest:
      type: object
      description: Bank Linkを作成します。最小のリクエストは `{}` に必要な項目を加えたものです。すべてのフィールドにデフォルト値があります。
      properties:
        mode:
          type: string
          enum:
            - connect
            - renew
          description: >-
            `connect`（デフォルト）は新しい接続を作成します。`renew` には `connection_id`
            が必要で、その接続の設定を再利用します。
          default: connect
        connection_id:
          type: string
          description: '更新する接続。`mode: renew` の場合のみ。'
          format: uuid
        access:
          type: string
          enum:
            - one_time
            - ongoing
          description: >-
            `one_time`（デフォルト）はデータを一度だけ読み取ります。`ongoing`
            は、同意が終了するか誰かが停止するまでアクセスを維持します。`institution_id`
            を設定した場合、アクセスを維持できない銀行には、画面を表示する前に `400 ongoing_access_not_available`
            を返します。設定しない場合、銀行選択画面には対応している銀行のみが表示されます。
          default: one_time
        country:
          type: string
          description: >-
            任意。省略すると、本人は申請で有効になっている国から選択します。Bank Link が対応している国である必要があります。`ZZZ`
            を含め、それ以外の値は `field: country` を指定した `400 invalid_request`
            を返します。空のリクエストボディも有効です。
          pattern: ^[A-Z]{3}$
        institution_id:
          type: string
          description: 任意。`list_institutions` から取得した、事前に選択する銀行。銀行の選択画面はスキップされます。
          maxLength: 64
        segment:
          type: string
          enum:
            - personal
            - business
            - any
          description: ピッカーを絞り込み、銀行がログインを分けている場合にどのログインを開くかを銀行に伝えます。デフォルトは `any`。
          default: any
        data:
          type: array
          items:
            type: string
            enum:
              - accounts
              - balances
              - transactions
          description: >-
            読み取る対象。`accounts` は常に含まれます：名称、種類、通貨、識別子、および銀行が共有する場合は口座名義人名。デフォルトは
            `["accounts"]`。
          default:
            - accounts
          maxItems: 3
        history_days:
          type: integer
          description: >-
            取得する取引履歴の日数（1〜365、既定値は90）。銀行はこれより少ない期間しか提供しない場合があります。各口座は提供した期間を`history_coverage`で報告します。`history_from`と同時に送信することはできません。
          minimum: 1
          maximum: 365
          default: 90
        history_from:
          type: string
          description: >-
            `history_days` の代わりに取得する履歴の開始日です。`history_days`
            と同時に指定することはできません。両方を指定すると `400 history_window_ambiguous`
            が返されます。365日より前の日付、または未来の日付の場合は `400 window_not_available` が返されます。
          format: date
        extended_history:
          type: string
          enum:
            - standard
            - allow_extra_auth
          description: '`allow_extra_auth` を指定すると、追加の確認を一度求める銀行でも、過去の履歴を提供できます。'
          default: standard
        consent_days:
          type: integer
          description: >-
            継続的なアクセスのみ。銀行にアクセスを開いたままにするよう依頼する日数（1日以上）。デフォルトは銀行が許可する最長期間です。接続は、銀行が実際に付与した日付を
            `consent.expires_at` で返します。`access: one_time` の場合は、`field:
            consent_days` を指定した `400 invalid_request` を返します。
          minimum: 1
          maximum: 32767
        ownership:
          $ref: '#/components/schemas/BankLinkOwnershipRequest'
        end_user:
          $ref: '#/components/schemas/BankLinkEndUser'
        redirect_url:
          type: string
          description: >-
            処理の最後にブラウザを遷移させる先。`link_id`、`status`、署名付きの `state`
            を含みます（表示専用です。Webhookと `get_link`
            が正式な結果となります）。サンドボックスアプリケーションでは、`localhost`、`127.0.0.1`、`[::1]` の平文
            `http` アドレス（任意のポートとパス可、認証情報とフラグメントなし）は登録不要です。それ以外のアドレスは `400
            redirect_url_not_registered`
            を返します。その他のアドレスの登録はまだ利用できません。`redirect_url`
            を指定しない場合、本人はDidit独自の結果ページで処理を完了します。
          format: uri
          maxLength: 2048
        allowed_origins:
          type: array
          items:
            type: string
            format: uri
          description: >-
            受け付けますが、現在は使用されません。Didit の埋め込み型Bank
            Linkのために予約されており、まだ提供されていません。HTTPSオリジン、最大50件。
          maxItems: 50
        language:
          type: string
          description: 任意。`es` や `pt-BR` などの言語コード。省略した場合はブラウザの言語が使われます。
          pattern: ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})?$
          maxLength: 16
        vendor_data:
          type: string
          description: あなた独自の参照情報。リンクと接続に返されます。
          maxLength: 255
        expires_in:
          type: integer
          description: リンクの有効期間（秒）。300～86400。既定値は3600。
          minimum: 300
          maximum: 86400
          default: 3600
        duplicates:
          type: string
          enum:
            - reuse
            - allow
          description: >-
            `reuse`（デフォルト）は、すでに共有しているアカウントに解決されるリンクを、その接続の更新として完了させます。`allow`
            は、独立した2つ目の接続を作成します。
          default: reuse
        allow_one_time_fallback:
          type: boolean
          description: >-
            `ongoing`
            の場合に、銀行がアクセスを維持できないときでも、本人が自分の画面で縮小されたアクセスを確認したうえで、一回限りの読み取りで続行できるようにします。見積もりにはその費用が表示されます。`access:
            ongoing` の場合のみ有効です。一回限りのアクセスの場合は、`field: allow_one_time_fallback`
            を伴う `400 invalid_request` を返します。
          default: false
        accept_reduced_grant:
          type: boolean
          description: >-
            銀行または本人が依頼より少ない範囲しか許可しない場合は、リンクを完了させ、許可されたスコープ分のみ課金します。それ以外の場合、リンクは
            `reduced_grant` を伴って `failed` で終了し、課金は発生しません。
          default: false
        sandbox:
          type: object
          description: >-
            サンドボックスアプリケーションのみが対象です。Didit Test Bank
            の顧客を選択します。本番環境のアプリケーションでは無視されます。
          properties:
            persona:
              type: string
              enum:
                - personal_basic
                - business_multi
                - long_history
                - pending
                - sparse_fields
                - no_ongoing
              description: >-
                テストバンクの顧客:
                `personal_basic`（当座預金口座1件、取引60件）、`business_multi`（企業が保有する口座3件）、`long_history`（口座1件、400日分、取引1,400件。読み取りでは直近365日分が返されるため、`history_days`
                は365に設定してください）、`pending`（保留中の取引を含む）、`sparse_fields`（価値日、相手先IBAN、銀行参照番号を含まない）、または
                `no_ongoing`（一度限りのアクセスのみを許可する銀行。`allow_one_time_fallback`
                を使用してください）。
            switches:
              type: array
              items:
                type: string
                enum:
                  - partial_grant
                  - renewal_other_login
                  - expired_cursor
                  - webhook_twice
                  - midnight_booking
                  - blocked_popup
                  - bank_app_return
              description: 受け付けますが、サンドボックスシミュレーター用に予約されています。現在は値を変更しても何も変わりません。
    BankLink:
      type: object
      description: >-
        1人の利用者に対するBank
        Linkの1回の実行です。銀行に接続する場合、または接続を更新する場合に使用します。リンクは`get_link`で自分で確認してください。ブラウザから送られたIDは決して信頼しないでください。
      properties:
        id:
          type: string
          description: リンクの識別子。
          format: uuid
        mode:
          type: string
          enum:
            - connect
            - renew
        access:
          type: string
          enum:
            - one_time
            - ongoing
        status:
          type: string
          enum:
            - created
            - opened
            - connecting
            - completed
            - cancelled
            - expired
            - failed
          description: リンクの状態です。`completed`、`cancelled`、`expired`、`failed` は最終状態です。
        url:
          type: string
          description: >-
            利用者を誘導するホスト型ページです。リンクの作成時にのみ返されます。トークンは保存されないため、後続の読み取りでは `null`
            になります。
          nullable: true
          format: uri
        client_token:
          type: string
          description: >-
            Diditの埋め込み型Bank
            Link用のトークンです。まだリリースされていないため、現時点では`url`を開いてください。リンク作成時にのみ返され、以降の読み取りでは`null`になります。用途は1つだけで有効期間は短く、個人データは含まれません。絶対にログに記録しないでください。
          nullable: true
        expires_at:
          type: string
          description: 未使用のリンクが無効になる日時。
          format: date-time
        connection_id:
          type: string
          description: '`status` が `completed` になると、このリンクによって作成または更新された接続。'
          format: uuid
          nullable: true
        check_id:
          type: string
          description: '`ownership.compare` に `none` 以外を指定した場合の、このリンクの所有構造の判定結果です。'
          format: uuid
          nullable: true
        reused:
          type: boolean
          description: >-
            本人がこれらの口座をすでに正確に共有している場合（`duplicates: reuse`）、リンクは既存の接続の更新として完了し、その際
            `true` になります。二重に課金されることはありません。
        error:
          allOf:
            - $ref: '#/components/schemas/BankLinkError'
          nullable: true
          description: '`status` が `failed` の場合に、リンクが失敗した理由。それ以外は `null`。'
        quote:
          $ref: '#/components/schemas/BankLinkQuote'
        vendor_data:
          type: string
          description: リクエストで指定したあなたの参照情報。
          nullable: true
      required:
        - id
        - mode
        - access
        - status
        - url
        - client_token
        - expires_at
        - connection_id
        - check_id
        - reused
        - error
        - quote
        - vendor_data
    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: エラーが1つのフィールドに関するものである場合に修正すべきリクエストフィールド。それ以外の場合は`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
    BankLinkOwnershipRequest:
      type: object
      description: 任意。口座名義人を個人または法人と照合する設定。
      properties:
        compare:
          type: string
          enum:
            - none
            - person
            - business
          description: >-
            口座名義人と比較する対象。`none`（デフォルト）は判定を返さず、参照情報も不要です。`person` には
            `reference_identity` または `session_id` が必要です。`business` には `business`
            または `business_session_id` が必要です。比較する種類の参照を1つだけ送信してください。`none`
            の場合は参照を送信しないでください。
          default: none
        match:
          type: string
          enum:
            - any_holder
            - all_holders
          description: 法的な名義人のうち1名が一致すればよいか、全員が一致する必要があるか。代理人は一致の判定に含まれません。
          default: any_holder
        reference_identity:
          type: object
          description: 口座名義人と照合するために呼び出し元が指定する値です。`session_id` と一緒に送信することはできません。
          properties:
            full_name:
              type: string
              maxLength: 255
            date_of_birth:
              type: string
              format: date
            address:
              type: string
              maxLength: 500
            phone:
              type: string
              maxLength: 64
            email:
              type: string
              maxLength: 255
        session_id:
          type: string
          description: 照合対象となる、本人の完了済みDidit本人確認セッション。`reference_identity`と同時に送信することはできません。
          format: uuid
        business:
          type: object
          description: 口座名義人と照合する法人。
          properties:
            legal_name:
              type: string
              maxLength: 255
            registration_id:
              type: string
              maxLength: 128
          required:
            - legal_name
        business_session_id:
          type: string
          description: 照合対象となるDiditの法人確認。`business`と同時に送信することはできません。
          format: uuid
    BankLinkEndUser:
      type: object
      description: 口座を接続する個人または法人です。
      properties:
        reference:
          type: string
          description: 本人または企業に対する独自のID。`end_user_reference` で検索でき、同じ人の再接続を識別するために使われます。
          maxLength: 255
        email:
          type: string
          description: >-
            任意。銀行ルートで本人の確認済み住所が必要であり、送信しなかった場合、Bank Link
            は本人にその住所を尋ねます。マーケティングには使用されません。
          format: email
          maxLength: 254
    BankLinkError:
      type: object
      description: リンクが`failed`で終了した理由。何も公開されず、課金もされません。
      properties:
        code:
          type: string
          enum:
            - duplicate_conflict
            - renewal_login_mismatch
            - reduced_grant
            - corporate_approval_not_supported
            - ongoing_access_not_available
            - bank_unavailable
            - bank_cancelled
            - consent_declined
            - read_limit
            - renewal_not_needed
            - renewal_window_expired
            - first_sync_failed
          description: >-
            リンクが失敗した理由。失敗したリンクはHTTPエラーではありません。リンクは `status: failed`
            とこのオブジェクトで返されます。その間に接続が変わった更新リンクは `renewal_not_needed` または
            `renewal_window_expired` で返されます。
        message:
          type: string
          description: 開発者向けの平易な説明。
        conflicts_with:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: >-
            `duplicate_conflict` の場合: 重複する有効な接続のID。いずれかを更新するか、`duplicates:
            allow` を指定してリンクを再作成してください。
      required:
        - code
        - message
        - conflicts_with
    BankLinkQuote:
      type: object
      description: リンクの料金。作成時に固定されます。請求される料金は見積もりの料金です。読み取りでは課金されません。
      properties:
        id:
          type: string
          description: 見積もりの識別子。
          format: uuid
        lines:
          type: array
          items:
            $ref: '#/components/schemas/BankLinkQuoteLine'
          description: このリンクが要求するスコープに対して請求する明細です。
        fallback_lines:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/BankLinkQuoteLine'
          description: >-
            `allow_one_time_fallback`を指定してリンクを作成した場合にのみ、ワンタイムフォールバックの料金が表示されます。作成レスポンスに表示され、それ以外の場合は`null`です。データを含むワンタイム読み取りは、継続アクセスの初月分より高くなることがあります。
        total_usd:
          type: string
          description: '`lines`の合計（USD）。合計は下がることしかありません。付与額が減少した場合や、本人がより低価格の国を選んだ場合に下がります。'
          pattern: ^-?\d+(\.\d+)?$
        valid_until:
          type: string
          description: 見積もりはリンクに固定され、リンクの有効期間全体で有効です。そのため、`expires_at`と同じ値になります。
          format: date-time
        scopes:
          type: array
          items:
            type: string
            enum:
              - accounts
              - balances
              - transactions
          description: データの範囲によって見積もりの料金が決まります。
      required:
        - id
        - lines
        - fallback_lines
        - total_usd
        - valid_until
        - scopes
    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-で始まり、その後に小文字の16進数文字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
    BankLinkQuoteLine:
      type: object
      description: 見積もりの1つの課金明細行。
      properties:
        meter:
          type: string
          description: 課金される項目。例：`bank_data_connection_month`、`bank_verification`。
          example: bank_data_connection_month
        unit:
          type: string
          description: 1単位の内容。例：`connection_month`、`completed_sign_in`。
          example: connection_month
        price_usd:
          type: string
          description: 1単位あたりの料金（USD）。小数点以下4桁の文字列。例の金額は説明用です。国ごとの料金は料金ページに表示されます。
          pattern: ^-?\d+(\.\d+)?$
          example: '0.9000'
      required:
        - meter
        - unit
        - price_usd
  responses:
    Unauthorized:
      description: 認証されていません
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: 無効なAPIキー
              value:
                detail: Invalid API Key.
    RateLimitedWrite:
      description: APIキーごとに毎分300リクエストという共有の書き込み上限を超えました。`Retry-After` の指示に従ってから再試行してください。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          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
      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'
    BankDataInternalError:
      description: >-
        Didit側で予期しないエラーが発生しました。`/v3/bank/` 配下で起きた予期しないエラーは、HTMLページではなく、必ず Bank
        のエラー形式で応答されます。サポートに問い合わせる際は `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 の Developers -> API keys
        から取得できます。プライマリーキーはすべてのアクセス権を持ちます。名前付きキーは範囲を制限できます。リソースごとに
        none、read、write
        を指定でき、一部のワークフローや承認済みセッションに限定できます。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.