{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"f11722a3-ca2e-4123-a98b-af115cdb99b0","name":"Knaken API's","description":"## **SETTLE API's**\n\n❗️ Looking for the Settle API docs? The description below is **NOT** for using **SETTLE**. Please click on settle in the left menu and select either `checkout` or `cash`. Both use a different API-header.\n\n---\n\n## **Websocket API**\n\n❗️ Looking for the websocket docs? Visit [https://wsdocs.knaken.eu](https://wsdocs.knaken.eu).\n\n---\n\n## **Knaken Prime API**\n\nTo use the Knaken API, you need a verified Knaken account with an active user subscription that grants access to create API-keys.\n\nAfter you gained access to create API-keys, follow the steps below to create your API-key and API-secret. Also follow our description on how to use these values when requesting our API.\n\n#### 1 - Create Prime API-key and generate API-key header\n\n1. Login to the Knaken Portal, [https://portal.knaken.eu](https://portal.knaken.eu/).\n2. Click on 'Account' in the menu on the left side, then select 'Details'.\n3. Copy your `UUID`. You need this later on in step 7.\n4. Click on 'Account' in the menu on the left side, then select 'Prime API-keys'.\n5. Click on the 'Create new Prime API-key' button.\n6. Give you `API-key` a description and `read` and `write` access. Then click on 'Create' to generate your `API-key` and `API-secret`. Note: you are **not required** to provide an expiration date.\n7. On the screen, you will see your generated `API-key`. Concatenate your earlier copied `UUID` from step 3 with this generated `API-key` with a colon `:` in between, then base64 encode the value. The resulting value is the header value you need to query the Knaken API. So, `base64_encode(\"{uuid}:{api_key}\")`.\n8. Use the header `X-Knaken-Api-Key` with the generated base64-encoded value.\n    \n\n#### 2 - Use API-secret to generate the correct request signature\n\nIn order to request our API, you need to also add a request signature header that you generated yourself based on the actual request you are doing. The header is called `X-Knaken-Api-Signature`. Futhermore, a nonce header `X-Knaken-Api-Nonce` has to be added as well. Follow the steps below.\n\n1. Base64 decode your `API-secret`. We need this value in step 5.\n2. Gather the BODY request parameters and construct a query string. If you have no BODY request parameters, the query string is just empty. Note, exclude the parameters starting with an underscore, like `_filter_by`, e.g.\n3. Hash the nonce together with the query string using SHA-256. Make sure the output is raw binary data and not hexadecimal digits (hexits).\n4. Concatenate the path (without the query string) and hashed query string. We call this variable `data`.\n5. Generate an HMAC using HMAC-SHA512 with the `data` and your base64-decoded `API-secret`. Make sure the output is raw binary data and not hexadecimal digits (hexits).\n6. Base64 encode the generated HMAC to get the signature.\n7. Include the generated signature in the API request, like so: `X-Knaken-Api-Signature`.\n    \n\nExample in PHP on how to generate the request signature for the endpoint `POST /order/buy`:\n\n``` php\n// X-Knaken-Api-Nonce = $nonce\n$time  = explode(' ', microtime());\n$nonce = $time[1] . str_pad(substr($time[0], 2, 6), 6, '0');\n// NOTE: Exclude the parameters starting with an underscore, like `_filter_by` e.g.\n$parameters = [\n    'key'          => '123456', // replace with your key from GET /coin/price\n    'origin'       => 'panel',\n    'currency'     => 'ADA',\n    'redirect_url' => 'https://portal.knaken.eu',\n];\n$apiSecret   = 'MTIzNDU2' // replace with your generated API-secret\n$path        = '/api/order/buy'; // without any querystring\n$queryString = http_build_query($parameters, '', '&');\n$hash        = hash('sha256', $nonce . $queryString, true);\n$data        = $path . $hash;\n// X-Knaken-Api-Signature = signature\n$signature = base64_encode(\n    hash_hmac('sha512', $data, base64_decode($apiSecret, true), true)\n);\n\n ```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"11563561","team":1083127,"collectionId":"f11722a3-ca2e-4123-a98b-af115cdb99b0","publishedId":"2s7ZE7KPWy","public":true,"publicUrl":"https://docs.knaken.eu","privateUrl":"https://go.postman.co/documentation/11563561-f11722a3-ca2e-4123-a98b-af115cdb99b0","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"dark","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.1","publishDate":"2025-02-17T09:46:59.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"production","id":"75509382-35ac-4fc6-a1b9-2eac430439d4","owner":"11563561","values":[{"key":"host","value":"https://api.knaken.eu","enabled":true,"type":"default"},{"key":"client_ip","value":"0.0.0.0","enabled":true,"type":"default"},{"key":"admin_token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5MTUwNmYyMC0zMDIxLTRlYzAtOTkyNC04N2U4MTI3MGNlY2QiLCJqdGkiOiI3MjRjNzY0ODVkMGQyMmE3MzQ1ZjE5YTUwN2RjYmQ3OTU1NzhlN2ZmZjAwNjU1YzUxYzlhZjIwODE2ZDU1ZGExYmE2NGUxNGJhNWE2NTFkOSIsImlhdCI6MTc0MTY4Njg2MC4wMjExMDIsIm5iZiI6MTc0MTY4Njg2MC4wMjExMDQsImV4cCI6NDg5NzM2MDQ2MC4wMDgyNDcsInN1YiI6IjI3NDciLCJzY29wZXMiOltdfQ.hf9znI8QZPymsVhkA-Wh5Q-nzldSYB6zWZJfpQVVI4LJZ4wqaNaOwUTDZioZRqWL3OLhqD0gcFyM92IVAjyhBzzDqW-a6g_L4o35TrdiHBOhY2u4l9kc88LmUUYB634KkSvnavSCtR_i0JG41qeCIy5X_VFEmtLGxSzsRZIxaxJYqdizTdFQI2-C2LxvrwgErRq9tvirg15GiluE4gO8fKt8uqrAfQI_lTQnCYi2t3SOF5uNcQouQNhPApQm2GONyL435lgN8pmyEnuoLyzCudRTqlUj3zD4aSX3L7wabaGgb-uCtTWVF0659hykr-40Vy7OjBx2U3h-j0jMSn144xSclrHDso47zFVSmtNbgMWGfJ3GiicvnU_Nx0Rh2x5MkfmKXdYhLKfpV5JIdNRHiKm5JTUkmLpN0AJlUMmULIqSxyTt3Su7ShZVlUGjy-VR5XoyrXHDvnJRrPREtNm_0NoLPBNcU0YRQsH2I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iXtlO_6A8NwJu-_mg5fAEehtDTgY9c2ZyDi-DW0hyv1BIl3wbJRqEpiSK3kYZ6J9kvhTAEFFLEryAESDLtXO4VrF_m-XiYYAAcUnaH92YuEzvSD_owf_3kZ6IwykRFi_ivFVO7F_NcisX5EnGQShjX24P6GBffNTdhSPANawH5TmA0AtoR1bBs7aNDhwrtWwpCnulGkP8N9g","enabled":true,"type":"default"}],"published":true}],"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/57ed4e07c33c51584d480813ddf47633f932493ae2162e342dd66121ac9bd8f1","favicon":"https://res.cloudinary.com/postman/image/upload/v1599566854/team/cvw98llmj4lht58ppedv.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"},{"label":"production","value":"11563561-75509382-35ac-4fc6-a1b9-2eac430439d4"}],"canonicalUrl":"https://docs.knaken.eu/view/metadata/2s7ZE7KPWy"}