{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"77f31fbf-83d3-4060-989c-7ac66cd310a1","name":"SwapSpace API","description":"<h2><b>Authentication</b></h2>\n\n<p><br>To access the SwapSpace API you need to register by the link:<a href=\"https://swapspace.co/affiliate\">https://swapspace.co/affiliate</a>. Our new partners will be permitted to execute a limited number of requests by default. To remove the restriction and get into the white list, leave an application by e-mail <code>partners@swapspace.co</code>. Each API method is to be signed with the API key. In all requests, the API key will be passed to the <code><b>Authorization</b></code> header.<br></p>\n\n<h2><b>Integration Flow</b></h2>\n\n<p><br>1. The first thing to do is to implement the <code><b>List of currencies</b></code> endpoint since it contains the required data about supported currencies that is essential for <code><b>Estimated exchange amounts</b></code> and <code><b>Create new exchange</b></code> endpoints. You can find examples for all the mentioned endpoints in the <code>Example response</code> section.</p>\n\n<p><br>2. Next, implement the <code><b>List of partners</b></code> endpoint that returns data about the partners that provide the exchange options. Without partner data, you can’t use the <code><b>Estimated exchange amounts</b></code> and <code><b>Create new exchange</b></code> endpoints.</p>\n\n<p><br>3. To get the list of current amounts for a specific exchange pair, provided by partners, use the <code><b>Estimated exchange amounts</b></code> endpoint. Note that this endpoint has five required and three optional parameters. If you use only five required parameters, namely <code>fromCurrency</code>, <code>fromNetwork</code>, <code>toCurrency</code>, <code>toNetwork</code>, and <code>amount</code>, you will get the list of all the available amounts for all the partners. Add the <code>partner</code> parameter to get the amounts for a specific partner (max. two amounts: for fixed and floating exchange rates). Adding the parameter <code>fixed</code> with the value <code>true</code> to the request will return the amounts only for fixed rate exchanges. The <code>float</code> parameter behaves the same way as <code>fixed</code>. Pay attention to the <code>min</code> and <code>max</code> fields. You can’t create the exchange in case the value is not in the valid range between <code>min</code> and <code>max</code>. Value <code>0</code> in <code>min</code> or <code>max</code> fields means that there is no such range limit. For some amounts, it returns the value <code>id</code>, which is valid for 2 minutes and is necessary for successful exchange creation.<br></p>\n\n<p><br>4. Next, you need to implement the exchange creation via the <code><b>Create new exchange</b></code> endpoint. All the fields mentioned in body are required.<br>Field <code>extraId</code> is required only if the currency you want to receive has <code>hasExtraId: true</code> property (you get this info via the <code><b>List of currencies</b></code> endpoint). If <code>hasExtraId: false</code>, use empty string in the <code>extraId</code> field. Fill in the <code>rateId</code> field with the <code>id</code> field value of the required amount from the list of amounts of the <code><b>Estimated exchange amounts</b></code> endpoint. If the <code>id</code> field of the <code><b>Estimated exchange amounts</b></code> is empty, fill in <code>rateId</code> with an empty string. Fill in the <code>userIp</code> field with the user’s IP in IPv4 or IPv6 formats. Refund field is required if <code>fixed: true</code> and <code>reqFixedRefund: true</code> for relevant partner and <code>float: true</code> and <code>reqFloatRefund: true</code> for relevant partner (look <code><b>List of partners</b></code> example response). But we strongly recommend that you specify refund when creating an exchange, even if it is not required (if a refund is not required or you cannot specify it, then it is permissible to use a <code>refund: ''</code>).</p>\n\n<p><br>5. Use the <code><b>Exchange status</b></code> endpoint to get the current exchange status. As a request data, use path parameter <code>id</code>, which is to be filled in with exchange <code>id</code> you get with the other data for the successful <code><b>Create new exchange</b></code> request.</p>\n\n<h2><b>Statuses</b></h2>\n\n<ul><li><div>waiting</div></li><li><div>confirming</div></li><li><div>exchanging</div></li><li><div>sending</div></li><li><div>finished</div></li><li><div>failed</div></li><li><div>refunded</div></li><li><div>verifying</div></li><li><div>expired</div></li></ul>\n\n<h2><b>Media</b></h2>\n\nIn order to get access to media files such partner images base url [https://storage.swapspace.co](https://null) should be used to be appended at the start of image path.\n\nFor `icon: '/static/font/src/btc.svg'` icon url is: `'https://storage.swapspace.co/static/font/src/btc.svg'`","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"8222775","team":835459,"collectionId":"77f31fbf-83d3-4060-989c-7ac66cd310a1","publishedId":"SWTABJjo","public":true,"publicUrl":"https://docs.swapspace.co","privateUrl":"https://go.postman.co/documentation/8222775-77f31fbf-83d3-4060-989c-7ac66cd310a1","customColor":{"top-bar":"ffffff","right-sidebar":"36293b","highlight":"e35760"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-09-16T10:03:13.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/4e865b80334f71d4338b369464a7a6face609b1bf86d5fc53a9c2eaf92c22fdc","favicon":"https://swapspace.co/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://docs.swapspace.co/view/metadata/SWTABJjo"}