Специальные счета (tbank.special_accounts)¶
Специальные счета участников закупок: аресты средств и картотеки ЭТП (электронных торговых площадок). SDK покрывает выгрузку операций за период.
Хост:
business.tbank.ru/openapiпо Bearer-токену.Суммы:
Decimalв рублях. Провод:camelCase.Клиенты:
tbank.special_accounts.SpecialAccountsClient(async) иtbank.special_accounts.sync.SpecialAccountsClient(sync).
from tbank.special_accounts import SpecialAccountsClient
client = SpecialAccountsClient(token="business-token")
ops = await client.get_arrest_etp_operations(
account_number="40817810000000000001",
from_date="2026-01-01",
till="2026-06-30",
)
print(ops.arrests.sum) # общая сумма арестов
for arrest in ops.arrests.values or []:
print(arrest.amount, arrest.unblock_date)
for fee in ops.etp_fees or []:
print(fee.amount, fee.recipient.name)
Клиент¶
- class tbank.special_accounts.aio.SpecialAccountsClient(token, *, base_url=None, sandbox=False, retry=None, transport=None)[исходный код]¶
Базовые классы:
BaseAsyncClientАсинхронный клиент специальных счетов: операции ареста и картотеки ЭТП.
Работает на обычном хосте по Bearer-токену. Суммы — Decimal в рублях.
- Параметры:
token (str)
base_url (Optional[str])
sandbox (bool)
retry (Optional[RetryPolicy])
transport (Optional[AsyncTransport])
- decimal_body: ClassVar[bool] = True¶
True → тело парсится с parse_float=Decimal (точные денежные суммы).
- async get_arrest_etp_operations(account_number, from_date, till)[исходный код]¶
Аресты и картотеки ЭТП по спецсчёту за период (даты — YYYY-MM-DD).
- Параметры:
- Тип результата:
Модели¶
- class tbank.special_accounts.models.SpecialAccountModel[исходный код]¶
Базовые классы:
BaseModelБазовая модель домена: snake_case в Python, camelCase на проводе.
- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tbank.special_accounts.models.Recipient(*, inn, name=None, account=None)[исходный код]¶
Базовые классы:
SpecialAccountModel- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tbank.special_accounts.models.Bank(*, bik=None, corAccount=None, name=None)[исходный код]¶
Базовые классы:
SpecialAccountModel- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tbank.special_accounts.models.Etp(*, id, amount, currency, status, date, payedAmount, senderInn, recipient, bank, externalId=None, paymentPurpose=None, officeName=None)[исходный код]¶
Базовые классы:
SpecialAccountModelСписание по картотеке ЭТП / за нарушение контракта.
- Параметры:
- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tbank.special_accounts.models.Arrest(*, id, amount, currency, status, date, unblockDate, externalId=None, circumstances=None, officeName=None)[исходный код]¶
Базовые классы:
SpecialAccountModelАрест средств на специальном счёте.
- Параметры:
- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tbank.special_accounts.models.ArrestList(*, sum, values=None)[исходный код]¶
Базовые классы:
SpecialAccountModel- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tbank.special_accounts.models.OperationsResponse(*, arrests, etpFees=None, contractBreaches=None)[исходный код]¶
Базовые классы:
SpecialAccountModelОперации по специальному счёту: аресты, картотеки ЭТП, списания.
- Параметры:
arrests (ArrestList)
- model_config = {'alias_generator': <function to_camel>, 'extra': 'ignore', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].