{"openapi":"3.1.0","info":{"title":"Northgate — API команды","version":"1.0.0","description":"Управление командой из своей системы: саб-аккаунты, баланс, выпуск и настройки карт, полные данные карт, транзакции.\n\n**Ключ.** Создаётся в панели: Настройки → API. Передавайте его в заголовке `Authorization: Bearer ng_live_…` (или `X-Api-Key`). Ключ работает только для своей команды и от имени админа, который его создал. Отзыв в панели действует мгновенно.\n\n**Лимиты.** 120 запросов в минуту на ключ (заголовки `X-Key-RateLimit-*`), данные карт — 30 в минуту на ключ. При превышении — 429 и `Retry-After`.\n\n**Повторы.** У POST-запросов можно указать `Idempotency-Key`: повтор с тем же ключом вернёт первый ответ и не выпустит карту / не переведёт деньги второй раз.\n\n**Деньги** — целые центы USD. Даты — ISO 8601 (UTC).\n\n**Вебхуки.** События команды — баланс ниже порога, любое изменение баланса, зачисленное пополнение, отклонённый платёж — приходят POST-запросом на ваш адрес, подписанные секретом. См. раздел webhooks.\n\n**MCP.** Тот же ключ подключает API к Claude, Cursor и другим AI-клиентам: Streamable HTTP, `POST https://api.northgate.cards/mcp`, заголовок `Authorization: Bearer ng_live_…`."},"servers":[{"url":"https://api.northgate.cards"}],"security":[{"bearer":[]},{"apiKey":[]}],"paths":{"/v1/me":{"get":{"summary":"Чей это ключ","operationId":"getMe","responses":{"200":{"description":"Команда и ключ","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"}}},"apiKey":{"type":"object","properties":{"name":{"type":"string"},"prefix":{"type":"string"}}},"actingAs":{"type":"string","description":"Email админа, от имени которого действует ключ"}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/balance":{"get":{"summary":"Баланс команды","operationId":"getBalance","responses":{"200":{"description":"Деньги команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deposit-addresses":{"get":{"summary":"Адреса для пополнения","operationId":"listDepositAddresses","responses":{"200":{"description":"Куда отправлять стейблкоины","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["base","ethereum","tron"]},"currency":{"type":"string","enum":["USDC","USDT"]},"address":{"type":"string"}}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deposits":{"get":{"summary":"Входящие пополнения","operationId":"listDeposits","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Страница пополнений, новые сверху","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Deposit"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bins":{"get":{"summary":"БИНы для выпуска карт","operationId":"listBins","responses":{"200":{"description":"Доступные сейчас БИНы","content":{"application/json":{"schema":{"type":"object","properties":{"bins":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sub-accounts":{"get":{"summary":"Саб-аккаунты","operationId":"listSubAccounts","responses":{"200":{"description":"Все саб-аккаунты команды","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubAccount"}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Создать саб-аккаунт","operationId":"createSubAccount","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Любая строка до 100 символов (буквы, цифры, - _ . :). Повтор запроса с тем же ключом вернёт первый ответ и не выполнит действие второй раз. Хранится 24 часа.","schema":{"type":"string","maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"responses":{"201":{"description":"Создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccount"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sub-accounts/{id}":{"get":{"summary":"Саб-аккаунт","operationId":"getSubAccount","parameters":[{"name":"id","in":"path","required":true,"description":"ID саб-аккаунта","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Саб-аккаунт","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubAccount"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sub-accounts/{id}/allocate":{"post":{"summary":"Перевести с основного баланса на саб-аккаунт","operationId":"allocate","parameters":[{"name":"id","in":"path","required":true,"description":"ID саб-аккаунта","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Любая строка до 100 символов (буквы, цифры, - _ . :). Повтор запроса с тем же ключом вернёт первый ответ и не выполнит действие второй раз. Хранится 24 часа.","schema":{"type":"string","maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoneyMove"}}}},"responses":{"200":{"description":"Переведено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveResult"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sub-accounts/{id}/return":{"post":{"summary":"Вернуть с саб-аккаунта на основной баланс","operationId":"returnToMain","parameters":[{"name":"id","in":"path","required":true,"description":"ID саб-аккаунта","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Любая строка до 100 символов (буквы, цифры, - _ . :). Повтор запроса с тем же ключом вернёт первый ответ и не выполнит действие второй раз. Хранится 24 часа.","schema":{"type":"string","maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoneyMove"}}}},"responses":{"200":{"description":"Возвращено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveResult"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/transfers":{"post":{"summary":"Перевод между саб-аккаунтами","operationId":"transfer","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Любая строка до 100 символов (буквы, цифры, - _ . :). Повтор запроса с тем же ключом вернёт первый ответ и не выполнит действие второй раз. Хранится 24 часа.","schema":{"type":"string","maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fromSubAccountId","toSubAccountId","amountCents"],"additionalProperties":false,"properties":{"fromSubAccountId":{"type":"string","format":"uuid"},"toSubAccountId":{"type":"string","format":"uuid"},"amountCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)","minimum":1},"note":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Переведено","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards":{"get":{"summary":"Карты","operationId":"listCards","parameters":[{"name":"subAccountId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string","enum":["active","paused","inactive","closed"]}}],"responses":{"200":{"description":"Карты команды","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Card"}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Выпустить карту","operationId":"issueCard","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Любая строка до 100 символов (буквы, цифры, - _ . :). Повтор запроса с тем же ключом вернёт первый ответ и не выполнит действие второй раз. Хранится 24 часа.","schema":{"type":"string","maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subAccountId","name"],"additionalProperties":false,"properties":{"subAccountId":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":40},"bin":{"type":"string","description":"Один из GET /v1/bins; не указан — любой"},"limit":{"type":"object","description":"Лимит трат карты; null — без лимита","required":["amountCents","period"],"properties":{"amountCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"period":{"type":"string","enum":["daily","weekly","monthly","yearly","lifetime"],"description":"`lifetime` — лимит на всё время жизни карты"}}}}}}}},"responses":{"201":{"description":"Выпущена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/bulk":{"post":{"summary":"Выпустить пачку карт (до 20)","operationId":"issueCards","description":"Названия из шаблона: `{n}` — номер. Останавливается на первом отказе: выпущенное до него — в `issued`, причина — в `stopped`.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Любая строка до 100 символов (буквы, цифры, - _ . :). Повтор запроса с тем же ключом вернёт первый ответ и не выполнит действие второй раз. Хранится 24 часа.","schema":{"type":"string","maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subAccountId","nameTemplate","count"],"additionalProperties":false,"properties":{"subAccountId":{"type":"string","format":"uuid"},"nameTemplate":{"type":"string","example":"FB {n}"},"count":{"type":"integer","minimum":1,"maximum":20},"startAt":{"type":"integer","minimum":1,"default":1},"bin":{"type":"string"},"limit":{"type":"object","description":"Лимит трат карты; null — без лимита","required":["amountCents","period"],"properties":{"amountCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"period":{"type":"string","enum":["daily","weekly","monthly","yearly","lifetime"],"description":"`lifetime` — лимит на всё время жизни карты"}}}}}}}},"responses":{"201":{"description":"Результат","content":{"application/json":{"schema":{"type":"object","properties":{"issued":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"stopped":{"type":["object","null"],"properties":{"name":{"type":"string"},"error":{"type":"string"}}}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}":{"get":{"summary":"Карта","operationId":"getCard","parameters":[{"name":"id","in":"path","required":true,"description":"ID карты","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Карта","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Изменить карту","operationId":"updateCard","description":"Переименовать, заметка, пауза / включение / закрытие, лимит (null — снять).","parameters":[{"name":"id","in":"path","required":true,"description":"ID карты","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","maxLength":40},"note":{"type":["string","null"],"maxLength":500},"status":{"type":"string","enum":["active","paused","closed"]},"limit":{"type":["object","null"],"description":"Лимит трат карты; null — без лимита","required":["amountCents","period"],"properties":{"amountCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"period":{"type":"string","enum":["daily","weekly","monthly","yearly","lifetime"],"description":"`lifetime` — лимит на всё время жизни карты"}}}}}}}},"responses":{"200":{"description":"Карта после изменения","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}/details":{"get":{"summary":"Полные данные карты","operationId":"getCardDetails","description":"Номер, CVV, срок и платёжный адрес. Каждый запрос записывается в журнал команды; лимит 30 в минуту на ключ. Ответ не кешируется.","parameters":[{"name":"id","in":"path","required":true,"description":"ID карты","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Данные карты","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardDetails"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/transactions":{"get":{"summary":"Транзакции","operationId":"listTransactions","description":"Новые сверху. `summary` считается по всему фильтру, а не по странице.","parameters":[{"name":"subAccountId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"cardId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","settled","declined","reversed","refunded"]}},{"name":"from","in":"query","description":"ISO 8601","schema":{"type":"string"}},{"name":"to","in":"query","description":"ISO 8601","schema":{"type":"string"}},{"name":"q","in":"query","description":"Поиск: мерчант, название или последние 4 карты, заметка","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Страница транзакций","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"},"summary":{"type":"object","properties":{"spentCents":{"type":"integer","description":"Реальные траты по фильтру"},"declinedCount":{"type":"integer"}}}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"summary":"Вебхуки команды","operationId":"listWebhooks","responses":{"200":{"description":"Адреса, куда приходят события","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Добавить вебхук","operationId":"createWebhook","description":"Не больше 5 на команду. Адрес — только https и только публичный. `secret` (подпись событий) приходит в ответе один раз.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["balance.low","balance.changed","deposit.confirmed","transaction.declined"]}},"lowBalanceCents":{"type":["integer","null"],"description":"balance.low: порог для саб-аккаунтов"},"lowMainBalanceCents":{"type":["integer","null"],"description":"balance.low: порог для основного баланса"},"description":{"type":"string","maxLength":200}}}}}},"responses":{"201":{"description":"Создан — сохраните secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"patch":{"summary":"Изменить вебхук","operationId":"updateWebhook","parameters":[{"name":"id","in":"path","required":true,"description":"ID вебхука","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["balance.low","balance.changed","deposit.confirmed","transaction.declined"]}},"lowBalanceCents":{"type":["integer","null"],"description":"Сумма в центах USD (100 = $1.00)"},"lowMainBalanceCents":{"type":["integer","null"],"description":"Сумма в центах USD (100 = $1.00)"},"description":{"type":["string","null"],"maxLength":200},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Вебхук","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Удалить вебхук","operationId":"deleteWebhook","parameters":[{"name":"id","in":"path","required":true,"description":"ID вебхука","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Удалён","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"summary":"Отправить тестовое событие","operationId":"testWebhook","description":"`webhook.test` уходит сразу; в ответе — что ответил ваш адрес. Не больше 10 в минуту.","parameters":[{"name":"id","in":"path","required":true,"description":"ID вебхука","schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Результат отправки","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":["integer","null"]},"error":{"type":["string","null"]}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/rotate-secret":{"post":{"summary":"Новый секрет подписи","operationId":"rotateWebhookSecret","description":"Старый секрет перестаёт использоваться сразу.","parameters":[{"name":"id","in":"path","required":true,"description":"ID вебхука","schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Новый секрет","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"secret":{"type":"string"}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/deliveries":{"get":{"summary":"Журнал доставок","operationId":"listWebhookDeliveries","parameters":[{"name":"id","in":"path","required":true,"description":"ID вебхука","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Доставки, новые сверху","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"}}}}}},"400":{"description":"Ошибка в запросе — поле и причина в `details`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет ключа, ключ неверный или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Команда приостановлена или объект другой команды","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Не найдено (в том числе объект другой команды)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Превышен лимит запросов — подождите `Retry-After` секунд","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"balance.low":{"post":{"summary":"Баланс саб-аккаунта или основной опустился ниже порога (один раз на пересечение)","description":"POST на ваш https-адрес, тело — JSON. Проверяйте подпись: `X-Northgate-Signature: t=<unix>,v1=<hex>`, где v1 = HMAC-SHA256(secret, `<t>.<тело ровно как пришло>`). Отклоняйте, если t старше 5 минут.\n\nОтветьте 2xx в течение 10 секунд. Иначе повторим через 10 с, 1 мин, 5 мин, 30 мин, 2 ч, 6 ч, 12 ч — всего 8 попыток. Порядок не гарантирован; дубли убирайте по `id` события.","parameters":[{"name":"X-Northgate-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Event","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"type":{"const":"balance.low"},"data":{"$ref":"#/components/schemas/BalanceEventData"}}}]}}}},"responses":{"200":{"description":"Любой 2xx — доставлено. Иначе — повтор с паузой."}}}},"balance.changed":{"post":{"summary":"Изменился баланс — основной или саб-аккаунта","description":"POST на ваш https-адрес, тело — JSON. Проверяйте подпись: `X-Northgate-Signature: t=<unix>,v1=<hex>`, где v1 = HMAC-SHA256(secret, `<t>.<тело ровно как пришло>`). Отклоняйте, если t старше 5 минут.\n\nОтветьте 2xx в течение 10 секунд. Иначе повторим через 10 с, 1 мин, 5 мин, 30 мин, 2 ч, 6 ч, 12 ч — всего 8 попыток. Порядок не гарантирован; дубли убирайте по `id` события.","parameters":[{"name":"X-Northgate-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Event","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"type":{"const":"balance.changed"},"data":{"$ref":"#/components/schemas/BalanceEventData"}}}]}}}},"responses":{"200":{"description":"Любой 2xx — доставлено. Иначе — повтор с паузой."}}}},"deposit.confirmed":{"post":{"summary":"Пополнение пришло и зачислено","description":"POST на ваш https-адрес, тело — JSON. Проверяйте подпись: `X-Northgate-Signature: t=<unix>,v1=<hex>`, где v1 = HMAC-SHA256(secret, `<t>.<тело ровно как пришло>`). Отклоняйте, если t старше 5 минут.\n\nОтветьте 2xx в течение 10 секунд. Иначе повторим через 10 с, 1 мин, 5 мин, 30 мин, 2 ч, 6 ч, 12 ч — всего 8 попыток. Порядок не гарантирован; дубли убирайте по `id` события.","parameters":[{"name":"X-Northgate-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Event","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"type":{"const":"deposit.confirmed"},"data":{"$ref":"#/components/schemas/Deposit"}}}]}}}},"responses":{"200":{"description":"Любой 2xx — доставлено. Иначе — повтор с паузой."}}}},"transaction.declined":{"post":{"summary":"Платёж по карте отклонён","description":"POST на ваш https-адрес, тело — JSON. Проверяйте подпись: `X-Northgate-Signature: t=<unix>,v1=<hex>`, где v1 = HMAC-SHA256(secret, `<t>.<тело ровно как пришло>`). Отклоняйте, если t старше 5 минут.\n\nОтветьте 2xx в течение 10 секунд. Иначе повторим через 10 с, 1 мин, 5 мин, 30 мин, 2 ч, 6 ч, 12 ч — всего 8 попыток. Порядок не гарантирован; дубли убирайте по `id` события.","parameters":[{"name":"X-Northgate-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Event","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"type":{"const":"transaction.declined"},"data":{"$ref":"#/components/schemas/Transaction"}}}]}}}},"responses":{"200":{"description":"Любой 2xx — доставлено. Иначе — повтор с паузой."}}}},"webhook.test":{"post":{"summary":"Тестовое событие (кнопка «Проверить» / POST …/test)","description":"POST на ваш https-адрес, тело — JSON. Проверяйте подпись: `X-Northgate-Signature: t=<unix>,v1=<hex>`, где v1 = HMAC-SHA256(secret, `<t>.<тело ровно как пришло>`). Отклоняйте, если t старше 5 минут.\n\nОтветьте 2xx в течение 10 секунд. Иначе повторим через 10 с, 1 мин, 5 мин, 30 мин, 2 ч, 6 ч, 12 ч — всего 8 попыток. Порядок не гарантирован; дубли убирайте по `id` события.","parameters":[{"name":"X-Northgate-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Event","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Northgate-Delivery","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"type":{"const":"webhook.test"},"data":{"type":"object","properties":{"message":{"type":"string"}}}}}]}}}},"responses":{"200":{"description":"Любой 2xx — доставлено. Иначе — повтор с паузой."}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Authorization: Bearer ng_live_…"},"apiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}},"Balance":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"mainCents":{"type":"integer","description":"Основной баланс команды"},"availableCents":{"type":"integer","description":"Можно перевести на саб-аккаунты прямо сейчас"},"heldCents":{"type":"integer","description":"Удержано: комиссия по пополнениям в обработке и комиссии за отказы"},"subAccountsCents":{"type":"integer","description":"Сумма на всех саб-аккаунтах"},"debit":{"type":["object","null"],"description":"Баланс Debit cards (карты BIN 402226) — пополняется с основного в панели; null, если он команде не включён","properties":{"balanceCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"availableCents":{"type":"integer","description":"Можно перевести на его саб-аккаунты"}}},"global":{"type":["object","null"],"description":"Баланс Global (карты BIN 441369) — пополняется с основного в панели; null, если он команде не включён","properties":{"balanceCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"availableCents":{"type":"integer","description":"Можно перевести на его саб-аккаунты"}}},"subAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"balanceCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"balance":{"type":"string","enum":["main","debit","global"]}}}}}},"SubAccount":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","closed"]},"balanceCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"balance":{"type":"string","enum":["main","debit","global"],"description":"С какого баланса команды пополняется: основного, Debit cards или Global"},"cardsCount":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}}},"Card":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"subAccountId":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","inactive","closed"]},"bin":{"type":["string","null"]},"last4":{"type":["string","null"]},"expMonth":{"type":["integer","null"]},"expYear":{"type":["integer","null"]},"limit":{"type":["object","null"],"description":"Лимит трат карты; null — без лимита","required":["amountCents","period"],"properties":{"amountCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"period":{"type":"string","enum":["daily","weekly","monthly","yearly","lifetime"],"description":"`lifetime` — лимит на всё время жизни карты"}}},"spentCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"note":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}}},"CardDetails":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string","description":"Полный номер карты"},"cvv":{"type":"string"},"last4":{"type":"string"},"expMonth":{"type":"integer"},"expYear":{"type":"integer"},"billingAddress":{"type":"object","properties":{"line1":{"type":["string","null"]},"line2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"postal":{"type":["string","null"]},"country":{"type":["string","null"]}}}}},"Transaction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"occurredAt":{"type":"string","format":"date-time","description":"Момент списания (авторизации карты) — не меняется, когда операция проводится"},"status":{"type":"string","enum":["pending","settled","declined","reversed","refunded"]},"amountCents":{"type":"integer","description":"Списание — отрицательное"},"currency":{"type":"string"},"merchant":{"type":["string","null"]},"mcc":{"type":["string","null"]},"card":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"last4":{"type":["string","null"]}}},"subAccount":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"declineReasonText":{"type":["string","null"],"description":"Причина отказа простыми словами"},"declineFeeCents":{"type":["integer","null"],"description":"Комиссия за этот отказ, если есть"},"verificationCode":{"type":["string","null"],"description":"Код подтверждения карты Meta/Facebook"}}},"Deposit":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"confirmedAt":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["pending","confirmed","rejected"]},"amountCents":{"type":"integer","description":"Пришло"},"feeCents":{"type":"integer","description":"Комиссия платформы"},"creditedCents":{"type":"integer","description":"Зачислено на баланс"},"txHash":{"type":["string","null"]}}},"MoneyMove":{"type":"object","required":["amountCents"],"additionalProperties":false,"properties":{"amountCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)","minimum":1},"note":{"type":"string","maxLength":500}}},"MoveResult":{"type":"object","properties":{"ok":{"type":"boolean"},"movementId":{"type":"string","format":"uuid"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["balance.low","balance.changed","deposit.confirmed","transaction.declined"]}},"lowBalanceCents":{"type":["integer","null"],"description":"Сумма в центах USD (100 = $1.00)"},"lowMainBalanceCents":{"type":["integer","null"],"description":"Сумма в центах USD (100 = $1.00)"},"description":{"type":["string","null"]},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"lastDelivery":{"type":["object","null"],"properties":{"at":{"type":"string","format":"date-time"},"ok":{"type":"boolean"},"status":{"type":["integer","null"]},"error":{"type":["string","null"]}}}}},"WebhookCreated":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string","description":"whsec_… — подпись событий, показывается один раз"}}}]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"type":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"attempts":{"type":"integer"},"status":{"type":"string","enum":["pending","delivered","failed"]},"deliveredAt":{"type":["string","null"],"format":"date-time"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"lastStatus":{"type":["integer","null"]},"lastError":{"type":["string","null"]}}},"WebhookEnvelope":{"type":"object","required":["id","type","createdAt","teamId","data"],"properties":{"id":{"type":"string","format":"uuid","description":"ID события — одинаковый во всех повторах; по нему убирайте дубли"},"type":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"teamId":{"type":"string","format":"uuid"},"data":{"type":"object"}}},"BalanceEventData":{"type":"object","properties":{"scope":{"type":"string","enum":["main","sub_account"]},"subAccount":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"previousCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"balanceCents":{"type":"integer","description":"Сумма в центах USD (100 = $1.00)"},"currency":{"type":"string","const":"USD"},"thresholdCents":{"type":"integer","description":"Только в balance.low"}}}}}}