{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"ed364eb6-d202-4cf4-a3fa-058262afdaab","name":"orbix Trade API","description":"# Introduction\n\nWhat does your API do?\n\n# Overview\n\nThings that the developers should know about\n\nAdd these variables to your `Environment`\n\n- `satang_api_url`\\=`https://www.orbixtrade.com/api`\n    \n- `satang_api_key` - API Key from API Setting.\n    \n- `satang_api_secret` - API Secret you got when creating an API Key.\n    \n\n# Authentication\n\n_Note: Authentication requires both the APIKey and APISecret, if you don't have any of these please generate at_ [API Setting](https://satangcorp.com/exchange/en/settings/api)\n\nAll private endpoint requires the follwing authentication headers.\n\n``` http\nAuthorization: TDAX-API <APIKey>\nSignature: <RequestSignature>\n\n ```\n\nWhere `APIKey` can be retrieved from API Setting. And the signature can be created using the procedure as in the **Signing** section.\n\n## Request Signature (Signing)\n\n1. Concatenate all request parameters into one string\n    \n\nConcatenate all request parameters as a string (this is only from body parameters for POST/DELETE requests, for GET requests, use empty string to sign in the next step) in the format of key1=value1&key2=value2&... where all keys are alphabetical-sorted, for examples:\n\n### Right (alphabetical-sorted)\n\n```\namount=1&nonce=2731832&pair=usdt_thb&price=31&side=buy&type=limit\n\n ```\n\n### Wrong (not alphabetical-sorted)\n\n```\ntype=limit&side=sell&pair=usdt_thb&price=31&amount=1&nonce=2731832\n\n ```\n\n1. Sign with APISecret\n    \n\nAn APISecret can be retrieved from API Setting. Use the APISecret to sign the above string with SHA512 HMAC algorithm, for examples the following string:\n\n```\namount=1&nonce=2731832&pair=usdt_thb&price=31&side=buy&type=limit\n\n ```\n\nAnd the APISecret as `fc8fa6ef2a9e4949bdf72d38208803657659ff67f2a74486a04a64b0bf1f2e6f` would have the correct signature as:\n\n```\n5959460f890d9dad1fe1cdaf73bea955eef8c38da6a0b3139dbbe0d7e5fabfb3d0d3a4786767e759502ebd6d8878ac875441909f3c5232fa842c9349c03988bf\n\n ```\n\n## Sending request\n\nAfter creating the signature in the Signing section, we can now send the request with the complete request headers, for example using the above request parameters and signature:\n\n``` http\nAuthorization: TDAX-API live-2a6c1bd5eb0b4321aaaf26721e997e9f\nSignature: 5959460f890d9dad1fe1cdaf73bea955eef8c38da6a0b3139dbbe0d7e5fabfb3d0d3a4786767e759502ebd6d8878ac875441909f3c5232fa842c9349c03988bf\n\n ```\n\nAssuming the APIKey is `live-2a6c1bd5eb0b4321aaaf26721e997e9f`.\n\n## Security Concerns\n\nAs APISecret is so important for request signing. Please **keep it only in the server where only authorized staffs can get access** and never keep it in the client such as web browser.\n\n## Example Signing Code in Golang\n\n``` golang\npackage main\nimport (\n    \"crypto/hmac\"\n    \"crypto/sha512\"\n    \"fmt\"\n)\nfunc main() {\n    secret := \"fc8fa6ef2a9e4949bdf72d38208803657659ff67f2a74486a04a64b0bf1f2e6f\"\n    payload := \"amount=1&nonce=2731832&pair=usdt_thb&price=31&side=buy&type=limit\"\n    h := hmac.New(sha512.New, []byte(secret))\n    h.Write([]byte(payload))\n    sig := fmt.Sprintf(\"%x\", h.Sum(nil))\n    fmt.Println(sig)\n}\n\n ```\n\nSee it on [Repl.it](https://replit.com/@SupagornWarodom/SatangRequestSignatureGo)\n\n## Example Signing Code in Javascript\n\n``` js\nconst crypto = require(\"crypto\")\nlet api_secret = 'fc8fa6ef2a9e4949bdf72d38208803657659ff67f2a74486a04a64b0bf1f2e6f'\nlet signer = (apiSecret, str) => {\n    let hmac = crypto.createHmac(\"sha512\", apiSecret);\n    let signed = hmac.update(str).digest('hex');\n    return signed;\n}\nlet request_header = 'amount=1&nonce=2731832&pair=usdt_thb&price=31&side=buy&type=limit'\nlet signed = signer(api_secret, request_header)\nconsole.log('signed::',signed)\n\n ```\n\nSee it on [Repl.it](https://replit.com/@SupagornWarodom/SatangRequestSignatureJS#index.js)\n\n## Example Signing Code in Python\n\n``` python\nimport hashlib\nimport hmac\napi_secret = 'fc8fa6ef2a9e4949bdf72d38208803657659ff67f2a74486a04a64b0bf1f2e6f'\nrequest_header= 'amount=1&nonce=2731832&pair=usdt_thb&price=31&side=buy&type=limit'\nsig = hmac.new(\n  bytes(api_secret,encoding='utf-8'),\n  bytes(request_header,encoding='utf-8'),\n  digestmod=hashlib.sha512\n  ).hexdigest()\nprint(sig)\n\n ```\n\nSee it on [Repl.it](https://replit.com/@SupagornWarodom/SatangRequestSignature#main.py)\n\n# SDKs\n\n- [JavaScript](https://bitbucket.org/satangcorpsdk/pro-js-sdk/src/master/)\n    \n- [Golang](https://bitbucket.org/satangcorpsdk/pro-go-sdk/src/master/)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"17936236","team":2648567,"collectionId":"ed364eb6-d202-4cf4-a3fa-058262afdaab","publishedId":"UV5UmKvP","public":true,"publicUrl":"https://docs.orbixtrade.com","privateUrl":"https://go.postman.co/documentation/17936236-ed364eb6-d202-4cf4-a3fa-058262afdaab","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","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.0","publishDate":"2023-11-27T03:57:13.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"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/e236c3abc62504f5867e5cf42f9707a5caac9bce2c182b927af896ec6306609b","favicon":"https://res.cloudinary.com/postman/image/upload/v1701056650/team/u3eclyr56kwxibursuih.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.orbixtrade.com/view/metadata/UV5UmKvP"}