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

# 托管银行链接：发送链接即可，无需在页面中写代码

> 在服务器上创建链接，并将用户发送至该 URL。Didit 托管所有页面，用户完成后可返回您的 `redirect_url`。

Didit 的托管 Bank Link 是目前连接银行的方式：您创建链接，将终端用户发送至其 `url`，Didit 会在自己的页面上展示所有界面。
银行数据仅适用于沙盒应用；生产环境应用的调用会返回 `404`，直到宣布开放生产环境访问权限为止。

## 创建链接并发送给终端用户

```bash theme={null}
curl -X POST https://verification.didit.me/v3/bank/links/ \
  -H "x-api-key: $DIDIT_API_KEY" -H "content-type: application/json" \
  -d '{
    "access": "ongoing",
    "country": "ESP",
    "data": ["accounts", "balances", "transactions"],
    "end_user": { "reference": "client-7731" },
    "vendor_data": "client-7731"
  }'
```

将浏览器重定向到响应中的 `url`，或将其放入电子邮件或消息中。
`url` 仅在创建链接时返回，链接过期后将失效（默认 60 分钟，可通过 `expires_in` 设置为 5 分钟至 24 小时）。

## 结束时会发生什么

* 如果 Didit 接受 `redirect_url`，浏览器会返回该地址。请参阅[返回您的网站](https://docs.didit.me/zh/integration/bank-link/return-to-your-site.md)。
* 如果没有提供该地址，流程会在 Didit 的结果页面结束。
* 无论哪种情况，`bank.link.completed` Webhook 和 `GET /v3/bank/links/{id}/` 都会告知您结果。

## 在您的服务器上确认

收到 `bank.link.completed` 后，使用您为该用户存储的链接 ID 调用 `GET /v3/bank/links/{id}/`。
接口会返回 `status: completed` 及 `connection_id`，或返回带有 `error.code` 的最终失败结果。
然后，继续阅读[快速入门](https://docs.didit.me/zh/core-technology/bank-verification/quickstart.md#步骤-4-接收-webhook-并确认)。


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