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

# 銀行同意の更新：有効期間・リマインダー・失効

> Didit で銀行同意の有効期間、リマインダーの仕組み、更新APIの応答、同意が失効した場合の挙動を解説します。

銀行の同意は、銀行が許可する期間だけ有効で、その後は本人による更新が必要です。
Diditは期限が切れる前にお知らせし、同じ接続を更新するための呼び出しを提供します。

## 有効期間

* 銀行とルートが終了日を決めます。上限は、リクエストした `consent_days` までです。
* 各接続の実際の日付は、`consent.expires_at` と `consent.renew_by` に表示されます。
* 金融機関は、銀行が許可する最長の同意期間を `consent_days_max` に表示します。
* ユーザーに固定の日数を約束することは絶対にしないでください。接続に表示された日付「まで」と伝えてください。

## 事前に把握する

`bank.connection.consent_expiring` は、終了の14日前、7日前、1日前に送信されます。
終了間近の接続を一覧で取得することもできます：

```bash theme={null}
curl "https://verification.didit.me/v3/bank/connections/?status=active&consent_expires_before=2026-12-15" \
  -H "x-api-key: $DIDIT_API_KEY"
```

## 更新

```bash theme={null}
curl -X POST https://verification.didit.me/v3/bank/connections/$CONNECTION_ID/renew/ \
  -H "x-api-key: $DIDIT_API_KEY" -H "content-type: application/json" \
  -d '{ "redirect_url": "http://localhost:3000/bank/return" }'
```

リクエストに対しては、`201` と更新リンクが返されます。または、次のいずれかが返されます。

| 応答 | 意味 |
| - | - |
| `409 renewal_not_needed` | 残りが30日を超えています。後でもう一度お試しください。 |
| `409 renewal_window_expired` | `consent.renewable_until` を過ぎています。本人は新しいリンクで改めて接続します。 |

本人が更新を完了するページはまだ提供されていません。そのため、現時点では更新リンクを本人に送らないでください。提供されるまでは、上記のリマインダーを使って、同意がいつ終了するかを把握してください。

## 同意が失効した場合

* 接続は `renewal_required` になり、`status_reason: consent_expired` または `bank_requires_sign_in` になります。
* 同期済みのデータは引き続き参照できますが、新たな同期も課金も行われず、`bank.connection.renewal_required` が送信されます。
* `consent.renewable_until` を過ぎると接続は `revoked` になり、`status_reason: consent_lapsed` になります。その後、エンドユーザーは再度接続する必要があります。

## 関連情報

* [接続](https://docs.didit.me/ja/core-technology/bank-verification/connections.md)
* [会計向けの継続的な銀行明細フィード](https://docs.didit.me/ja/use-cases/bank-data-for-accounting.md)
* [データ、同意、削除](https://docs.didit.me/ja/core-technology/bank-verification/data-consent-and-deletion.md)


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