{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"728e2699-bf49-46e1-ae50-45ba4558bcd7","name":"Razer Gold Publisher API 1.1","description":"# Introduction\nRazer Gold Publisher API is the API specification for publisher to follow in order for Razer Gold to integrate to pull voucher or direct topup to user account at publisher side. The same specification is to follow by internally when Razer Gold required to create a intermediate wrapper integrate to publisher's existing API.\n\n# Authentication\nThe API is using `X-Razer-Signature` header to pass credential to authenticate the request. In the response, `X-Razer-Signature` header will also return the signature back to Razer Gold to validate the integrity of the response.\n\n## X-Razer-Signature\n    \n- The credential is combination of `api-id` and `signature` of the request.\n- Both API ID and signature has to encode with base64.\n- Publisher API must return `HTTP status 401` when credential/signature is invalid.\n\n<pre><code>X-Razer-Signature: base64(<b>api-id</b>):base64(<b>signature</b>)\n</code></pre>\n\nSignature formula:<pre><code>hex(hmac-sha256({http_verb}+{relative_uri_include_querystring}, <b>api-key</b>))\n</code></pre>\n\n- Both `api-id` and `api-key` will assign to publisher.\n- The combination of the request’s info will hash with HMAC-SHA256 with the `api-key`.\n- The result of the hash has to present in hexadecimal format.\n- At the end, both `api-id` and the hexadecimal signature have to encode in Base64 in `X-Razer-Signature` header.\n\n\n# HTTP Status Codes\nIn general, response with `HTTP Status 200` indicate transaction/action is success. Other than that, indicate transaction/action is failed.\n\n## 200 Ok\nIndicate a successful transaction request, expecting a json string response body (except health check endpoint) that consists of the correspondence model result.\n\n## 400 Bad Request\nIndicate a failed transaction request, response body must come with a standardize code-message model like example below:\n\n    400 Bad Request\n    x-razer-signature: cHVibGlzaGVyQQ==:YTRkNWJiNDQ1ZTUzNzIwZDA0NTU0ODg1YzI5ZWMzODE2NjZhM2I1MGFiNTZiZTIxMmFjODI4ZjQ3ODI0MjAwZA==\n    { \n       \"code\":\"INVALID_DATA\",\n       \"message\":\"'transactionNumber' is required.\"\n    }\n\nBelow are the standard error codes to follow.\n<table>\n<tr>\n\t<td>Code</td><td>Description</td>\n</tr>\n<tr>\n\t<td><b>FAILED</b></td><td>Undefined failure</td>\n</tr>\n<tr>\n\t<td><b>INVALID_DATA</b></td><td>Invalid/incomplete data</td>\n</tr>\n<tr>\n\t<td><b>INAVLID_SKU</b></td><td>Invalid SKU</td>\n</tr>\n<tr>\n\t<td><b>OOS</b></td><td>Out of stock/service</td>\n</tr>\n<tr>\n\t<td><b>INVALID_ACCT</b></td><td>Invalid account</td>\n</tr>\n<tr>\n\t<td><b>EXCEED_LIMIT</b></td><td>Exceed account limit</td>\n</tr>\n<tr>\n\t<td><b>ORIGIN_NOT_FOUND</b></td><td>Origin transaction not found</td>\n</tr>\n<tr>\n\t<td><b>NOT_ALLOW_CANCEL</b></td><td>Not allow to cancel</td>\n</tr>\n<tr>\n\t<td><b>UNSUPPORTED_COUNTRY</b></td><td>Unsupported country/region</td>\n</tr>\n<tr>\n\t<td><b>INVALID_TRANS_TOKEN</b></td><td>Invalid transaction token</td>\n</tr>\n</table>\n\n## 401 Unauthorized\nIndicate the transaction request’s credential is invalid. \n\n## 404 Not Found\nIndicate the endpoint not implemented or not applicable.\n\n## 408 Request Timeout\nThe response has taken too long to return, where the result is unknown to Razer Gold. Query transaction is needed to determine the transaction has make through or not. \n\n## 409 Conflict\nIndicate the transaction is duplicated.\n\n## 500 Internal Server Error\nIndicate an uncertain failure, more likely an error occurred in the Publisher API, where the result is unknown, query transaction is needed to determine the transaction has make through or not.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"9583627","team":602460,"collectionId":"728e2699-bf49-46e1-ae50-45ba4558bcd7","publishedId":"SzS2xob3","public":true,"publicUrl":"https://documenter-api.postman.tech/view/9583627/SzS2xob3","privateUrl":"https://go.postman.co/documentation/9583627-728e2699-bf49-46e1-ae50-45ba4558bcd7","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","version":"8.10.0","publishDate":"2020-03-16T01:41:26.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"mock","id":"f049b974-278a-46c6-b85c-e405b1af168f","owner":"9583627","values":[{"key":"base-url","value":"https://6499f85f-6aa7-43d9-a8a9-1b8bb238a90d.mock.pstmn.io","enabled":true},{"key":"api-key","value":null,"enabled":true},{"key":"output","value":"POST{{domain}}/transaction/init?a=1{ \r\n   \"transactionNumber\":\"121VKD1KFHP8B6ECD7862\",\r\n   \"sku\":\"DIAMOND50\",\r\n   \"razerId\":\"RZR_0060d83c4d40bb9f10fb00bc0000\",\r\n   \"accountId\":\"123456-12\",\r\n   \"userIpAddress\":\"23.199.128.1\",\r\n   \"userCountryCode\":\"MY\",\r\n   \"customParam\":{ \r\n      \"serverId\":\"MY01\"\r\n   }\r\n}\r\n","enabled":true},{"key":"base64-request-signature","value":"Y2YyMjRhM2Y3ZDk2YzE0OWNhNjNiNmUxZGNjYTVlZDNlYzUyN2IxYmQwYTc5MjE3ZjhlNDBiNDJjNWUwYTM0Yg==","enabled":true},{"key":"api-id","value":"publisherA","enabled":true},{"key":"base64-api-id","value":"dW5kZWZpbmVk","enabled":true}],"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/cd8390dcc9f801d419e810664f98600ac4f00e59d5fc18aaa9f43c690a1bf9cc","favicon":""},"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":"mock","value":"9583627-f049b974-278a-46c6-b85c-e405b1af168f"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/SzS2xob3"}