Finance connectors

Изменить подключение или его состояние

Changed on

Пустой credential не стирает сохранённый секрет; явный null у company отвязывает юрлицо. Статус disconnected отключает подключение, сохраняя историю.

patch/api/v1/finance/connectors/{id}

Request

  • Base URL
    https://erp.akeda.ru
  • Auth
    • HTTP bearer
    • or API key in header X-Api-Key
    • or OAuth 2
      Authorization codehttps://erp.akeda.ru/oauth2/authorize
      Token URLhttps://erp.akeda.ru/oauth2/token
      Scopesakeda:delegate

Path parameters

id, string uuid required

Headers

X-Tenant, string required

Slug выбранного кабинета; кабинет не является юрлицом

Request body

FinanceConnectorPatch required
auto_accounts_since, string

ГГГГ-ММ-ДД: дата учёта новых счетов; пусто — ручная привязка. Существующие карточки не меняются

display_name, string
company_name, string
company, string uuid nullable
credential, string

Непустой новый секрет; пустая строка сохраняет прежний

import_depth_days, integer
overlap_days, integer
status, 'connected' | 'paused' | 'disconnected'
payments_disabled, boolean

Платежи через подключение: false — разрешены (если банк принимает их по API), true — только выписки

Response

Обновлённое подключение без секрета

FinanceConnector required
auto_accounts_since, string

ГГГГ-ММ-ДД: дата учёта новых счетов; пусто — ручная привязка. Существующие карточки не меняются

id, string uuid required
provider, 'modulbank' | 'tbank' | 'tochka' | 'alfa' | 'sber' | 'directbank' required
provider_name, string required
display_name, string required
company_name, string required
company, string uuid nullable required
company_directory_name, string required
company_inn, string required
status, 'connected' | 'paused' | 'error' | 'reauth_required' | 'awaiting_consent' | 'disconnected' required
status_name, string required
auth_kind, 'token' | 'client_credentials' | 'oauth' | 'oauth_mtls' | 'directbank' required
has_credentials, boolean required

Только признак; сохранённый секрет никогда не возвращается

mtls_certificate, FinanceConnectorMTLSStatus required
external_customer_id, string required
granted_by_user_id, integer nullable required
granted_by_name, string required
granted_at, string date-time nullable required
import_depth_days, integer required
overlap_days, integer required
payments_disabled, boolean required

Человек выключил платежи через подключение — только выписки

payments_supported, boolean required

Банк подключения принимает платёжные поручения по API

app_secret_expires_at, string date-time nullable

До какого момента действует ключ приложения банка (client_secret); Акеда меняет его сама за неделю до срока. Пусто — срок неизвестен или у банка такого ключа нет

health, FinanceConnectorHealth

Единый статус подключения банка (ERP-2404): одно значение для списка банков, выписки и «Юрлиц и счетов».

last_sync_at, string date-time nullable required
last_sync_status, string required
last_error, string required

The provider's technical reply, verbatim — material for an investigation, not a message for the cabinet screen: it may carry machine keys such as "invalid_client". The portal operator reads it in full on the bank connectors page, while the cabinet card renders last_error_code instead. Empty when the failure was ours: an internal cause never reaches this field, it is logged and named by last_error_code instead.

last_error_code, '' | 'finance.connector.internal' | 'finance.connector.provider_unauthorized' | 'finance.connector.provider_rate_limited' | 'finance.connector.provider_unavailable' | 'finance.connector.provider_declined' | 'finance.connector.consent_required' | 'finance.connector.secret_unreadable' required

Machine code of the last failure, translated by the client. Present because the text is stored: it is written in whatever locale the background sync happened to run in, and only a finite code can be rendered in the reader's language.

accounts_total, integer required
accounts_linked, integer required
can_delete, boolean required

True only for an abandoned connection attempt: no accounts returned by the bank and no sync run at all. Everything else is the origin trail of the imported operations and is never deleted — both links cascade — so such a connection is disconnected instead.

created_at, string date-time required
updated_at, string date-time required

Changes

    • info

      added the optional property health to the response with the status

    • info

      added the new optional request property auto_accounts_since

    • info

      added the optional property auto_accounts_since to the response with the status