{"info":{"_postman_id":"2757f478-7c1c-47de-9f58-ace057629478","name":"NOWPayments API for Casinos","description":"<html><head></head><body><p>NOWPayments offers you a unique solution developed and customized specifically for the needs of<br>casinos and the gambling industry in general. Here you can find the workflow and detailed explanation<br>of API requests. If you have any questions/ feedback, feel free to reach out to us at<br><a href=\"mailto:partners@nowpayments.io\">partners@nowpayments.io</a></p>\n<h1 id=\"authentication\">Authentication</h1>\n<p>To use the NOWPayments API you should do the following:</p>\n<ul>\n<li>Sign up at <a href=\"https://nowpayments.io\">nowpayments.io</a></li>\n<li>Specify your outcome wallet</li>\n<li>Generate an API key</li>\n<li>Contact us to whitelist your ip</li>\n</ul>\n<h1 id=\"api-documentation\">API Documentation</h1>\n<h2 id=\"instant-payments-notifications\">Instant Payments Notifications</h2>\n<p>IPN (Instant payment notifications, or callbacks) are used to notify you when transaction status is changed.<br>To use them, you should complete the following steps:</p>\n<ol>\n<li>Generate and save the IPN Secret key in Store Settings tab at the Dashboard.</li>\n<li>Insert your URL address where you want to get callbacks in create_payment request. The parameter name is ipn_callback_url. You will receive payment updates (statuses) to this URL address.</li>\n<li>You will receive all the parameters at the URL address you specified in (2) by POST request.<br> The POST request will contain the <em>x-nowpayments-sig</em> parameter in the header.<br> The body of the request is similiar to a <a href=\"https://documenter.getpostman.com/view/7907941/S1a32n38?version=latest#0b77a8e3-2344-4760-a0bd-247da067db6d\">get payment status</a> response body.</li>\n<li>Sort all the parameters from the POST request in alphabetical order.</li>\n<li>Convert them to string using<br> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\">JSON.stringify</a> (params, Object.keys(params).sort()) or the same function.</li>\n<li>Sign a string with an IPN-secret key with HMAC and sha-512 key</li>\n<li>Compare the signed string from the previous step with the x-nowpayments-sig , which is stored in the header of the callback request.<br> If these strings are similar it is a success.<br> Otherwise, contact us on <a href=\"mailto:support@nowpayments.io\">support@nowpayments.io</a> to solve the problem.</li>\n</ol>\n<p>Example of creating a signed string at Node.JS</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>const hmac = crypto.createHmac('sha512', notificationsKey);\nhmac.update(JSON.stringify(params, Object.keys(params).sort()));\nconst signature = hmac.digest('hex');\n\n</code></pre><p>Example of comparing signed strings in PHP</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>function check_ipn_request_is_valid()\n    {\n        $error_msg = \"Unknown error\";\n        $auth_ok = false;\n        $request_data = null;\n        if (isset($_SERVER['HTTP_X_NOWPAYMENTS_SIG']) &amp;&amp; !empty($_SERVER['HTTP_X_NOWPAYMENTS_SIG'])) {\n            $recived_hmac = $_SERVER['HTTP_X_NOWPAYMENTS_SIG'];\n            $request_json = file_get_contents('php://input');\n            $request_data = json_decode($request_json, true);\n            ksort($request_data);\n            $sorted_request_json = json_encode($request_data);\n            if ($request_json !== false &amp;&amp; !empty($request_json)) {\n                $hmac = hash_hmac(\"sha512\", $sorted_request_json, trim($this-&gt;ipn_secret));\n                if ($hmac == $recived_hmac) {\n                    $auth_ok = true;\n                } else {\n                    $error_msg = 'HMAC signature does not match';\n                }\n            } else {\n                $error_msg = 'Error reading POST data';\n            }\n        } else {\n            $error_msg = 'No HMAC signature sent.';\n        }\n    }\n\n</code></pre><h2 id=\"recommended-flow\">Recommended flow</h2>\n<h3 id=\"users--players-deposit-flow\">User's / Player's deposit flow</h3>\n<ol>\n<li>The initial step is to integrate NP API to receive deposits from users. We recommend to use custody for all services that operates with users' funds. To activate your Custody please Sign In to your account, go to Custody section, fill all the fields, and then request disabling wallet address whitelisting. You can do that by sending an e-mail to <a href=\"mailto:partners@nowpayments.io\">partners@nowpayments.io</a> . In your e-mail you must confirm that you are awared of all risks and want to disable wallet address whitelisting.</li>\n<li>Check out \"Create payment\" request to start receiveing deposits from players to your custody.</li>\n<li>When calling the request, make sure to enter the cryptocurrency in which you want to receive the funds from the user. You should also enter your ipn_callback_url - the address of your server - it will allow us to send you notifications about the payment status.</li>\n<li>In response to this address, you'll get pay_address - this is the constant deposit address where the user should send the money.</li>\n<li>When the user sends the money to this address, it is deposited on your custody. At this step, the automatic conversion takes place. For example, when you only have a USDT wallet in your NOWPayments Personal Account, and the user sends you BTC - NOWPayments performs the conversion and you receive the payment in USDT. Your custody is stored inside the NOWPayments system. You can withdraw the money from your balance at any point upon request.</li>\n</ol>\n<h3 id=\"payouts-flow-payouts-to-users\">Payouts flow (payouts to users)</h3>\n<ol>\n<li>In order to pay the users their rewards, you should use Authentification, Create Payout, Get Payout status, Get balance methods</li>\n<li>First, you need to get a jwt-token usin the Authentification method. jwt-token is needed to validate requests on our side.</li>\n<li>After that, you can view the available balance using the Get balance method. Pending amount - the amount of currency that is currently being processed, that is, in the process of payout.</li>\n<li>To create a payout, use the Create payout method. Enter the address, currency, and amount of currency you want to pay.</li>\n<li>You can monitor the payment status using the method get payout status.</li>\n</ol>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Authentication","slug":"authentication"},{"content":"API Documentation","slug":"api-documentation"}],"owner":"7907941","collectionId":"2757f478-7c1c-47de-9f58-ace057629478","publishedId":"TVmHFfYf","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-11-27T15:07:06.000Z"},"item":[{"name":"Deposits","item":[{"name":"1. Create payment","id":"9c40c9ed-9a2e-4431-be23-cd4060e7c3cc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-api-key","type":"text","value":"<your_key>"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"price_amount\": 3999.5,\n  \"price_currency\": \"usd\",\n  \"pay_amount\": 0.8102725,\n  \"pay_currency\": \"btc\",\n  \"ipn_callback_url\": \"https://nowpayments.io\",\n  \"order_id\": \"RGDBP-21314\",\n  \"order_description\": \"Apple Macbook Pro 2019 x 1\"\n}","options":{"raw":{"language":"json"}}},"url":"https://api.nowpayments.io/v1/payment","description":"<p>This is the method to create a payment. You need to provide your data as a JSON-object payload. Next is a description of the required request fields:</p>\n<ul>\n<li>price_amount (required) - the fiat equivalent of the price to be paid in crypto. If the pay_amount parameter is left empty, our system will automatically convert this fiat price into its crypto equivalent. Please note that this does not enable fiat payments, only provides a fiat price for yours and the customer’s convenience and information.</li>\n<li>price_currency (required) - the fiat currency in which the price_amount is specified (usd, eur, etc).</li>\n<li>pay_amount (optional) - the amount that users have to pay for the order stated in crypto. You can either specify  it yourself,  or we will automatically convert the amount you indicated in price_amount.</li>\n<li>pay_currency (required) - the crypto currency in which the pay_amount is specified (btc, eth, etc).</li>\n<li>ipn_callback_url (optional) - url to receive callbacks, should contain \"http\" or \"https\", eg. \"<a href=\"https://nowpayments.io\">https://nowpayments.io</a>\"</li>\n<li>order_id (optional) - inner store order ID, e.g. \"RGDBP-21314\"</li>\n<li>order_description (optional) - inner store order description, e.g. \"Apple Macbook Pro 2019 x 1\" </li>\n<li>purchase_id (optional) - id of purchase for which you want to create aother payment, only used for several payments for one order</li>\n<li>payout_address (optional) - usually the funds will go to the address you specify in your Personal account. In case you want to receive funds on another address, you can specify it in this parameter.</li>\n<li>payout_currency (optional) - currency of your external payout_address, required when payout_adress is specified.</li>\n<li>payout_extra_id(optional) - extra id or memo or tag for external payout_address.</li>\n</ul>\n<p>Here the list of avalable statuses of payment:</p>\n<ul>\n<li>waiting - waiting for the customer to send the payment. The initial status of each payment.</li>\n<li>confirming - the transaction is being processed on the blockchain. Appears when NOWPayments detect the funds from the user on the blockchain.</li>\n<li>confirmed - the process is confirmed by the blockchain. Customer’s funds have accumulated enough confirmations.</li>\n<li>sending - the funds are being sent to your personal wallet. We are in the process of sending the funds to you.</li>\n<li>partially_paid - it shows that the customer sent the less than the actual price. Appears when the funds have arrived in your wallet.</li>\n<li>finished - the funds have reached your personal address and the payment is finished.</li>\n<li>failed - the payment wasn't completed due to the error of some kind.</li>\n<li>refunded - the funds were refunded back to the user.</li>\n<li>expired - the user didn't send the funds to the specified address in the 24 hour time window.</li>\n</ul>\n","urlObject":{"protocol":"https","path":["v1","payment"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"e5510be8-7a9f-48cc-81b2-eabb5dc8b7a9","name":"4. Create payment","originalRequest":{"method":"POST","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"price_amount\": 3999.5,\n  \"price_currency\": \"usd\",\n  \"pay_amount\": 0.8102725,\n  \"pay_currency\": \"btc\",\n  \"ipn_callback_url\": \"https://nowpayments.io\",\n  \"order_id\": \"RGDBP-21314\",\n  \"order_description\": \"Apple Macbook Pro 2019 x 1\"\n}"},"url":"https://api.nowpayments.io/v1/payment"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 18 Apr 2019 13:39:27 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"344"},{"key":"Connection","value":"keep-alive"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"Strict-Transport-Security","value":"max-age=15768000"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Vary","value":"Origin"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"4c970b7f2d8d9700-FRA"}],"cookie":[],"responseTime":null,"body":"{\n    \"payment_id\": \"<your_payment_id>\",\n    \"payment_status\": \"waiting\",\n    \"pay_address\": \"<your_pay_address>\",\n    \"price_amount\": 3999.5,\n    \"price_currency\": \"usd\",\n    \"pay_amount\": 0.8102725,\n    \"pay_currency\": \"btc\",\n    \"order_id\": \"RGDBP-21314\",\n    \"order_description\": \"Apple Macbook Pro 2019 x 1\",\n    \"ipn_callback_url\": \"https://nowpayments.io\",\n    \"created_at\": \"2019-04-18T13:39:27.982Z\",\n    \"updated_at\": \"2019-04-18T13:39:27.982Z\",\n    \"purchase_id\": \"<your_purchase_id>\"\n}"}],"_postman_id":"9c40c9ed-9a2e-4431-be23-cd4060e7c3cc"},{"name":"2. Get payment status","id":"58c37cec-060d-4c30-9f80-9d34ac3675ef","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"}],"url":"https://api.nowpayments.io/v1/payment/<your_payment_id>","description":"<p>Get the actual information about the payment. You need to provide the ID of the payment in the request.</p>\n<p>NOTE! You should make the get payment status request with the same API key that you used in the create payment request.\nHere is the list of avalable statuses:</p>\n<ul>\n<li>waiting</li>\n<li>confirming</li>\n<li>confirmed</li>\n<li>sending</li>\n<li>partially_paid</li>\n<li>finished</li>\n<li>failed</li>\n<li>refunded</li>\n<li>expired</li>\n</ul>\n","urlObject":{"protocol":"https","path":["v1","payment","<your_payment_id>"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"7eb26f6f-f0dd-4c52-9e21-508e847c3e8f","name":"2. Get payment info (not found)","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"}],"url":"https://api.nowpayments.io/v1/payment/<some_payment_id>"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 18 Apr 2019 22:19:41 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"31"},{"key":"Connection","value":"keep-alive"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"Strict-Transport-Security","value":"max-age=15768000"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Vary","value":"Origin"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"4c9a0590ed36c288-FRA"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Payment not found\"\n}"},{"id":"89211bbd-4f75-4cea-ba3e-b7c757e6b261","name":"2. Get payment info (success)","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"}],"url":"https://api.nowpayments.io/v1/payment/<your_payment_id>"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 18 Apr 2019 13:40:16 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"Strict-Transport-Security","value":"max-age=15768000"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Vary","value":"Origin"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"4c970cb22eaa9700-FRA"},{"key":"Content-Encoding","value":"gzip"}],"cookie":[],"responseTime":null,"body":"{\n    \"payment_id\": \"<your_payment_id>\",\n    \"payment_status\": \"waiting\",\n    \"pay_address\": \"<your_payment_address>\",\n    \"price_amount\": 3999.5,\n    \"price_currency\": \"usd\",\n    \"pay_amount\": 0.8102725,\n    \"actually_paid\": 0.0,\n    \"pay_currency\": \"btc\",\n    \"created_at\": \"2019-04-18T13:39:27.982Z\",\n    \"updated_at\": \"2019-04-18T13:40:16.512Z\",\n    \"purchase_id\": \"<your_purchase_id\",\n    \"outcome_currency\": \"eth\",\n    \"outcome_amount\": 31.28\n}"}],"_postman_id":"58c37cec-060d-4c30-9f80-9d34ac3675ef"},{"name":"3. Get the minimum payment amount","id":"4e9e08d4-2b22-4bce-9e2f-25cac2f74c91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"}],"url":"https://api.nowpayments.io/v1/min-amount?currency_from=eth&currency_to=trx","description":"<p>Get the minimum payment amount for a specific pair.</p>\n<p>You can provide both currencies in the pair or just currency_from, and we will calculate the minimum payment amount for currency_from and currency which you have specified as the outcome in the Store Settings.</p>\n<p>In the case of several outcome wallets we will calculate the minimum amount in the same way we route your payment to a specific wallet.</p>\n","urlObject":{"protocol":"https","path":["v1","min-amount"],"host":["api","nowpayments","io"],"query":[{"key":"currency_from","value":"eth"},{"key":"currency_to","value":"trx"}],"variable":[]}},"response":[{"id":"637ed3dd-4eab-4a3d-b59f-6adb535d2c48","name":"6. Get the minimum payment amount","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"}],"url":{"raw":"https://api.nowpayments.io/v1/min-amount?currency_from=eth&currency_to=trx","protocol":"https","host":["api","nowpayments","io"],"path":["v1","min-amount"],"query":[{"key":"currency_from","value":"eth"},{"key":"currency_to","value":"trx"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 22 Dec 2020 15:05:09 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"Strict-Transport-Security","value":"max-age=15768000"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Vary","value":"Origin"},{"key":"CF-Cache-Status","value":"DYNAMIC"},{"key":"cf-request-id","value":"072c94a16a0000166954256000000001"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Report-To","value":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s=JE3EB5TyT0ppi%2B%2FTPlGcGUDcr2ry9EL%2BhHtpB8%2BYtZMjD087RoOl6UD9284JzS7VANH4ZivF8A7jHMl42n8GLxJL1u7fyKvugNSiViphSjgmGKc%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}"},{"key":"NEL","value":"{\"report_to\":\"cf-nel\",\"max_age\":604800}"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"605abd48af901669-ARN"},{"key":"Content-Encoding","value":"br"}],"cookie":[],"responseTime":null,"body":"{\n    \"currency_from\": \"eth\",\n    \"currency_to\": \"trx\",\n    \"min_amount\": 0.0098927\n}"}],"_postman_id":"4e9e08d4-2b22-4bce-9e2f-25cac2f74c91"}],"id":"fe241ae9-bf86-44a4-93a7-c2a12f3eb2a3","description":"<p>This section contains all methods for incoming payments. These are designed to accept payments from your customers and check payment status\nAll of the payments you receive first come to the system-generated deposit address, and then to your balance.</p>\n","_postman_id":"fe241ae9-bf86-44a4-93a7-c2a12f3eb2a3"},{"name":"Withdrawals","item":[{"name":"1. Authentication","id":"578e8dd8-1610-45d3-aab3-1dfb1bc5638e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"your_email\",\n    \"password\": \"your_password\" \n}","options":{"raw":{"language":"json"}}},"url":"https://api.nowpayments.io/v1/auth","description":"<p>Authentication method for obtaining a JWT token. You should specify your email and password which you are using for signing in into dashboard.\nJWT token will be required for creating a payout request. For security reasons, JWT tokens expire after 5 minutes.</p>\n","urlObject":{"protocol":"https","path":["v1","auth"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"1d4dcab3-b573-4c57-a366-42ef3905eba7","name":"1. Authentication","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"your_email\",\n    \"password\": \"your_password\" \n}","options":{"raw":{"language":"json"}}},"url":"https://api.nowpayments.io/v1/auth"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 13 Nov 2020 17:26:24 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Set-Cookie","value":"__cfduid=d100179a7e095065cf498b0371b423b7d1605288381; expires=Sun, 13-Dec-20 17:26:21 GMT; path=/; domain=.nowpayments.io; HttpOnly; SameSite=Lax"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"Strict-Transport-Security","value":"max-age=15768000"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"Vary","value":"Origin"},{"key":"CF-Cache-Status","value":"DYNAMIC"},{"key":"cf-request-id","value":"06643de5b900000022542c9000000001"},{"key":"Expect-CT","value":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},{"key":"Report-To","value":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report?s=%2BQThCuj3D5DwqKzV%2FPRt15xNxPJ2KeOa0YwY8JeNLCpOzK7WTa%2FAv1csNcLl2Q2ZUnQEt4ITZdXfizJUafHl1f9G3F%2BENJmd%2FOe3NKxoFmN5Cjo%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}"},{"key":"NEL","value":"{\"report_to\":\"cf-nel\",\"max_age\":604800}"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"5f1a3282cac70022-DME"},{"key":"Content-Encoding","value":"br"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU4MjYyNTkxMTUiLCJpYXQiOjE2MDUyODgzODQsImV4cCI6MTYwNTI4ODY4NH0.bk8B5AjoTt8Qfm1zHJxutAtgaTGW-2j67waGQ2DUHUI\"\n}"}],"_postman_id":"578e8dd8-1610-45d3-aab3-1dfb1bc5638e"},{"name":"2. Create payout","id":"bce5fd79-6272-4b80-a451-88309fe88730","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-api-key","type":"text","value":"<your_api_key>"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Authorization","value":"Bearer *your_jwt_token*","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"ipn_callback_url\": \"https://nowpayments.io\",\n    \"withdrawals\": [\n        {\n            \"address\": \"TEmGwPeRTPiLFLVfBxXkSP91yc5GMNQhfS\",\n            \"currency\": \"trx\",\n            \"amount\": 200,\n            \"ipn_callback_url\": \"https://nowpayments.io\"\n        },\n        {\n           \"address\": \"0x1EBAeF7Bee7B3a7B2EEfC72e86593Bf15ED37522\",\n            \"currency\": \"eth\",\n            \"amount\": 0.1 ,\n            \"ipn_callback_url\": \"https://nowpayments.io\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"https://api.nowpayments.io/v1/payout","description":"<p>This is the method to create a payout. You need to provide your data as a JSON-object payload. Next is a description of the required request fields:</p>\n<ul>\n<li>address (required) - the address where you want to send funds</li>\n<li>currency (required) - payout currency</li>\n<li>amount (required) - amount of the payout. Must not exceed 6 decimals (i.e. 0.123456)</li>\n<li>ipn_callback_url(optional) - url to receive callbacks, should contain \"http\" or \"https\", eg. \"<a href=\"https://nowpayments.io\">https://nowpayments.io</a>\". Please note: you can either set ipn_callback_url for each individual payout, or for all payouts in a batch (see example). <strong>In both cases IPNs will be sent for each payout separately.</strong></li>\n</ul>\n<p>Here the list of the available payout statuses:</p>\n<ul>\n<li>waiting</li>\n<li>processing</li>\n<li>sending</li>\n<li>finished</li>\n<li>failed</li>\n<li>rejected</li>\n</ul>\n","urlObject":{"protocol":"https","path":["v1","payout"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"cd048995-ff63-4e36-a509-3706fc150f0c","name":"4. Create payout","originalRequest":{"method":"POST","header":[{"key":"x-api-key","type":"text","value":"<your_api_key>"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Authorization","value":"Bearer *your_jwt_token*","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"ipn_callback_url\": \"https://nowpayments.io\",\n    \"withdrawals\": [\n        {\n            \"address\": \"TEmGwPeRTPiLFLVfBxXkSP91yc5GMNQhfS\",\n            \"currency\": \"trx\",\n            \"amount\": 200,\n            \"ipn_callback_url\": \"https://nowpayments.io\"\n        },\n        {\n           \"address\": \"0x1EBAeF7Bee7B3a7B2EEfC72e86593Bf15ED37522\",\n            \"currency\": \"eth\",\n            \"amount\": 0.1,\n            \"ipn_callback_url\": \"https://nowpayments.io\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"https://api.nowpayments.io/v1/payout"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"5000000000\",\n        \"address\": \"TEmGwPeRTPiLFLVfBxXkSP91yc5GMNQhfS\",\n        \"ipn_callback_url\": \"https://nowpayments.io\",\n        \"currency\": \"trx\",\n        \"amount\": \"200\",\n        \"batchWithdrawalId\": \"5000000000\",\n        \"status\": \"WAITING\",\n        \"extraId\": null,\n        \"hash\": null,\n        \"error\": null,\n        \"createdAt\": \"2020-11-12T17:06:12.791Z\",\n        \"requestedAt\": null,\n        \"updatedAt\": null\n    },\n    {\n        \"id\": \"5000000001\",\n        \"address\": \"0x1EBAeF7Bee7B3a7B2EEfC72e86593Bf15ED37522\",\n        \"currency\": \"eth\",\n        \"ipn_callback_url\": \"https://nowpayments.io\",\n        \"amount\": \"0.1\",\n        \"batchWithdrawalId\": \"5000000000\",\n        \"status\": \"WAITING\",\n        \"extraId\": null,\n        \"hash\": null,\n        \"error\": null,\n        \"createdAt\": \"2020-11-12T17:06:12.791Z\",\n        \"requestedAt\": null,\n        \"updatedAt\": null\n    }\n\n]"}],"_postman_id":"bce5fd79-6272-4b80-a451-88309fe88730"},{"name":"3. Get payout status","id":"cc60f38e-23fa-402e-bc1e-032651cdecc2","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"host":true,"user-agent":true,"accept":true,"accept-encoding":true,"connection":true}},"request":{"method":"GET","header":[{"key":"x-api-key","type":"text","value":"<your_api_key>"}],"body":{"mode":"raw","raw":""},"url":"https://api.nowpayments.io/v1/payout/<payout_id>","description":"<p>Get the actual information about the payuot. You need to provide the ID of the payout in the request.</p>\n<p>NOTE! You should make the get payout status request with the same API key that you used in the creat_payout request.</p>\n<p>Here is the list of avalable statuses:</p>\n<ul>\n<li>init</li>\n<li>sending</li>\n<li>finished</li>\n<li>failed</li>\n</ul>\n","urlObject":{"protocol":"https","path":["v1","payout","<payout_id>"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"646125b3-1e63-499f-9729-15be932adf78","name":"5. Get payout status","originalRequest":{"method":"GET","header":[{"key":"x-api-key","type":"text","value":"<your_api_key>"}],"body":{"mode":"raw","raw":""},"url":"https://api.nowpayments.io/v1/payout/<payout_id>"},"_postman_previewlanguage":null,"header":[],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"<payout_id>\",\n        \"address\": \"<payout_address>\",\n        \"currency\": \"trx\",\n        \"amount\": \"200\",\n        \"batchWithdrawalId\": \"<batchWithdrawalId>\",\n        \"status\": \"WAITING\",\n        \"extraId\": null,\n        \"hash\": null,\n        \"error\": null,\n        \"createdAt\": \"2020-11-12T17:06:12.791Z\",\n        \"requestedAt\": null,\n        \"updatedAt\": null\n    }\n]"}],"_postman_id":"cc60f38e-23fa-402e-bc1e-032651cdecc2"},{"name":"4. Get balance","id":"8fafd7cd-4687-48cb-80f5-5626ada158b9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-api-key","type":"text","value":"<your_api_key>"}],"url":"https://api.nowpayments.io/v1/balance","description":"<p>This method returns your balance in different currencies.</p>\n<p>The response contains a list of currencies with two parameters:</p>\n<ul>\n<li>amount - avaliable currency amount</li>\n<li>pendingAmount - currently processing currency amount.</li>\n</ul>\n","urlObject":{"protocol":"https","path":["v1","balance"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"e6d72531-3a54-4d3a-91d0-6f2602deddf3","name":"6. Get balance(success)","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"<your_api_key>","type":"text"}],"url":"https://api.nowpayments.io/v1/balance"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"eth\": {\n        \"amount\": 0.0001817185463659148,\n        \"pendingAmount\": 0\n    },\n    \"trx\": {\n        \"amount\": 0,\n        \"pendingAmount\": 0\n    },\n    \"xmr\": {\n        \"amount\": 0,\n        \"pendingAmount\": 0\n    }\n}"}],"_postman_id":"8fafd7cd-4687-48cb-80f5-5626ada158b9"},{"name":"5. Validate address","id":"6801e847-2df9-4bcc-a13c-5c938cbf46c4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-api-key","value":"your-api-key","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"address\": \"0g033BbF609Ed876576735a02fa181842319Dd8b8F\", \n    \"currency\": \"eth\", \n    \"extra_id\":null\n}"},"url":"https://api.nowpayments.io/v1/payout/validate-address","description":"<p>This method is required to verify payouts by using your 2FA code.<br />You’ll have 10 attempts to verify the payout. If it is not verified after 10 attempts, the payout will remain in ‘creating’ status.<br />Payout will be processed only when it is verified.</p>\n<p>If you have 2FA app enabled in your dashboard, payouts will accept 2FA code from your app. Otherwise the code for payouts validation will be sent to your registration email.</p>\n<p>Please take a note that unverified payouts will be automatically rejected in an hour after creation.</p>\n<p>Next is a description of the required request fields:</p>\n<ul>\n<li>:batch-withdrawal-id - payout id you received in <code>2. Create payout</code> method;</li>\n<li>verification_code - 2fa code you received with your Google Auth app or via email;</li>\n</ul>\n<p>In order to establish an automatic verification of payouts, you should switch 2FA through the application.<br />There are several libraries for different frameworks aimed on generating a 2FA codes based on a secret key from your account settings, for example, Speakeasy for JavaScript.<br />We do not recommend to change any default settings.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">const 2faVerificationCode = speakeasy.totp({\n      your_2fa_secret_key,\n      encoding: 'base32',\n})\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["v1","payout","validate-address"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"9ec9544e-116d-4a46-9279-5d2a6bfc4689","name":"400","originalRequest":{"method":"POST","header":[{"key":"x-api-key","value":"your-api-key","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"address\": \"0g033BbF609Ed876576735a02fa181842319Dd8b8F\", \n    \"currency\": \"eth\", \n    \"extra_id\":null\n}"},"url":"https://api.nowpayments.io/v1/payout/validate-address"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": false,\n    \"statusCode\": 400,\n    \"code\": \"BAD_CREATE_WITHDRAWAL_REQUEST\",\n    \"message\": \"Invalid payout_address: [currency] [address]\"\n}"}],"_postman_id":"6801e847-2df9-4bcc-a13c-5c938cbf46c4"},{"name":"6. Verify payout","id":"dc0d425d-37b1-40ee-870a-cc3694e393d5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-api-key","value":"{{your_api_key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"verification_code\": \"123456\"\n}","options":{"raw":{"language":"json"}}},"url":"https://api.nowpayments.io/v1/payout/validate-address","urlObject":{"protocol":"https","path":["v1","payout","validate-address"],"host":["api","nowpayments","io"],"query":[],"variable":[]}},"response":[{"id":"d44c867a-3157-4689-af2a-60b3c9d1b172","name":"6. Verify payout","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"{{your_api_key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"verification_code\": \"123456\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{api-host}}/v1/payout/:batch-withdrawal-id/verify","host":["{{api-host}}"],"path":["v1","payout",":batch-withdrawal-id","verify"],"variable":[{"key":"batch-withdrawal-id","value":null}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"OK"}],"_postman_id":"dc0d425d-37b1-40ee-870a-cc3694e393d5"}],"id":"7d852909-30bf-4111-b9fe-edf111853928","description":"<p>This section contains all methods for outgoing payments. Using the funds on your balance, you can create payouts for your users, creating multiple instances with a single method. This section also describes how to fetch the status information of the payout and your current balance.</p>\n<p>This set of methods will allow you to make payouts from your custody to unlimited number of wallets. Fast and secure.</p>\n<p>Recommended payouts requesting flow using API:</p>\n<ul>\n<li>Check if your payout address is valid using <strong>POST Validate address</strong> endpoint;</li>\n<li>If it's valid, create a withdrawal using <strong>POST Create payout</strong> endpoint;</li>\n<li>Verify your payout with 2fa (by default it's mandatory) using <strong>POST Verify payout</strong> endpoint;</li>\n</ul>\n<p><strong>2FA automation:</strong></p>\n<p>Using the API you can automate 2fa by implementing the OTP generation library in your code and set it up in your dashboard. \"Dashboard\" - \"Account settings\" - \"Two step authentification\" - \"Use an app\"</p>\n<p><strong>Save the secret key and set it up in your favorite 2FA application as well, otherwise you won't be able to get access to your dashboard!</strong></p>\n<p><strong>Please note:</strong></p>\n<p>Payouts can be requested only using a whitelisted IP address, and to whitelisted wallet addresses. It's a security measure enabled for each partner account by default.</p>\n<p>You can whitelist both of these anytime dropping a formal request using your registration email to <a href=\"mailto:partners@nowpayments.io\">partners@nowpayments.io</a>.</p>\n<p>For more information about whitelisting you can reach us at <a href=\"mailto:partners@nowpayments.io\">partners@nowpayments.io</a>.</p>\n","event":[{"listen":"prerequest","script":{"id":"52ccb4d0-13c7-4748-abbf-3ff1da0857b6","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"92b06e6f-a811-417e-a9d7-1689b82915ec","type":"text/javascript","exec":[""]}}],"_postman_id":"7d852909-30bf-4111-b9fe-edf111853928"}],"event":[{"listen":"prerequest","script":{"id":"7788cff1-1e21-44ab-8fb8-9b4d5a9bb117","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"eaba9e33-616a-47d4-8847-5a282afec80a","type":"text/javascript","exec":[""]}}]}