{"openapi":"3.1.0","info":{"title":"toXMR API","version":"1.0.0","description":"Quote, create and track swaps to and from Monero (XMR). No account or API key. Every swap has XMR on one side. Rates float with the market and fees are included in the estimate. Limits per IP address: 60 quotes, 60 address checks and 120 status reads a minute, and 12 new swaps in 10 minutes.","termsOfService":"https://toxmr.com/terms"},"servers":[{"url":"https://toxmr.com/api/v1"}],"security":[],"externalDocs":{"description":"Guide with examples","url":"https://toxmr.com/developers"},"paths":{"/coins":{"get":{"summary":"Coins you can swap to XMR and get for XMR","operationId":"listCoins","responses":{"200":{"description":"Coin list","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"updated":{"type":["string","null"]},"counts":{"type":"object","properties":{"toXmr":{"type":"integer"},"fromXmr":{"type":"integer"}}},"xmr":{"$ref":"#/components/schemas/Coin"},"coins":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Coin"},{"type":"object","properties":{"toXmr":{"type":"boolean"},"fromXmr":{"type":"boolean"},"pages":{"type":"object","properties":{"toXmr":{"type":"string"},"fromXmr":{"type":"string"}}}}}]}}}}}}},"429":{"$ref":"#/components/responses/Error"}}}},"/quote":{"get":{"summary":"Live estimate, minimum and maximum for a pair","operationId":"getQuote","parameters":[{"name":"from","in":"query","required":true,"description":"Ticker of the coin you send","schema":{"type":"string","example":"btc"}},{"name":"to","in":"query","required":true,"description":"Ticker of the coin you get","schema":{"type":"string","example":"xmr"}},{"name":"amount","in":"query","required":false,"description":"Amount to send. Without it, a typical amount is quoted.","schema":{"type":"string","example":"0.01"}}],"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/validate":{"get":{"summary":"Check an address for a coin","operationId":"validateAddress","parameters":[{"name":"coin","in":"query","required":true,"description":"Ticker of the coin","schema":{"type":"string","example":"xmr"}},{"name":"address","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"coin":{"type":"string"},"valid":{"type":"boolean"},"message":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/swaps":{"post":{"summary":"Create a swap and get its deposit address","operationId":"createSwap","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSwap"}}}},"responses":{"201":{"description":"Swap created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Created"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/swaps/{id}":{"get":{"summary":"Status of a swap","operationId":"getSwap","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9]{8,32}$"}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}}},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}}},"components":{"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["ok","error","message"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string","enum":["not_found","method_not_allowed","missing_pair","unknown_pair","pair_unavailable","invalid_amount","amount_out_of_range","quote_unavailable","missing_input","check_unavailable","invalid_json","invalid_input","swap_failed","status_unavailable","rate_limited"]},"message":{"type":"string"},"errors":{"type":"object","description":"Field name to problem, for invalid_input","additionalProperties":{"type":"string"}}}},"Coin":{"type":"object","properties":{"ticker":{"type":"string","example":"usdttrc20"},"symbol":{"type":"string","example":"USDT"},"name":{"type":"string"},"label":{"type":"string","example":"USDT (TRC20)"},"network":{"type":"string"},"contract":{"type":["string","null"]},"memo":{"type":["object","null"],"properties":{"name":{"type":"string"},"onDeposit":{"type":"boolean"},"onPayout":{"type":"boolean"}}}}},"Quote":{"type":"object","properties":{"ok":{"type":"boolean"},"from":{"type":"string"},"to":{"type":"string"},"amount":{"type":["number","null"]},"estimate":{"type":["number","null"]},"rate":{"type":["number","null"]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"eta":{"type":["string","null"]},"rateType":{"type":"string","const":"floating"},"feesIncluded":{"type":"boolean"},"quotedAt":{"type":"string","format":"date-time"}}},"NewSwap":{"type":"object","required":["from","to","amount","address"],"properties":{"from":{"type":"string","example":"btc"},"to":{"type":"string","example":"xmr"},"amount":{"type":["string","number"],"example":"0.01"},"address":{"type":"string","description":"Address that receives the coins you get"},"extraId":{"type":"string","description":"Memo or destination tag for that address, when it needs one"},"noExtraId":{"type":"boolean","description":"Set true when the receiving coin can take a memo but this address does not use one"},"refundAddress":{"type":"string","description":"Optional address on the coin you send, used for an automatic refund"},"refundExtraId":{"type":"string"}}},"Created":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"deposit":{"type":"object","properties":{"coin":{"type":"string"},"address":{"type":"string"},"extraId":{"type":["string","null"]},"extraIdName":{"type":["string","null"]},"amount":{"type":["number","null"]}}},"payout":{"type":"object","properties":{"coin":{"type":"string"},"address":{"type":"string"},"extraId":{"type":["string","null"]},"estimate":{"type":["number","null"]}}},"refundAddress":{"type":["string","null"]},"rateType":{"type":"string"},"statusUrl":{"type":"string"},"api":{"type":"string"}}},"Status":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string","enum":["new","waiting","confirming","exchanging","sending","finished","failed","refunded","verifying","expired"]},"statusText":{"type":"string"},"final":{"type":"boolean"},"from":{"type":"string"},"to":{"type":"string"},"amountSend":{"type":["number","null"]},"amountSendFinal":{"type":"boolean"},"amountReceive":{"type":["number","null"]},"amountReceiveFinal":{"type":"boolean"},"deposit":{"type":"object","properties":{"address":{"type":"string"},"extraId":{"type":["string","null"]},"hash":{"type":["string","null"]},"explorer":{"type":["string","null"]}}},"payout":{"type":"object","properties":{"address":{"type":"string"},"extraId":{"type":["string","null"]},"hash":{"type":["string","null"]},"explorer":{"type":["string","null"]}}},"refundAddress":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"depositReceivedAt":{"type":["string","null"]},"validUntil":{"type":["string","null"]},"statusUrl":{"type":"string"}}}}}}