{"openapi":"3.0.0","info":{"title":"SwapMy API","version":"1.0.0","description":"Public API for cryptocurrency swaps. Authenticate with an API key by passing it in the X-API-Key header or as a Bearer token. Keys can be generated from your account dashboard at /account.","contact":{"name":"SwapMy Support"}},"servers":[{"url":"/api/v1","description":"Production API"}],"tags":[{"name":"Orders","description":"Create and manage swap orders"},{"name":"Currencies","description":"Get available currencies and networks"},{"name":"Banners","description":"Get promotional banners"}],"paths":{"/currencies":{"get":{"tags":["Currencies"],"summary":"Get available currencies","description":"Returns a list of all supported currencies and networks","operationId":"getCurrencies","responses":{"200":{"description":"List of available currencies","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Currency"}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quote":{"post":{"tags":["Orders"],"summary":"Get a swap quote","description":"Get a quote for a swap without creating an order. Set dry_run to true for preview only.","operationId":"getQuote","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}}},"responses":{"200":{"description":"Quote generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteResponse"}}}},"400":{"description":"Bad request - missing or invalid fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error or provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"tags":["Orders"],"summary":"List orders","description":"Get a paginated list of swap orders. Optionally filter by status.","operationId":"listOrders","parameters":[{"name":"page","in":"query","description":"Page number (default: 1)","required":false,"schema":{"type":"integer","default":1,"minimum":1}},{"name":"limit","in":"query","description":"Items per page (default: 20)","required":false,"schema":{"type":"integer","default":20,"minimum":1,"maximum":100}},{"name":"status","in":"query","description":"Filter by order status","required":false,"schema":{"type":"string","enum":["PENDING_DEPOSIT","PROCESSING","SUCCESS","INCOMPLETE_DEPOSIT","REFUNDED","FAILED"]}}],"responses":{"200":{"description":"List of orders","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Orders"],"summary":"Create a swap order","description":"Create a new swap order. Returns deposit address and details.","operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Dry run quote (preview only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"201":{"description":"Order created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"400":{"description":"Bad request - missing or invalid fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error or provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"tags":["Orders"],"summary":"Get order by ID","description":"Get details for a specific order by UUID","operationId":"getOrder","parameters":[{"name":"id","in":"path","description":"Order UUID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Order details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/status":{"get":{"tags":["Orders"],"summary":"Get order status","description":"Get the current status and details for a specific order","operationId":"getOrderStatus","parameters":[{"name":"id","in":"path","description":"Order UUID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Order status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatus"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/banners":{"get":{"tags":["Banners"],"summary":"Get promotional banners","description":"Returns active promotional banners","operationId":"getBanners","responses":{"200":{"description":"List of active banners","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Banner"}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Admin authentication token"},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your personal API key (starts with sk_). Generate one from your account page."},"BearerAuth":{"type":"http","scheme":"bearer","description":"Pass your API key as a Bearer token in the Authorization header."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}},"required":["error"]},"Currency":{"type":"object","properties":{"ticker":{"type":"string","example":"BTC","description":"Currency ticker symbol"},"name":{"type":"string","example":"Bitcoin","description":"Full currency name"},"image":{"type":"string","example":"/uploads/btc.svg","description":"Currency logo URL"},"network":{"type":"string","example":"btc","description":"Blockchain network"},"tokenContract":{"type":"string","nullable":true,"description":"Token contract address (for tokens)"},"legacyTicker":{"type":"string","nullable":true,"description":"Legacy ticker symbol if different"}},"required":["ticker","name","network"]},"QuoteRequest":{"type":"object","properties":{"from_currency":{"type":"string","example":"BTC","description":"Source currency ticker"},"from_network":{"type":"string","example":"btc","description":"Source blockchain network"},"to_currency":{"type":"string","example":"ETH","description":"Destination currency ticker"},"to_network":{"type":"string","example":"eth","description":"Destination blockchain network"},"amount":{"oneOf":[{"type":"number"},{"type":"string"}],"example":"0.1","description":"Amount to swap (in source currency)"},"recipient_address":{"type":"string","example":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","description":"Recipient wallet address"},"recipient_memo":{"type":"string","nullable":true,"description":"Recipient memo/tag (for networks that require it)"},"refund_address":{"type":"string","example":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","description":"Refund wallet address"},"dry_run":{"type":"boolean","default":true,"description":"If true, only returns a quote without creating an order"}},"required":["from_currency","from_network","to_currency","to_network","amount","recipient_address","refund_address"]},"CreateOrderRequest":{"type":"object","properties":{"from_currency":{"type":"string","example":"BTC","description":"Source currency ticker"},"from_network":{"type":"string","example":"btc","description":"Source blockchain network"},"to_currency":{"type":"string","example":"ETH","description":"Destination currency ticker"},"to_network":{"type":"string","example":"eth","description":"Destination blockchain network"},"amount":{"oneOf":[{"type":"number"},{"type":"string"}],"example":"0.1","description":"Amount to swap (in source currency)"},"recipient_address":{"type":"string","example":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","description":"Recipient wallet address"},"recipient_memo":{"type":"string","nullable":true,"description":"Recipient memo/tag (for networks that require it)"},"refund_address":{"type":"string","example":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","description":"Refund wallet address"},"dry_run":{"type":"boolean","default":false,"description":"If true, only returns a quote without creating an order"}},"required":["from_currency","from_network","to_currency","to_network","amount","recipient_address","refund_address"]},"QuoteResponse":{"type":"object","properties":{"order_id":{"type":"string","example":"preview","description":"Order UUID (or 'preview' for dry runs)"},"deposit_address":{"type":"string","example":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","description":"Address to send funds to"},"deposit_memo":{"type":"string","nullable":true,"description":"Memo/tag for deposit (if required)"},"amount_in":{"type":"string","example":"10000000","description":"Input amount in atomic units"},"amount_in_formatted":{"type":"string","example":"0.1","description":"Input amount in human-readable format"},"amount_out":{"type":"string","example":"1500000000000000000","description":"Output amount in atomic units"},"amount_out_formatted":{"type":"string","example":"1.5","description":"Output amount in human-readable format"},"amount_in_usd":{"type":"string","nullable":true,"example":"4000.00","description":"Input amount in USD"},"amount_out_usd":{"type":"string","nullable":true,"example":"3950.00","description":"Output amount in USD"},"deadline":{"type":"string","format":"date-time","nullable":true,"description":"Quote expiration time"},"time_estimate":{"type":"number","nullable":true,"example":600,"description":"Estimated completion time in seconds"},"provider":{"type":"string","example":"A","enum":["A"],"description":"Route label (provider identity is not exposed)"},"created_at":{"type":"string","format":"date-time","description":"Quote creation timestamp"}},"required":["order_id","deposit_address","amount_in","amount_in_formatted","amount_out","amount_out_formatted","provider","created_at"]},"OrderResponse":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","description":"Order UUID"},"status":{"type":"string","example":"PENDING_DEPOSIT","enum":["PENDING_DEPOSIT","PROCESSING","SUCCESS","INCOMPLETE_DEPOSIT","REFUNDED","FAILED"],"description":"Current order status"},"deposit_address":{"type":"string","example":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","description":"Address to send funds to"},"deposit_memo":{"type":"string","nullable":true,"description":"Memo/tag for deposit (if required)"},"amount_in":{"type":"string","example":"10000000","description":"Input amount in atomic units"},"amount_in_formatted":{"type":"string","example":"0.1","description":"Input amount in human-readable format"},"amount_out":{"type":"string","example":"1500000000000000000","description":"Output amount in atomic units"},"amount_out_formatted":{"type":"string","example":"1.5","description":"Output amount in human-readable format"},"amount_in_usd":{"type":"string","nullable":true,"example":"4000.00","description":"Input amount in USD"},"amount_out_usd":{"type":"string","nullable":true,"example":"3950.00","description":"Output amount in USD"},"deadline":{"type":"string","format":"date-time","nullable":true,"description":"Order expiration time"},"time_estimate":{"type":"number","nullable":true,"example":600,"description":"Estimated completion time in seconds"},"provider":{"type":"string","example":"A","enum":["A"],"description":"Route label (provider identity is not exposed)"},"created_at":{"type":"string","format":"date-time","description":"Order creation timestamp"}},"required":["order_id","status","deposit_address","amount_in","amount_in_formatted","amount_out","amount_out_formatted","provider","created_at"]},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Order UUID"},"status":{"type":"string","enum":["PENDING_DEPOSIT","PROCESSING","SUCCESS","INCOMPLETE_DEPOSIT","REFUNDED","FAILED"],"description":"Current order status"},"from_currency":{"type":"string","example":"BTC"},"from_network":{"type":"string","example":"btc"},"to_currency":{"type":"string","example":"ETH"},"to_network":{"type":"string","example":"eth"},"amount":{"type":"string","description":"Amount in atomic units"},"amount_formatted":{"type":"string","description":"Amount in human-readable format"},"recipient_address":{"type":"string"},"recipient_memo":{"type":"string","nullable":true},"refund_address":{"type":"string"},"deposit_address":{"type":"string"},"deposit_memo":{"type":"string","nullable":true},"provider":{"type":"string","enum":["A"]},"provider_order_id":{"type":"string","description":"External order ID"},"amount_in_usd":{"type":"string","nullable":true},"amount_out_usd":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"OrderStatus":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["PENDING_DEPOSIT","PROCESSING","SUCCESS","INCOMPLETE_DEPOSIT","REFUNDED","FAILED"]},"deposit_address":{"type":"string"},"deposit_memo":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"}}},"OrderList":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":1},"limit":{"type":"integer","example":20},"total":{"type":"integer","example":150},"pages":{"type":"integer","example":8}}}}},"AdminOrderList":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":1},"limit":{"type":"integer","example":50},"total":{"type":"integer","example":500},"pages":{"type":"integer","example":10}}}}},"Banner":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"image_url":{"type":"string"},"link_url":{"type":"string","nullable":true},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"TradingPair":{"type":"object","properties":{"from_currency":{"type":"string"},"from_network":{"type":"string"},"to_currency":{"type":"string"},"to_network":{"type":"string"},"total_orders":{"type":"integer"},"total_volume_usd":{"type":"string","nullable":true},"last_order_at":{"type":"string","format":"date-time","nullable":true}}},"PlatformStats":{"type":"object","properties":{"total_orders":{"type":"integer","description":"Total number of orders"},"total_volume_usd":{"type":"string","description":"Total volume in USD"},"completed_orders":{"type":"integer","description":"Number of completed orders"},"pending_orders":{"type":"integer","description":"Number of pending orders"},"failed_orders":{"type":"integer","description":"Number of failed orders"}}}}},"security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}]}