{"info":{"_postman_id":"fa5fbc53-8c21-4993-9bf6-24855b73cc5b","name":"Fabriik Markets Trading API Document","description":"<html><head></head><body><h1 id=\"overview\">Overview</h1>\n<p>Welcome to <a href=\"https://fabriik.com/markets\">Fabriik Markets</a> Trading API!\nOur REST API allows our customers to generate quotes, set locked-in price, execute trades and more.</p>\n<p>Please note: to use the REST API make sure service URLs and <em>API key</em> and <em>API secret</em> are properly filled.</p>\n<hr>\n<h1 id=\"production-url\">Production URL</h1>\n<p>Trading API production is hosted at </p>\n<p><code>https://api.trading.fabriik.com</code></p>\n<hr>\n<h1 id=\"authentication\">Authentication</h1>\n<p>For authentication purposes, our API uses an <em>API key</em> in addition to an <em>API secret</em>. The <em>API key</em> will be needed for each private API call and should be included each request header. If you do not have an API key or have problems using your balances and trade limits, please contact your Fabriik wealth manager.</p>\n<p>We use base64 encoded <a href=\"https://en.wikipedia.org/wiki/HMAC\">HMAC</a> SHA384 signature for authentication. The signature is calculated as: </p>\n<p><code>Base64Encode(HmacSHA384(METHOD+PATH+CONTENT_TYPE+NONCE, APISecret))</code></p>\n<p>Once signature is calculated, three headers are expected in those private endpoints:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Headers</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>X-BM-APIKEY</td>\n<td>{{Your Fabriik API Key}}</td>\n</tr>\n<tr>\n<td>X-BM-SIGNATURE</td>\n<td>{{Calculated signature}}</td>\n</tr>\n<tr>\n<td>X-BM-NONCE</td>\n<td>{{Current Epoch time in milliseconds}}</td>\n</tr>\n</tbody>\n</table>\n</div><p>Below is a Java code example on generating and using the HMAC signature for <code>/quotes</code> endpoint or you can find external code examples <a href=\"https://github.com/danharper/hmac-examples\">here</a>.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/*\n * The sample code works with Apache httpcomponents-client 4.5.13\n*/\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.entity.StringEntity;\nimport org.apache.http.impl.client.HttpClientBuilder;\nimport org.apache.http.util.EntityUtils;\n\nimport javax.crypto.Mac;\nimport javax.crypto.spec.SecretKeySpec;\nimport java.io.IOException;\nimport java.security.InvalidKeyException;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic static void main(String[] args) throws IOException, InvalidKeyException, NoSuchAlgorithmException {\n    // Variables apiKey, apiSecret, host need to be predeclared.\n    long nonce = System.currentTimeMillis();\n    String signature = calculateSignature(\"POST\" + \"/quotes\" + \"application/json\" + nonce, apiSecret);\n\n    // Post method\n    String uri = host + \"/quotes\";\n    HttpPost post = new HttpPost(uri);\n    post.addHeader(\"Content-Type\", \"application/json\");\n    post.addHeader(\"X-BM-APIKEY\", apiKey);\n    post.addHeader(\"X-BM-SIGNATURE\", signature);\n    post.addHeader(\"X-BM-NONCE\", String.valueOf(nonce));\n    String requestBody = \"{\\\"from\\\":\\\"BSV\\\", \\\"to\\\":\\\"BTC\\\", \\\"quantityTo\\\":0.001, \\\"expireTime\\\":60}\";\n    // If not entitled to set expireTime\n    // String requestBody = \"{\\\"from\\\":\\\"BSV\\\", \\\"to\\\":\\\"BTC\\\", \\\"quantityTo\\\":0.001}\";\n    post.setEntity(new StringEntity(requestBody));\n    \n    HttpClient httpClient = HttpClientBuilder.create().build();\n    HttpResponse response = httpClient.execute(post);\n    int statusCode = response.getStatusLine().getStatusCode();\n    String result = EntityUtils.toString(response.getEntity());\n}\n\n// Method to calculate signature\nprivate static String calculateSignature(String message, String apiSecret)\n        throws NoSuchAlgorithmException, InvalidKeyException {\n    final String HMAC_SHA_ALGORITHM = \"HmacSHA384\";\n    Mac sha384_HMAC = Mac.getInstance(HMAC_SHA_ALGORITHM);\n    SecretKeySpec keySpec = new SecretKeySpec(apiSecret.getBytes(), HMAC_SHA_ALGORITHM);\n    sha384_HMAC.init(keySpec);\n    return Base64.getEncoder().encodeToString(sha384_HMAC.doFinal(message.getBytes()));\n}\n</code></pre></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Overview","slug":"overview"},{"content":"Production URL","slug":"production-url"},{"content":"Authentication","slug":"authentication"}],"owner":"12680379","collectionId":"fa5fbc53-8c21-4993-9bf6-24855b73cc5b","publishedId":"TzRLkAkC","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-04-30T18:10:24.000Z"},"item":[{"name":"Public","item":[{"name":"trading-pairs","id":"73c2b4ba-feb6-4ab9-ad6e-95dd436457da","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{domain_name}}/trading-pairs","description":"<p>The <strong>trading-pairs</strong> endpoint returns a list of available trading pairs that our service currently supports. If you would like to see additional trading pair supported, please contact your Fabriik wealth manager.</p>\n","urlObject":{"path":["trading-pairs"],"host":["{{domain_name}}"],"query":[],"variable":[]}},"response":[{"id":"8f49a682-24b1-47f8-a55d-5465b4fe157d","name":"SUCCESS","originalRequest":{"method":"GET","header":[],"url":"{{domain_name}}/trading-pairs"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Development/1.0"},{"key":"Date","value":"Wed, 20 Jan 2021 17:21:02 GMT"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"},{"key":"Content-Length","value":"43"}],"cookie":[],"responseTime":null,"body":"[\n    \"BSV_BTC\",\n    \"BTC_USD\",\n    \"ETH_USD\",\n    \"ETH_USDT\",\n    \"BCH_USDT\",\n    \"BSV_USD\",\n    \"USDT_USD\",\n    \"BCH_BTC\",\n    \"BTC_USDT\",\n    \"ETH_BTC\",\n    \"BCH_USD\",\n    \"BSV_USDT\"\n]"}],"_postman_id":"73c2b4ba-feb6-4ab9-ad6e-95dd436457da"},{"name":"currency","id":"299e74ff-ea9a-4954-8cae-7f89bf763767","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{domain_name}}/currency","description":"<p>The <strong>currency</strong> endpoint returns a list of trading currencies that our service currently supports.</p>\n","urlObject":{"path":["currency"],"host":["{{domain_name}}"],"query":[],"variable":[]}},"response":[{"id":"ab70a172-c3bc-4647-9a71-c2821746d378","name":"SUCCESS","originalRequest":{"method":"GET","header":[],"url":"{{domain_name}}/currency"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Development/1.0"},{"key":"Date","value":"Wed, 20 Jan 2021 17:21:31 GMT"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"},{"key":"Content-Length","value":"26"}],"cookie":[],"responseTime":null,"body":"[\n    \"BTC\",\n    \"BSV\",\n    \"BCH\",\n    \"USD\",\n    \"ETH\",\n    \"USDT\"\n]"}],"_postman_id":"299e74ff-ea9a-4954-8cae-7f89bf763767"}],"id":"4266b582-140f-483f-a0f4-b2cd7b54beb9","_postman_id":"4266b582-140f-483f-a0f4-b2cd7b54beb9","description":""},{"name":"Private","item":[{"name":"balances","event":[{"listen":"prerequest","script":{"id":"b82f0034-ef9a-405d-b5eb-430e5c380aad","exec":["var nonce = new Date().getTime();","","console.log(\"nonce is \", nonce);","","pm.environment.set(\"api_nonce\", nonce);","","var secret = pm.environment.get(\"api_secret\");","","var message = \"GET/balancesapplication/json\" + nonce;","","var hash = CryptoJS.HmacSHA384(message, secret);","","var hashInBase64 = hash.toString(CryptoJS.enc.Base64);","","pm.environment.set(\"api_signature\", hashInBase64);"],"type":"text/javascript"}}],"id":"90fb28e0-1d20-4259-ae10-bf2c9bb7e2b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"description":"<p>API Key is provided by Fabriik</p>\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"<p>Calculated based on API Key and API Secret</p>\n","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"<p>System current time epoch time in milliseconds</p>\n","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"url":"{{domain_name}}/balances","description":"<p>The <strong>balances</strong> endpoint provides a list of asset balances on a per client basis. The result is a key-value pair list <em>balanceMap</em>. In each asset balance object:</p>\n<ul>\n<li><code>total</code> indicates total funds for a given asset; it is the sum of available funds, frozen funds and unsettled funds</li>\n<li><code>available</code> indicates the quantity of a given currency that can be quoted and later executed in a trade</li>\n<li><code>frozen</code> indicates the quantity of funds that are currently on hold due to pending trade executions, once trade is fulfilled the frozen amount will become available</li>\n<li><code>unsettled</code> indicates the quantity that is unsettled. A positive value indicates the amount to be sent to Fabriik Markets and a negative value indicates the amount to be received from Fabriik Markets during the settlements.</li>\n</ul>\n","urlObject":{"path":["balances"],"host":["{{domain_name}}"],"query":[{"disabled":true,"description":{"content":"<p>specify the currency of balance, if not set, it will display all</p>\n","type":"text/plain"},"key":"asset","value":"USD"}],"variable":[]}},"response":[{"id":"07049842-f793-4351-b504-de24ba6e7991","name":"SUCCESS_all_currencies","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"description":"API Key is provided by Fabriik\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"Calculated based on api key and api secret","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"System current time epoch time milliseconds","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"url":{"raw":"{{domain_name}}/balances","host":["{{domain_name}}"],"path":["balances"],"query":[{"key":"currency","value":"USD","description":"specify the currency of balance, if not set, it will display all balance","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Development/1.0"},{"key":"Date","value":"Wed, 20 Jan 2021 17:28:40 GMT"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"},{"key":"Content-Length","value":"306"}],"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"test\",\n    \"balanceMap\": {\n        \"BTC\": {\n            \"total\": \"100\",\n            \"available\": \"90\",\n            \"frozen\": \"5\",\n            \"unsettled\": \"5\"\n        },\n        \"BSV\": {\n            \"total\": \"100\",\n            \"available\": \"108\",\n            \"frozen\": \"2\",\n            \"unsettled\": \"-10\"\n        },\n        \"USD\": {\n            \"total\": \"100000\",\n            \"available\": \"100000\",\n            \"frozen\": \"0\",\n            \"unsettled\": \"0\"\n        },\n        \"ETH\": {\n            \"total\": \"2000\",\n            \"available\": \"2000\",\n            \"frozen\": \"0\",\n            \"unsettled\": \"0\"\n        },\n        \"USDT\": {\n            \"total\": \"2000\",\n            \"available\": \"2000\",\n            \"frozen\": \"0\",\n            \"unsettled\": \"0\"\n        }\n    }\n}"},{"id":"96d90691-3369-4c61-874a-704538234bc5","name":"SUCCESS","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"description":"API Key is provided by Fabriik\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"Calculated based on api key and api secret","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"System current time epoch time milliseconds","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"url":{"raw":"{{domain_name}}/balances?currency=USD","host":["{{domain_name}}"],"path":["balances"],"query":[{"key":"currency","value":"USD","description":"specify the currency of balance, if not set, it will display all balance"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Development/1.0"},{"key":"Date","value":"Wed, 20 Jan 2021 17:28:19 GMT"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"},{"key":"Content-Length","value":"89"}],"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"test\",\n    \"balanceMap\": {\n        \"USD\": {\n            \"total\": \"100000\",\n            \"available\": \"100000\",\n            \"frozen\": \"0\",\n            \"unsettled\": \"0\"\n        }\n    }\n}"}],"_postman_id":"90fb28e0-1d20-4259-ae10-bf2c9bb7e2b8"},{"name":"limits","event":[{"listen":"prerequest","script":{"id":"a73533e3-0d63-4f1c-8ad0-7707dcb9bc0c","exec":["var nonce = new Date().getTime();","","console.log(\"nonce is \", nonce);","","pm.environment.set(\"api_nonce\", nonce);","","var secret = pm.environment.get(\"api_secret\");","","var message = \"GET/limitsapplication/json\" + nonce;","","var hash = CryptoJS.HmacSHA384(message, secret);","","var hashInBase64 = hash.toString(CryptoJS.enc.Base64);","","pm.environment.set(\"api_signature\", hashInBase64);"],"type":"text/javascript"}}],"id":"e48c98c9-775d-41be-8cb6-2b0570c48e7e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"description":"<p>API Key is provided by Fabriik</p>\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"<p>Calculated based on API Key and API Secret</p>\n","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"<p>System current time epoch time in milliseconds</p>\n","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"url":"{{domain_name}}/limits","description":"<p>The <strong>limits</strong> endpoint provides a list of trade limits for each asset on a per client basis. For trade limit of each asset:</p>\n<ul>\n<li><code>maxSettlementAmountUSD</code> indicates the maximum trade amount in USD for a given currency within one settlement period</li>\n<li><code>minTradeAmountUSD</code> indicates the minimum trade amount in USD for a given currency per trade</li>\n<li><code>maxTradeAmountUSD</code> indicates the maximum trade amount in USD for a given currency per trade</li>\n</ul>\n","urlObject":{"path":["limits"],"host":["{{domain_name}}"],"query":[{"disabled":true,"description":{"content":"<p>Trade limits for a given asset</p>\n","type":"text/plain"},"key":"asset","value":"BTC"}],"variable":[]}},"response":[{"id":"5638df65-f6dc-4342-b591-32d085c588d2","name":"SUCCESS","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"description":"API Key is provided by Fabriik\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"Calculated based on api key and api secret","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"System current time epoch time milliseconds","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"url":{"raw":"{{domain_name}}/limits?currency=BTC","host":["{{domain_name}}"],"path":["limits"],"query":[{"key":"currency","value":"BTC","description":"Specicy currency of trade limits to retrieve"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Development/1.0"},{"key":"Date","value":"Wed, 20 Jan 2021 17:30:32 GMT"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"},{"key":"Content-Length","value":"91"}],"cookie":[],"responseTime":null,"body":"{\n    \"asset\": \"BTC\",\n    \"maxSettlementAmountUSD\": 300000,\n    \"minTradeAmountUSD\": 10,\n    \"maxTradeAmountUSD\": 30000\n}"}],"_postman_id":"e48c98c9-775d-41be-8cb6-2b0570c48e7e"},{"name":"quotes","event":[{"listen":"prerequest","script":{"id":"cfab9774-5d50-4557-8148-b0bcf1a1ecf0","exec":["var nonce = new Date().getTime();","","pm.environment.set(\"api_nonce\", nonce);","","var secret = pm.environment.get(\"api_secret\");","","var message = \"POST/quotesapplication/json\" + nonce;","","var hash = CryptoJS.HmacSHA384(message, secret);","","var hashInBase64 = hash.toString(CryptoJS.enc.Base64);","","pm.environment.set(\"api_signature\", hashInBase64); "],"type":"text/javascript"}}],"id":"97ec1859-5fe3-44ef-8001-1cc43c270b2d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"description":"<p>API Key is provided by Fabriik</p>\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"<p>Calculated based on api key and api secret</p>\n","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"<p>System current time epoch time milliseconds</p>\n","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"body":{"mode":"raw","raw":"{\r\n    \"from\": \"USDT\",\r\n    \"to\": \"BTC\",\r\n    \"quantityFrom\": \"100\",\r\n    \"expireTime\": \"100\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{domain_name}}/quotes","description":"<p>The <strong>quotes</strong> endpoint provides a quote price for a given <code>from</code> and <code>to</code> currency pair, with either one of <code>quantityFrom</code> or <code>quantityTo</code> specified.</p>\n<p><strong>Example 1 - Sell 1 BTC for USD:</strong></p>\n<p>If you wanted to sell 1 BTC for USD, you would put the following in the request body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"from\": \"BTC\",\n  \"to\": \"USD\",\n  \"quantityFrom\": 1\n}\n</code></pre><p><strong>Example 2 - Sell BTC for 1000 USD:</strong></p>\n<p>If you wanted to sell BTC for 1,000 USD, but didn't know how many BTC to use, you would put the following in the request body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"from\": \"BTC\",\n  \"to\": \"USD\",\n  \"quantityTo\": 1000\n}\n</code></pre><p><strong>Example 3 - Buy BTC with 1000 USD:</strong></p>\n<p>If you wanted to buy BTC with 1,000 USD, you would put the following in the request body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"from\": \"USD\",\n  \"to\": \"BTC\",\n  \"quantityFrom\": 1000\n}\n</code></pre><p><strong>Example 4 - Buy 1 BTC with USD:</strong></p>\n<p>If you wanted to buy 1 BTC with USD, but didn't know how many USD it costs, you would put the following:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"from\": \"USD\",\n  \"to\": \"BTC\",\n  \"quantityTo\": 1\n}\n</code></pre><h3 id=\"locking-in-a-price-with-specified-expiretime\">Locking in a Price with Specified expireTime</h3>\n<p>The above parameters make the minimum list of parameters to use the quotes endpoint. However, to make the quote result executable and lock in a price for a specified amount of time, the attribute of <code>expireTime</code> will need to be set.</p>\n<p>expireTime is an optional parameter that indicates the quote expiry time in seconds with valid values in the range of [0,900]. The longer the expire time is, the higher the baked in fees will be.</p>\n<p>There are three categories of expireTime associated with your API Key, please speak with your Fabriik wealth manager to configure the right category for your usecase:</p>\n<ul>\n<li><strong>Category 1: Not entitled to pass in expireTime</strong></li>\n</ul>\n<p>If your account is not entitled to pass in expireTime, an error of <strong>\"Your account is not allowed to set expiry time, contact administrator for further assistance.\"</strong> will be thrown if you try to pass in that parameter in the request body.</p>\n<ul>\n<li><strong>Category 2: Fixed expireTime</strong></li>\n</ul>\n<p>If your account has default expireTime configured, you don't need to pass in that parameter. If you do so, you will see the same error message as shown in Category 1. </p>\n<ul>\n<li><strong>Category 3: Configurable expireTime</strong></li>\n</ul>\n<p>If your account is configured to adjust expireTime by yourself, you can pass in any value between 0 and 900 seconds, be noticed if 0 expireTime is passed in, the generated quote will expire immediately.</p>\n<p><strong>Example 5 - Sell 1 BTC for USD with specified expireTime:</strong></p>\n<p>If you wanted to sell 1 BTC for USD and want to lock in the quote price for future execution, you would put the following in the request body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"from\": \"BTC\",\n  \"to\": \"USD\",\n  \"quantityFrom\": 1,\n  \"expireTime\": 30\n}\n</code></pre><p>Please be noted, the above quote will expire in 30 seconds, frozen balance and limits will be adjusted upon quote expiry or fulfillment.</p>\n","urlObject":{"path":["quotes"],"host":["{{domain_name}}"],"query":[],"variable":[]}},"response":[{"id":"2fe122c5-26ec-4fe3-9ae6-91ccec85c693","name":"SUCCESS","originalRequest":{"method":"POST","header":[{"description":"API Key is provided by Farbiik\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"Calculated based on api key and api secret","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"System current time epoch time milliseconds","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"from\":\"USD\",\r\n    \"to\":\"BSV\",\r\n    \"quantityFrom\": \"1000\",\r\n    \"expireTime\": \"0\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{domain_name}}/quotes"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.2"},{"key":"Date","value":"Mon, 08 Jun 2020 17:08:54 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"73"},{"key":"Connection","value":"keep-alive"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"quoteID\": \"7lfoRvmdCJ\",\n    \"quotePrice\": \"57904.7043\",\n    \"totalAmount\": \"0.00863488\",\n    \"expireTime\": \"2021-05-05T15:24:47.236Z\"\n}"}],"_postman_id":"97ec1859-5fe3-44ef-8001-1cc43c270b2d"},{"name":"trades","event":[{"listen":"prerequest","script":{"id":"8f1e4406-2d4f-473c-a26d-8faa0d7d2022","exec":["var nonce = new Date().getTime();","","pm.environment.set(\"api_nonce\", nonce);","","var secret = pm.environment.get(\"api_secret\");","","var message = \"POST/tradesapplication/json\" + nonce;","","var hash = CryptoJS.HmacSHA384(message, secret);","","var hashInBase64 = hash.toString(CryptoJS.enc.Base64);","","pm.environment.set(\"api_signature\", hashInBase64); "],"type":"text/javascript"}}],"id":"6231e18c-b752-4d40-a068-5112dd6b521a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"description":"<p>API Key is provided by Fabriik</p>\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"<p>Calculated based on api key and api secret</p>\n","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"<p>System current time epoch time milliseconds</p>\n","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{domain_name}}/trades?quoteID=IRaXTqM5Au","description":"<p>The trades endpoint executes a previously generated quote. </p>\n<p><strong>Note:</strong></p>\n<ul>\n<li>A valid unique quoteID (from quotes response) must exist <em>before</em> executing a trade.</li>\n</ul>\n","urlObject":{"path":["trades"],"host":["{{domain_name}}"],"query":[{"description":{"content":"<p>valid quoteId which is generated from /quotes endpoint</p>\n","type":"text/plain"},"key":"quoteID","value":"IRaXTqM5Au"}],"variable":[]}},"response":[{"id":"0f009732-f13b-4710-942e-60cfd17803ea","name":"SUCCESS","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"description":"API Key is provided by Fabriik\n","key":"X-BM-APIKEY","type":"text","value":"{{api_key}}"},{"description":"Calculated based on api key and api secret","key":"X-BM-SIGNATURE","type":"text","value":"{{api_signature}}"},{"description":"System current time epoch time milliseconds","key":"X-BM-NONCE","type":"text","value":"{{api_nonce}}"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"{{domain_name}}/trades?quoteID=UKPdK1HviG","host":["{{domain_name}}"],"path":["trades"],"query":[{"key":"quoteID","value":"UKPdK1HviG","description":"valid quoteId which client should get from /quotes endpoints"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"tradeId\": \"0Zm5LNSHiO\",\n    \"status\": \"SUCCESS\",\n    \"price\": \"0.01859712179371209\",\n    \"amount\": \"0.99998233\",\n    \"currency\": \"BSV\",\n    \"timestamp\": 1592318920165\n}"}],"_postman_id":"6231e18c-b752-4d40-a068-5112dd6b521a"},{"name":"trade-history","event":[{"listen":"prerequest","script":{"id":"c8958f91-7518-4e78-9bb6-aa0ee97cfc5e","exec":["var nonce = new Date().getTime();","","pm.environment.set(\"api_nonce\", nonce);","","var secret = pm.environment.get(\"api_secret\");","","var message = \"GET/trade-historyapplication/json\" + nonce;","","var hash = CryptoJS.HmacSHA384(message, secret);","","var hashInBase64 = hash.toString(CryptoJS.enc.Base64);","","pm.environment.set(\"api_signature\", hashInBase64); "],"type":"text/javascript"}}],"id":"0d83cd04-7796-4162-a213-68fdf6c29372","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-BM-APIKEY","value":"{{api_key}}","type":"text"},{"key":"X-BM-SIGNATURE","value":"{{api_signature}}","type":"text"},{"key":"X-BM-NONCE","value":"{{api_nonce}}","type":"text"}],"url":"{{domain_name}}/trade-history","description":"<p>The <strong>trade-history</strong> endpoint provides a list of completed trades.</p>\n","urlObject":{"path":["trade-history"],"host":["{{domain_name}}"],"query":[{"disabled":true,"description":{"content":"<p>Number of entries presented in each page, default to 10 if not present</p>\n","type":"text/plain"},"key":"limit","value":"10"},{"disabled":true,"description":{"content":"<p>Page index, default to 1 if not present</p>\n","type":"text/plain"},"key":"page","value":"1"}],"variable":[]}},"response":[{"id":"db6b40c5-788f-448a-a575-92c07fd00a15","name":"SUCCESS","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-BM-APIKEY","value":"{{api_key}}","type":"text"},{"key":"X-BM-SIGNATURE","value":"{{api_signature}}","type":"text"},{"key":"X-BM-NONCE","value":"{{api_nonce}}","type":"text"}],"url":{"raw":"{{domain_name}}/trade-history?page=2&limit=10","host":["{{domain_name}}"],"path":["trade-history"],"query":[{"key":"page","value":"2"},{"key":"limit","value":"10"}]}},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"test\",\n    \"currentPage\": 2,\n    \"pageSize\": 10,\n    \"totalEntries\": 71,\n    \"tradeHistory\": [\n        {\n            \"transactionTime\": \"2021-05-07 17:08:26.693\",\n            \"quoteId\": \"39CBNWeK2v\",\n            \"price\": \"58640.0426\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"100.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"0.00170532\"\n        },\n        {\n            \"transactionTime\": \"2021-05-07 15:00:29.009\",\n            \"quoteId\": \"qqABbA3ix1\",\n            \"price\": \"0.00715366\",\n            \"from\": \"BSV\",\n            \"quantityFrom\": \"1.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"0.00715366\"\n        },\n        {\n            \"transactionTime\": \"2021-05-07 13:57:14.215\",\n            \"quoteId\": \"7GiOFdkAWP\",\n            \"price\": \"0.0071876\",\n            \"from\": \"BSV\",\n            \"quantityFrom\": \"1.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"0.0071876\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 22:51:48.43\",\n            \"quoteId\": \"dfeVdkOrms\",\n            \"price\": \"56530.3244\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.8448E-4\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 20:15:28.395\",\n            \"quoteId\": \"SJiw7jPyPe\",\n            \"price\": \"55949.5226\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.9366E-4\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 19:54:56.365\",\n            \"quoteId\": \"PTVY61Izme\",\n            \"price\": \"56312.382\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.879E-4\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 19:22:28.968\",\n            \"quoteId\": \"GksEauUXyI\",\n            \"price\": \"55633.9045\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.9873E-4\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 19:03:33.966\",\n            \"quoteId\": \"aGAQz1LmSc\",\n            \"price\": \"55959.5215\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.935E-4\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 15:29:54.759\",\n            \"quoteId\": \"yhiunCHSGJ\",\n            \"price\": \"57171.5489\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.7456E-4\"\n        },\n        {\n            \"transactionTime\": \"2021-05-06 13:49:28.894\",\n            \"quoteId\": \"6OSGihHzCv\",\n            \"price\": \"57634.5669\",\n            \"from\": \"USD\",\n            \"quantityFrom\": \"50.0\",\n            \"to\": \"BTC\",\n            \"totalAmount\": \"8.6753E-4\"\n        }\n    ]\n}"}],"_postman_id":"0d83cd04-7796-4162-a213-68fdf6c29372"},{"name":"instant-trades","event":[{"listen":"prerequest","script":{"id":"713e68ec-9a45-4a0d-8052-30ee40aa0c21","exec":["var nonce = new Date().getTime();","","console.log(\"nonce is \", nonce);","","pm.environment.set(\"api_nonce\", nonce);","","var secret = pm.environment.get(\"api_secret\");","","var message = \"POST/instantTradesapplication/json\" + nonce;","","var hash = CryptoJS.HmacSHA384(message, secret);","","var hashInBase64 = hash.toString(CryptoJS.enc.Base64);","","pm.environment.set(\"api_signature\", hashInBase64);"],"type":"text/javascript"}}],"id":"bed059df-9ed3-4b34-a5fe-843d90a9c7a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"description":"<p>API Key is provided by Fabriik</p>\n","key":"X-BM-APIKEY","value":"{{api_key}}"},{"description":"<p>Calculated based on api key and api secret</p>\n","key":"X-BM-SIGNATURE","value":"{{api_signature}}"},{"description":"<p>System current time epoch time milliseconds</p>\n","key":"X-BM-NONCE","value":"{{api_nonce}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"from\": \"EOS\",\n    \"to\": \"USD\",\n    \"quantityFrom\": \"2\"\n}"},"url":"{{domain_name}}/instant-trades","description":"<p>This <strong>instant-trades</strong> endpoint is used for executing instant trades without going through the quote stage.</p>\n","urlObject":{"path":["instant-trades"],"host":["{{domain_name}}"],"query":[],"variable":[]}},"response":[{"id":"edef9e6c-1b6b-455d-83de-5869b1b3465d","name":"SUCCESS","originalRequest":{"method":"POST","header":[{"key":"X-BM-APIKEY","value":"{{api_key}}","description":"API Key is provided by Fabriik\n"},{"key":"X-BM-SIGNATURE","value":"{{api_signature}}","description":"Calculated based on api key and api secret"},{"key":"X-BM-NONCE","value":"{{api_nonce}}","description":"System current time epoch time milliseconds"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"from\": \"EOS\",\n    \"to\": \"USD\",\n    \"quantityFrom\": \"2\"\n}","options":{"raw":{"language":"json"}}},"url":"{{domain_name}}/instant-trades"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Development/1.0"},{"key":"Date","value":"Thu, 27 Aug 2020 13:58:14 GMT"},{"key":"Cache-Control","value":"no-cache"},{"key":"Expires","value":"Mon, 01 Jan 1990 00:00:00 GMT"},{"key":"Content-Length","value":"130"}],"cookie":[],"responseTime":null,"body":"{\n    \"tradeId\": \"CQZoIxVTg8\",\n    \"status\": \"SUCCESS\",\n    \"price\": \"10.0768\",\n    \"amount\": \"20.15\",\n    \"currency\": \"USD\",\n    \"timestamp\": 1620920585073\n}"}],"_postman_id":"bed059df-9ed3-4b34-a5fe-843d90a9c7a1"}],"id":"17bc1292-c6e2-4850-a87f-f6d59334828d","_postman_id":"17bc1292-c6e2-4850-a87f-f6d59334828d","description":""}],"event":[{"listen":"prerequest","script":{"id":"230ada3e-3208-4e15-815a-b8a1799dc366","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"e76a47f7-83cf-4d6e-b78f-901ceafbe220","type":"text/javascript","exec":[""]}}],"variable":[{"key":"HOST_URL","value":"https://api.trading.fabriik.com"}]}