{ "openapi": "3.1.0", "info": { "title": "Bitforce. Admin Service", "description": "Admin API for legal entities, wallets, documents, and B2B purchase requests", "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, "version": "1.0.0" }, "paths": { "/v1/auth/login": { "post": { "tags": [ "auth" ], "summary": "Admin Login", "operationId": "admin_login_v1_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AdminLoginRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AdminLoginResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/auth/logout": { "post": { "tags": [ "auth" ], "summary": "Admin Logout", "description": "Клиент удаляет access_token локально. Сервер stateless.", "operationId": "admin_logout_v1_auth_logout_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/auth/me": { "get": { "tags": [ "auth" ], "summary": "Admin Me", "operationId": "admin_me_v1_auth_me_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AdminMeResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/organizations": { "get": { "tags": [ "organizations" ], "summary": "List Organizations", "operationId": "list_organizations_v1_organizations_get", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": [ "organizations" ], "summary": "Create Organization", "operationId": "create_organization_v1_organizations_post", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganizationRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/organizations/{organization_id}": { "get": { "tags": [ "organizations" ], "summary": "Get Organization", "operationId": "get_organization_v1_organizations__organization_id__get", "parameters": [ { "name": "organization_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Organization Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "tags": [ "organizations" ], "summary": "Update Organization", "operationId": "update_organization_v1_organizations__organization_id__patch", "parameters": [ { "name": "organization_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Organization Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateOrganizationRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/organizations/{organization_id}/wallets/create": { "post": { "tags": [ "organizations" ], "summary": "Create Organization Wallets", "operationId": "create_organization_wallets_v1_organizations__organization_id__wallets_create_post", "parameters": [ { "name": "organization_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Organization Id" } } ], "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WalletResponse" }, "title": "Response Create Organization Wallets V1 Organizations Organization Id Wallets Create Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/organizations/{organization_id}/documents": { "get": { "tags": [ "documents" ], "summary": "List Documents", "operationId": "list_documents_v1_organizations__organization_id__documents_get", "parameters": [ { "name": "organization_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Organization Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" }, "title": "Response List Documents V1 Organizations Organization Id Documents Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": [ "documents" ], "summary": "Upload Document", "operationId": "upload_document_v1_organizations__organization_id__documents_post", "parameters": [ { "name": "organization_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Organization Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_document_v1_organizations__organization_id__documents_post" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/organizations/{organization_id}/documents/{document_id}": { "get": { "tags": [ "documents" ], "summary": "Get Document", "operationId": "get_document_v1_organizations__organization_id__documents__document_id__get", "parameters": [ { "name": "organization_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Organization Id" } }, { "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Document Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/purchase-requests": { "get": { "tags": [ "purchase-requests" ], "summary": "List Purchase Requests", "operationId": "list_purchase_requests_v1_purchase_requests_get", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "organization_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Organization Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PurchaseRequestListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/purchase-requests/{request_id}": { "get": { "tags": [ "purchase-requests" ], "summary": "Get Purchase Request", "operationId": "get_purchase_request_v1_purchase_requests__request_id__get", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Request Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PurchaseRequestResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/purchase-requests/{request_id}/status": { "patch": { "tags": [ "purchase-requests" ], "summary": "Update Purchase Request Status", "operationId": "update_purchase_request_status_v1_purchase_requests__request_id__status_patch", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Request Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePurchaseRequestStatusBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PurchaseRequestResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/purchase-requests/{request_id}/quote": { "post": { "tags": [ "purchase-requests" ], "summary": "Set Purchase Request Quote", "operationId": "set_purchase_request_quote_v1_purchase_requests__request_id__quote_post", "parameters": [ { "name": "request_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Request Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetPurchaseRequestQuoteBody" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PurchaseRequestResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ping": { "post": { "summary": "Ping", "operationId": "ping_ping_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "type": "object", "title": "Response Ping Ping Post" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "schemas": { "AdminLoginRequest": { "properties": { "login": { "type": "string", "maxLength": 255, "minLength": 3, "title": "Login" }, "password": { "type": "string", "minLength": 8, "title": "Password" } }, "type": "object", "required": [ "login", "password" ], "title": "AdminLoginRequest" }, "AdminLoginResponse": { "properties": { "access_token": { "type": "string", "title": "Access Token" }, "token_type": { "type": "string", "title": "Token Type", "default": "Bearer" }, "id": { "type": "string", "title": "Id" }, "login": { "type": "string", "title": "Login" }, "first_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "First Name" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last Name" }, "role": { "type": "string", "title": "Role" } }, "type": "object", "required": [ "access_token", "id", "login", "first_name", "last_name", "role" ], "title": "AdminLoginResponse" }, "AdminMeResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "login": { "type": "string", "title": "Login" }, "first_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "First Name" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last Name" }, "role": { "type": "string", "title": "Role" } }, "type": "object", "required": [ "id", "login", "first_name", "last_name", "role" ], "title": "AdminMeResponse" }, "Body_upload_document_v1_organizations__organization_id__documents_post": { "properties": { "document_type": { "type": "string", "title": "Document Type" }, "file": { "type": "string", "format": "binary", "title": "File" } }, "type": "object", "required": [ "document_type", "file" ], "title": "Body_upload_document_v1_organizations__organization_id__documents_post" }, "CreateOrganizationRequest": { "properties": { "email": { "type": "string", "maxLength": 255, "minLength": 3, "title": "Email" }, "password": { "type": "string", "minLength": 8, "title": "Password" }, "name": { "type": "string", "maxLength": 512, "minLength": 1, "title": "Name" }, "short_name": { "anyOf": [ { "type": "string", "maxLength": 256 }, { "type": "null" } ], "title": "Short Name" }, "inn": { "type": "string", "maxLength": 12, "minLength": 10, "title": "Inn" }, "ogrn": { "anyOf": [ { "type": "string", "maxLength": 15 }, { "type": "null" } ], "title": "Ogrn" }, "kpp": { "anyOf": [ { "type": "string", "maxLength": 9 }, { "type": "null" } ], "title": "Kpp" }, "legal_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Legal Address" }, "actual_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Actual Address" }, "bank_details": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Bank Details" }, "contact_person": { "anyOf": [ { "type": "string", "maxLength": 256 }, { "type": "null" } ], "title": "Contact Person" }, "contact_phone": { "anyOf": [ { "type": "string", "maxLength": 16 }, { "type": "null" } ], "title": "Contact Phone" }, "status": { "type": "string", "title": "Status", "default": "active" } }, "type": "object", "required": [ "email", "password", "name", "inn" ], "title": "CreateOrganizationRequest" }, "DocumentResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "organization_id": { "type": "string", "title": "Organization Id" }, "document_type": { "type": "string", "title": "Document Type" }, "file_name": { "type": "string", "title": "File Name" }, "content_type": { "type": "string", "title": "Content Type" }, "file_size_bytes": { "type": "integer", "title": "File Size Bytes" }, "uploaded_by": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Uploaded By" }, "created_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Created At" }, "download_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Download Url" } }, "type": "object", "required": [ "id", "organization_id", "document_type", "file_name", "content_type", "file_size_bytes", "uploaded_by", "created_at" ], "title": "DocumentResponse" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "OrganizationListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/OrganizationResponse" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" } }, "type": "object", "required": [ "items", "total" ], "title": "OrganizationListResponse" }, "OrganizationResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "user_id": { "type": "string", "title": "User Id" }, "name": { "type": "string", "title": "Name" }, "short_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Short Name" }, "inn": { "type": "string", "title": "Inn" }, "ogrn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ogrn" }, "kpp": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Kpp" }, "legal_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Legal Address" }, "actual_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Actual Address" }, "bank_details": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Bank Details" }, "contact_person": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Contact Person" }, "contact_phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Contact Phone" }, "status": { "type": "string", "title": "Status" }, "kyc_verified": { "type": "boolean", "title": "Kyc Verified" }, "kyc_verified_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Kyc Verified At" }, "has_wallets": { "type": "boolean", "title": "Has Wallets" }, "created_by": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Created By" }, "created_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Created At" }, "updated_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Updated At" } }, "type": "object", "required": [ "id", "user_id", "name", "short_name", "inn", "ogrn", "kpp", "legal_address", "actual_address", "bank_details", "contact_person", "contact_phone", "status", "kyc_verified", "kyc_verified_at", "has_wallets", "created_by", "created_at", "updated_at" ], "title": "OrganizationResponse" }, "PurchaseRequestListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/PurchaseRequestResponse" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "title": "Total" } }, "type": "object", "required": [ "items", "total" ], "title": "PurchaseRequestListResponse" }, "PurchaseRequestResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "organization_id": { "type": "string", "title": "Organization Id" }, "status": { "type": "string", "title": "Status" }, "usdt_amount": { "type": "string", "title": "Usdt Amount" }, "rub_amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Rub Amount" }, "exchange_rate": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Exchange Rate" }, "service_fee_percent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Service Fee Percent" }, "comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comment" }, "admin_comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Admin Comment" }, "target_wallet_chain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Target Wallet Chain" }, "target_wallet_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Target Wallet Address" }, "tx_hash": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tx Hash" }, "assigned_to": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Assigned To" }, "created_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Created At" }, "updated_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Updated At" }, "completed_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Completed At" } }, "type": "object", "required": [ "id", "organization_id", "status", "usdt_amount", "rub_amount", "exchange_rate", "service_fee_percent", "comment", "admin_comment", "target_wallet_chain", "target_wallet_address", "tx_hash", "assigned_to", "created_at", "updated_at", "completed_at" ], "title": "PurchaseRequestResponse" }, "SetPurchaseRequestQuoteBody": { "properties": { "rub_amount": { "anyOf": [ { "type": "number", "exclusiveMinimum": 0.0 }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" } ], "title": "Rub Amount" }, "exchange_rate": { "anyOf": [ { "type": "number", "exclusiveMinimum": 0.0 }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" } ], "title": "Exchange Rate" }, "service_fee_percent": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" }, { "type": "null" } ], "title": "Service Fee Percent" }, "admin_comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Admin Comment" } }, "type": "object", "required": [ "rub_amount", "exchange_rate" ], "title": "SetPurchaseRequestQuoteBody" }, "UpdateOrganizationRequest": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 512 }, { "type": "null" } ], "title": "Name" }, "short_name": { "anyOf": [ { "type": "string", "maxLength": 256 }, { "type": "null" } ], "title": "Short Name" }, "ogrn": { "anyOf": [ { "type": "string", "maxLength": 15 }, { "type": "null" } ], "title": "Ogrn" }, "kpp": { "anyOf": [ { "type": "string", "maxLength": 9 }, { "type": "null" } ], "title": "Kpp" }, "legal_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Legal Address" }, "actual_address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Actual Address" }, "bank_details": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Bank Details" }, "contact_person": { "anyOf": [ { "type": "string", "maxLength": 256 }, { "type": "null" } ], "title": "Contact Person" }, "contact_phone": { "anyOf": [ { "type": "string", "maxLength": 16 }, { "type": "null" } ], "title": "Contact Phone" }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, "type": "object", "title": "UpdateOrganizationRequest" }, "UpdatePurchaseRequestStatusBody": { "properties": { "status": { "type": "string", "title": "Status" }, "admin_comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Admin Comment" }, "assigned_to": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Assigned To" }, "tx_hash": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tx Hash" } }, "type": "object", "required": [ "status" ], "title": "UpdatePurchaseRequestStatusBody" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "WalletResponse": { "properties": { "id": { "type": "string", "title": "Id" }, "chain": { "type": "string", "title": "Chain" }, "address": { "type": "string", "title": "Address" }, "derivation_path": { "type": "string", "title": "Derivation Path" }, "created_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Created At" } }, "type": "object", "required": [ "id", "chain", "address", "derivation_path", "created_at" ], "title": "WalletResponse" }, "ErrorResponse": { "properties": { "detail": { "title": "Detail", "type": "string" } }, "required": [ "detail" ], "title": "ErrorResponse", "type": "object" } } } }