> ## 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 何时发出提醒、续期接口的返回内容，以及授权失效后的处理方式。

银行同意的有效期取决于银行允许的时长，到期后须由用户本人续期。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/zh/core-technology/bank-verification/connections.md)
* [用于会计的持续银行数据流](https://docs.didit.me/zh/use-cases/bank-data-for-accounting.md)
* [数据、同意与删除](https://docs.didit.me/zh/core-technology/bank-verification/data-consent-and-deletion.md)


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