{"openapi":"3.0.3","info":{"title":"API Exchange","version":"1.0.0","description":"Документация api сервисов\n"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/lexerdxx/100exchage/1.0.0"},{"url":"https://api.example.com","description":"Default API gateway (placeholder)"}],"tags":[{"name":"Order Service","description":"order-service endpoints used by webapp-api-service"},{"name":"Payment System Service","description":"payment-system-service endpoints used by order-service"},{"name":"Currency Service","description":"exchange-rate-service endpoints used by order-service"},{"name":"Config Service","description":"config-service endpoints used by order-service"},{"name":"User Service","description":"user-service endpoints used by all services"},{"name":"Web App Api Service","description":"web-app-api-service endpoints used from external"}],"paths":{"/internal/directions":{"get":{"tags":["Order Service"],"summary":"Get active exchange directions","description":"Получение активных направлений обменов","operationId":"getDirections","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Direction"}}}}}}}},"/internal/quotes":{"post":{"tags":["Order Service"],"summary":"Create fixed quote (offer)","description":"Создание зафиксированного расчета заявки (Оферта)","operationId":"createQuote","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuote"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}}}}}}}},"/internal/quotes/{quote_uid}":{"get":{"tags":["Order Service"],"summary":"Get fixed quote (offer)","description":"Получить расчет заявки","operationId":"getQuote","parameters":[{"name":"quote_uid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}}}}},"/internal/orders":{"post":{"tags":["Order Service"],"summary":"Create exchange order","description":"Создание заявки на обмен","operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrder"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}}}}}}}},"/internal/orders/{order_uid}":{"get":{"tags":["Order Service"],"summary":"Get order","description":"Получить заявку по uid","operationId":"getOrder","parameters":[{"name":"order_uid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}}}},"/internal/payment-systems":{"get":{"tags":["Payment System Service"],"summary":"List payment systems","description":"Получить список платежных систем","operationId":"listPaymentSystems","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSystem"}}}}}}}},"/internal/payment-systems/{payment_system_uid}":{"get":{"tags":["Payment System Service"],"summary":"Get payment system by UID","description":"Получить информацию о платежной системе","operationId":"getPaymentSystem","parameters":[{"name":"payment_system_uid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSystem"}}}},"404":{"description":"Not Found"}}}},"/internal/wallet-reservations":{"post":{"tags":["Payment System Service"],"summary":"Reserve pay-in wallet details","description":"Зарезервировать реквизиты для приема платежа","operationId":"createWalletReservation","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWalletReservation"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}}}}}}}},"/internal/wallet-reservations/{wallet_reservation_uid}":{"get":{"tags":["Payment System Service"],"summary":"Get Wallet Reservation","description":"Получить реквизиты для приема платежа","operationId":"getWalletReservation","parameters":[{"name":"wallet_reservation_uid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletReservation"}}}}}}},"/internal/payouts":{"post":{"tags":["Payment System Service"],"summary":"Create payout","description":"Создать выплату","operationId":"createPayout","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayout"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}}}}}}}},"/internal/payouts/{payout_uid}":{"get":{"tags":["Payment System Service"],"summary":"Get Payout","description":"Получить информацию о выплате","operationId":"getPayout","parameters":[{"name":"payout_uid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}}},"404":{"description":"Not Found"}}}},"/internal/rates":{"get":{"tags":["Currency Service"],"summary":"Get currency rates","description":"Получить курс валют","operationId":"getRates","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeRates"}}}}}}}},"/internal/rates/{currency_code}":{"get":{"tags":["Currency Service"],"summary":"Get rate by currency code","description":"Получить курс валюты","operationId":"getRateByCurrencyCode","parameters":[{"name":"currency_code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRates"}}}},"404":{"description":"Not Found"}}}},"/internal/settings":{"get":{"tags":["Config Service"],"summary":"Get settings","description":"Получить настройки","operationId":"getSettings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}}}}},"/internal/users":{"get":{"tags":["User Service"],"summary":"Get User","description":"Получить пользователя","operationId":"getUsers","responses":{"200":{"description":"OK"}}}},"/internal/users/ensure":{"post":{"tags":["User Service"],"summary":"Create User Ensure","description":"Создать пользователя если нет","operationId":"createUsers","responses":{"200":{"description":"OK"}}}},"/api/quotes":{"get":{"tags":["Web App Api Service"],"summary":"API Get quotes","description":"Получить расчет","operationId":"apiGetQuotes","responses":{"200":{"description":"OK"}}},"post":{"tags":["Web App Api Service"],"summary":"API Post quotes","description":"Создать расчет","operationId":"apiCreateQuotes","responses":{"200":{"description":"OK"}}}},"/api/orders":{"get":{"tags":["Web App Api Service"],"summary":"API Get quotes","description":"Получить заявку","operationId":"apiGetOrders","responses":{"200":{"description":"OK"}}},"post":{"tags":["Web App Api Service"],"summary":"API Post quotes","description":"Создать заявку","operationId":"apiCreaterders","responses":{"200":{"description":"OK"}}}},"/api/login":{"post":{"tags":["Web App Api Service"],"summary":"API Login","description":"Аутентификация","operationId":"apiLogin","responses":{"200":{"description":"OK"}}}},"/api/directions":{"get":{"tags":["Web App Api Service"],"summary":"API Get directions","description":"Получить направления","operationId":"apiGetDirections","responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"Direction":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"payment_system_from":{"type":"object","properties":{"code":{"type":"string","example":"bitcoin"},"name":{"type":"string","example":"Bitcoin"},"currency_code":{"type":"string","example":"btc"},"reserve":{"type":"number","example":0.1}}},"payment_system_to":{"type":"object","properties":{"code":{"type":"string","example":"banks"},"name":{"type":"string","example":"Банки РФ"},"currency_code":{"type":"string","example":"rub"},"reserve":{"type":"number","example":0.1}}},"rate":{"type":"number","example":"1000","description":"effective_direction_rate"},"min_order_amount":{"type":"number","example":1.0E-5},"max_order_amount":{"type":"number","example":"0,01"}}},"PaymentSystemCurrencyCommission":{"type":"object","properties":{"for_from":{"type":"number","example":0},"for_to":{"type":"number","example":100},"currency_code":{"type":"string","example":"btc"}}},"PaymentSystem":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"code":{"type":"string","example":"bitcoin"},"name":{"type":"string","example":"Bitcoin"},"currency_code":{"type":"string","example":"btc"},"currency_commissions":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSystemCurrencyCommission"},"example":[{"for_from":0,"for_to":100,"currency_code":"btc"},{"for_from":101,"for_to":1000,"currency_code":"btc"}]}}},"ExchangeRates":{"type":"object","properties":{"base_currency_code":{"type":"string","example":"usd"},"quote_currency_code":{"type":"string","example":"btc"},"rate":{"type":"number","example":1.0E-4},"updated_at":{"type":"string","format":"date-time"}}},"Quote":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"payment_amount":{"type":"number","example":"1000"},"payout_amount":{"type":"number","example":"0.001"},"rate":{"type":"number","example":"1000","description":"effective_direction_rate"},"network_fee":{"type":"number","example":"0.2","description":"Комиссия сети (для крипты)"},"expires_at":{"type":"string","format":"date-time"}}},"WalletReservation":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"wallet_uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"requisite":{"type":"string","example":"123426216122321"},"expires_at":{"type":"string","format":"date-time"}}},"Order":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"payment":{"type":"object","properties":{"amount":{"type":"number","example":1000},"requisite":{"type":"number","example":1000},"payment_system":{"type":"object","properties":{"code":{"type":"string","example":"banks"},"name":{"type":"string","example":"Банки РФ"},"currency_code":{"type":"string","example":"rub"}}}}},"payout":{"type":"object","properties":{"amount":{"type":"number","example":1000},"requisite":{"type":"number","example":1000},"payment_system":{"type":"object","properties":{"code":{"type":"string","example":"banks"},"name":{"type":"string","example":"Банки РФ"},"currency_code":{"type":"string","example":"rub"}}}}},"status":{"type":"string","example":"created"}}},"Payout":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"wallet_uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"bussines_type":{"type":"string","example":"order_payments"},"bussines_uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"amount":{"type":"number","example":1000},"currency_code":{"type":"string","example":"usd"},"status":{"type":"string","example":"created"}}},"Setting":{"type":"object","properties":{"uid":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"code":{"type":"string","example":"BTC_FEE_PER_KB_BTC"},"section":{"type":"string","example":"BTC"},"value":{"type":"string","example":"1.2"},"data_type":{"type":"string","example":"numeric"}}},"CreateQuote":{"type":"object","required":["direction_uid","amount","user_uid"],"properties":{"direction_uid":{"type":"string","description":"UID направления обмена","example":"dir_123456"},"amount":{"type":"number","format":"decimal","description":"Сумма, введенная пользователем","example":1000},"user_uid":{"type":"string","description":"UID пользователя (прокидывается bff)","example":"user_123456"}}},"CreateOrder":{"type":"object","required":["quote_uid","recipient_requisites"],"properties":{"quote_uid":{"type":"string","description":"UID расчета","example":"quote_123456"},"recipient_requisites":{"type":"string","discription":"Реквизит получателя","example":1234123412}}},"CreateWalletReservation":{"type":"object","required":["payment_system_code","amount","currency_code"],"properties":{"payment_system_code":{"type":"string","desctription":"Код платежной системы","example":"bitcoin"},"amount":{"type":"number","descriptiom":"Сумма заявки","example":1000},"currency_code":{"type":"string","description":"Валюта суммы","example":"usd"}}},"CreatePayout":{"type":"object","required":["payment_system_code"],"properties":{"wallet_uid":{"type":"string","desctription":"uid кошелька","example":"bitcoin"},"amount":{"type":"number","descriptiom":"Сумма платежа","example":1000},"recipient_requisites":{"type":"string","discription":"Реквизит получателя","example":1234123412}}}}}}