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"
}'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)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);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Bank.CreateLink(ctx, didit.BankCreateLinkParams{
Body: didit.BankLinkCreateRequest{
Mode: didit.Some(didit.BankLinkCreateRequestMode("connect")),
Access: didit.Some(didit.BankLinkCreateRequestAccess("ongoing")),
Country: didit.String("ESP"),
Segment: didit.Some(didit.BankLinkCreateRequestSegment("business")),
Data: didit.Some([]didit.BankLinkCreateRequestData{"accounts", "balances", "transactions"}),
HistoryFrom: didit.String("2026-01-01"),
ConsentDays: didit.Int(180),
Ownership: didit.Some(didit.BankLinkOwnershipRequest{
Compare: didit.Some(didit.BankLinkOwnershipRequestCompare("none")),
}),
EndUser: didit.Some(didit.BankLinkEndUser{
Reference: didit.String("client-7731"),
Email: didit.String("ana@example.com"),
}),
RedirectURL: didit.String("https://app.example.com/bank/return"),
AllowedOrigins: didit.Some([]string{"https://app.example.com"}),
Language: didit.String("es"),
VendorData: didit.String("client-7731"),
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)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);<?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());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_husing 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));{
"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"
}Создать Bank Link API: подключение или обновление банка
Didit: эндпоинт Create a Bank Link запускает сеанс Bank Link и возвращает размещённую ссылку для подключения банка.
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"
}'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)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);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Bank.CreateLink(ctx, didit.BankCreateLinkParams{
Body: didit.BankLinkCreateRequest{
Mode: didit.Some(didit.BankLinkCreateRequestMode("connect")),
Access: didit.Some(didit.BankLinkCreateRequestAccess("ongoing")),
Country: didit.String("ESP"),
Segment: didit.Some(didit.BankLinkCreateRequestSegment("business")),
Data: didit.Some([]didit.BankLinkCreateRequestData{"accounts", "balances", "transactions"}),
HistoryFrom: didit.String("2026-01-01"),
ConsentDays: didit.Int(180),
Ownership: didit.Some(didit.BankLinkOwnershipRequest{
Compare: didit.Some(didit.BankLinkOwnershipRequestCompare("none")),
}),
EndUser: didit.Some(didit.BankLinkEndUser{
Reference: didit.String("client-7731"),
Email: didit.String("ana@example.com"),
}),
RedirectURL: didit.String("https://app.example.com/bank/return"),
AllowedOrigins: didit.Some([]string{"https://app.example.com"}),
Language: didit.String("es"),
VendorData: didit.String("client-7731"),
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)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);<?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());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_husing 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));{
"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"
}url.
Каждое поле имеет значение по умолчанию, поэтому минимальный запрос выглядит так: {} и всё, что вы хотите указать.
Сохраняйте возвращённый id, связав его с пользователем, и сами проверяйте результат через Получить ссылку на банковское подключение или webhook bank.link.completed.
См. быстрый старт и Bank Link.Авторизации
API-ключ вашего приложения берётся в разделе Developers -> API keys в Business Console. Основной ключ имеет полный доступ. Именованный ключ можно ограничить: доступ для каждого ресурса (нет доступа, только чтение или запись), ограничение некоторыми сценариями или одобренными сессиями, список IP-адресов и дата истечения срока. Ответ 401 означает, что ключ неверный, отозван или истёк. Ответ 403 означает, что ключ не передан, у ключа нет доступа к этому ресурсу или действию либо запрос пришёл с адреса вне его списка IP. Ответ 404 на маршруте сессии означает, что сессия находится вне сценариев или статусов, доступных ключу. Ключ без доступа к медиа получает URL изображений, видео и PDF как null, а ключ без права записи в сессии получает ссылки и токены сессий как null. См. https://docs.didit.me/console/api-keys.
Заголовки
Необязательный ключ для безопасных повторных запросов, который вы выбираете для одной операции, до 255 символов (подойдёт UUID). Запрос, повторённый с тем же ключом, endpoint, параметрами запроса и телом, получает первый ответ с тем же статусом и тем же телом и не выполняется и не тарифицируется повторно. Тот же ключ с другим endpoint, параметрами запроса или телом возвращает 409 idempotency_key_reused, а пока первый запрос ещё выполняется, 409 idempotency_key_in_progress с Retry-After. Неудачный запрос (любой 4xx или 5xx) не сохраняется, поэтому его можно отправить повторно с тем же ключом. Ключи принадлежат вашему приложению, независимо от того, вызываете ли вы API с API-ключом или с токеном доступа. См. Повторные попытки и идемпотентность.
1 - 255Тело
Создайте Bank Link. Минимальный запрос: {} плюс то, что вам нужно. У каждого поля есть значение по умолчанию.
one_time (по умолчанию) считывает данные однократно. ongoing поддерживает доступ открытым до окончания согласия или пока кто-либо не остановит доступ. Если задан institution_id, банк, который не может поддерживать доступ открытым, возвращает 400 ongoing_access_not_available до показа экрана. Без него в выборе банка отображаются только банки, которые могут.
one_time, ongoing Только для режима ongoing. Сколько дней банку нужно держать доступ открытым, 1 или больше. По умолчанию: максимум, который разрешает банк. Подключение возвращает дату, которую банк фактически предоставил, в consent.expires_at. При access: one_time возвращается 400 invalid_request с field: consent_days.
1 <= x <= 32767Куда браузер переходит в конце, с link_id, status и подписанным state (только для отображения: основным источником являются webhook и get_link). В песочнице для приложения обычный адрес http с localhost, 127.0.0.1 или [::1] (любой порт и путь, без учётных данных и фрагмента) не требует регистрации. Любой другой адрес возвращает 400 redirect_url_not_registered: регистрация других адресов пока недоступна. Без redirect_url человек завершает работу на собственной странице результатов Didit.
2048Для ongoing позволяет пользователю продолжить однократным чтением в банке, который не может поддерживать доступ открытым, после подтверждения сокращенного доступа на собственном экране банка. В котировке показано, сколько это стоит. Только при access: ongoing: при одноразовом доступе возвращается 400 invalid_request с field: allow_one_time_fallback.
Ответ
Ссылка создана.
Один запуск Bank Link для одного пользователя: подключение банка или продление подключения. Подтверждайте ссылку сами с помощью get_link: никогда не доверяйте идентификатору, присланному браузером.
Токен для встроенного Bank Link от Didit, который пока не предоставляется: откройте url сегодня. Возвращается только при создании ссылки; при последующих чтениях значение null. Имеет одно назначение и короткий срок жизни. Не содержит персональных данных. Никогда не записывайте его в журнал.