{"openapi":"3.1.0","info":{"title":"Kivix Pay API","description":"Приём криптоплатежей через Telegram. Документация: /docs","version":"1.0.0"},"paths":{"/v1/me":{"get":{"tags":["Приложение"],"summary":"Приложение, к которому относится ключ","operationId":"get_me_v1_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance":{"get":{"tags":["Приложение"],"summary":"Баланс приложения","operationId":"get_balance_v1_balance_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/currencies":{"get":{"tags":["Справочники"],"summary":"Монеты и лимиты (без ключа)","operationId":"get_currencies_v1_currencies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/invoices":{"post":{"tags":["Счета"],"summary":"Создать счёт","operationId":"create_invoice_v1_invoices_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Счета"],"summary":"Список счетов","operationId":"list_invoices_v1_invoices_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","paid","expired","cancelled"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Order Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"id последнего счёта прошлой страницы","title":"Starting After"},"description":"id последнего счёта прошлой страницы"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invoices/{invoice_id}":{"get":{"tags":["Счета"],"summary":"Счёт по id","operationId":"get_invoice_v1_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invoices/{invoice_id}/cancel":{"post":{"tags":["Счета"],"summary":"Отменить неоплаченный счёт","operationId":"cancel_invoice_v1_invoices__invoice_id__cancel_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook":{"get":{"tags":["Вебхуки"],"summary":"Настройки вебхука","operationId":"get_webhook_v1_webhook_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Вебхуки"],"summary":"Задать адрес вебхука","operationId":"set_webhook_v1_webhook_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSet"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Вебхуки"],"summary":"Отключить вебхук","operationId":"delete_webhook_v1_webhook_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook/test":{"post":{"tags":["Вебхуки"],"summary":"Прислать тестовое событие","operationId":"test_webhook_v1_webhook_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events":{"get":{"tags":["Вебхуки"],"summary":"Последние события и статус их доставки","operationId":"list_events_v1_events_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Crypto-Pay-API-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crypto-Pay-Api-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceCreate":{"properties":{"amount":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}],"title":"Amount","description":"Сумма строкой, например \"12.50\"","examples":["12.50"]},"asset":{"type":"string","maxLength":12,"minLength":2,"title":"Asset","description":"Монета: USDT, BTC, ETH, TRX, BNB, GRAM","examples":["USDT"]},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Видит покупатель","default":"","examples":["Заказ #1001"]},"order_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Order Id","description":"Ваш номер заказа; повтор с тем же order_id вернёт тот же счёт","examples":["1001"]},"payload":{"type":"string","maxLength":4096,"title":"Payload","description":"Любые ваши данные; покупатель их не видит","default":""},"expires_in":{"type":"integer","title":"Expires In","description":"Сколько секунд счёт можно оплатить","default":3600,"examples":[3600]},"success_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Success Url","description":"HTTPS-ссылка: кнопка «Вернуться в магазин» после оплаты"},"fiat":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiat","description":"Если задано, amount — в этой валюте (USD, RUB, EUR, UAH, KZT), а покупатель платит эквивалент в asset по курсу на момент создания счёта","examples":["RUB"]}},"type":"object","required":["amount","asset"],"title":"InvoiceCreate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookSet":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url","description":"HTTPS-адрес, куда слать события","examples":["https://shop.example/kivix"]}},"type":"object","required":["url"],"title":"WebhookSet"}}}}