{"componentChunkName":"component---src-templates-md-template-js","path":"/docs/qr","result":{"data":{"markdownRemark":{"html":"<h1 id=\"nets-qr-integration-guide\" style=\"position:relative;\"><a href=\"#nets-qr-integration-guide\" aria-label=\"nets qr integration guide permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>NETS QR Integration Guide</h1>\n<p>Version 1.2</p>\n<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>NETS QR API allows you to collect payment on any smart devices like tablets and mobile phones to through real-time generation of QR codes.</p>\n<p>Examples of NETS QR Online adoption:</p>\n<ul>\n<li>Dine in restaurants- Consumers self-order and make payment on the same device.</li>\n<li>Online shops- Provide QR code as additional payment option for shoppers.</li>\n</ul>\n<h2 id=\"getting-started\" style=\"position:relative;\"><a href=\"#getting-started\" aria-label=\"getting started permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Getting Started</h2>\n<p>Integration with NETS QR is done through RESTful APIs. </p>\n<h3 id=\"requirements\" style=\"position:relative;\"><a href=\"#requirements\" aria-label=\"requirements permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Requirements</h3>\n<p>To start integrating, you need the following:</p>\n<ol>\n<li>API Key<br>\nYou can create an application under <a href=\"/account/application\">\"My Account/Application\"</a></li>\n<li>Secret<br>\nThe secret can be viewed within the application once created under <a href=\"/account/application\">\"My Account/Application\"</a></li>\n<li>Institution Identification Code<br>\nUse 20000000001 for test and live transactions</li>\n<li>\n<p>TID (Terminal ID)</p>\n<blockquote>\n<p>Apply for test ID: Download form and submit to eNETSTS@nets.com.sg<br>\nApply for production ID: Download form and submit to info@nets.com.sg</p>\n</blockquote>\n</li>\n<li>\n<p>MID (Merchant ID)</p>\n<blockquote>\n<p>Apply for test ID: Download form and submit to eNETSTS@nets.com.sg<br>\nApply for production ID: Download form and submit to info@nets.com.sg</p>\n</blockquote>\n</li>\n</ol>\n<h3 id=\"service-environments-api-url\" style=\"position:relative;\"><a href=\"#service-environments-api-url\" aria-label=\"service environments api url permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Service Environments (API URL)</h3>\n<p>NETS provides separate environments for test and live transactions. The gateway URL path is different for each.</p>\n<ul>\n<li>\n<p>SIT (Test Environment) : This environment allows you to test new integrations/code.</p>\n<blockquote>\n<p>https://uat-api.nets.com.sg:9065/sit/merchantservices</p>\n</blockquote>\n</li>\n<li>\n<p>UAT (Test Environment) : This environment allows you to test code to be updated for production.</p>\n<blockquote>\n<p>https://uat-api.nets.com.sg:9065/uat/merchantservices</p>\n</blockquote>\n</li>\n<li>\n<p>Production (Live Environment) : This is the live production environment.</p>\n<blockquote>\n<p>https://api.nets.com.sg/merchantservices</p>\n</blockquote>\n</li>\n</ul>\n<h3 id=\"sample-transaction-request\" style=\"position:relative;\"><a href=\"#sample-transaction-request\" aria-label=\"sample transaction request permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Sample Transaction Request</h3>\n<p>Request header</p>\n<pre><code class=\"language-HTTP\">POST /uat/merchantservices/v1/transaction/request HTTP/1.1\nKeyId: 8bc63cde-2647-4a78-ac75-d5f534b56047\nSign: YEtCdIQpamqAA2Mr3jnOFZ2w/x21jmQi85GMSTH5YNc=\nContent-Type: application/json\n</code></pre>\n<p>A sample request JSON payload as follows : </p>\n<pre><code class=\"language-json\">{\n\"mti\": \"0200\",\n\"process_code\": \"990000\",\n\"amount\": \"000000000100\",\n\"stan\": \"001002\",\n\"transaction_time\": \"084356\", //In hhmmss\n\"transaction_date\": \"0206\", //In MMDD\n\"entry_mode\": \"000\",\n\"condition_code\": \"85\",\n\"institution_code\": \"20000000001\",\n\"retrieval_ref\": \"206026360706\",\n\"host_tid\": \"39067101\",\n\"host_mid\": \"11139067100\",\n\"getQRCode\": \"Y\",\n\"communication_data\": [{\n\"type\": \"https_proxy\",\n\"category\": \"URL\",\n\"destination\": \"https://netspay.uat.net:8801/secapi/notify/dynamic\",\n\"addon\": {\n\"external_API_keyID\": \"8bc63cde-2647-4a78-ac75-d5f534b56047\"\n}\n}],\n\"npx_data\": {\n\"E103\": \"39067101\",\n\"E201\": \"000000000100\",\n\"E202\": \"SGD\"\n},\n\"invoice_ref\": \"2018020602636070\"\n}\n</code></pre>\n<h3 id=\"signature-generation\" style=\"position:relative;\"><a href=\"#signature-generation\" aria-label=\"signature generation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Signature Generation</h3>\n<p>A hashed signature will need to be generated for every request. The hash formula is a 4 operation process.</p>\n<blockquote>\n<ol>\n<li><code>signature = json + secretkey</code> Concatenate payload and secret</li>\n<li><code>signature = sha265(signature)</code> SHA-256 Hash</li>\n<li><code>signature = uppercase(signature)</code> Convert to Uppercase</li>\n<li><code>signature = base64encode(signature)</code> Base64 encode</li>\n</ol>\n</blockquote>\n<p>With the given payload and secret below,</p>\n<pre><code class=\"language-json\">{\"mti\": \"0200\",\"process_code\": \"990000\",\"amount\": \"000000000100\",\"stan\": \"001002\",\"transaction_time\": \"084356\", \"transaction_date\": \"0206\",\"entry_mode\": \"000\",\"condition_code\": \"85\",\"institution_code\": \"20000000001\",\"retrieval_ref\": \"206026360706\",\"host_tid\": \"39067101\",\"host_mid\": \"11139067100\",\"getQRCode\": \"Y\",\"communication_data\": [{\"type\": \"https_proxy\",\"category\": \"URL\",\"destination\": \"https://netspay.uat.net:8801/secapi/notify/dynamic\",\"addon\": {\"external_API_keyID\": \"8bc63cde-2647-4a78-ac75-d5f534b56047\"}}],\"npx_data\": {\"E103\": \"39067101\",\"E201\": \"000000000100\",\"E202\": \"SGD\"},\"invoice_ref\": 2018020602636070\"}\n</code></pre>\n<!-- ```secret\n0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF\n``` -->\n<p>The expected signature should be: </p>\n<pre><code class=\"language-signature\">YEtCdIQpamqAA2Mr3jnOFZ2w/x21jmQi85GMSTH5YNc=\n</code></pre>\n<h2 id=\"api-calls\" style=\"position:relative;\"><a href=\"#api-calls\" aria-label=\"api calls permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>API Calls</h2>\n<h3 id=\"nets-qr-request\" style=\"position:relative;\"><a href=\"#nets-qr-request\" aria-label=\"nets qr request permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>NETS QR Request</h3>\n<p>The NETS QR API initiates a new QR payment transaction.</p>\n<p><img src=\"/assets/2019/02/requestflow.jpg\" alt=\"QR Request\"></p>\n<p>The transaction flow goes as follows : </p>\n<ul>\n<li>1 and 2 The Website/App requests a QR code from the NETS gateway</li>\n<li>3, 4 and 5 NETS gateway will respond with a QR code to be displayed on the Website/App</li>\n<li>6 The consumer will scan the displayed QR and make payment via their mobile.</li>\n<li>7 to 12 NETS gateway will confirm the payment and return the appropriate response for processing</li>\n</ul>\n<p>?> You may query the gateway to confirm the transaction in addition to awaiting the NETS gateway response as well with the following <code>/merchantservices/v1/transaction/query</code></p>\n<h3 id=\"nets-qr-query\" style=\"position:relative;\"><a href=\"#nets-qr-query\" aria-label=\"nets qr query permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>NETS QR Query</h3>\n<p>The NETS QR query API allows you to check the status of the QR transaction and see if it's completed or failed in the event that the NETS gateway does not return any data. The details of the API can be found in the <a href=\"/docs/reference\">reference</a></p>\n<h3 id=\"nets-qr-reversal\" style=\"position:relative;\"><a href=\"#nets-qr-reversal\" aria-label=\"nets qr reversal permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>NETS QR Reversal</h3>\n<p>In certain cases when the server cannot connect to the smart device, a transaction reversal may be initiated. This process is as shown below:</p>\n<p><img src=\"/assets/2019/02/reversal.png\" alt=\"Payment Reversal\"></p>\n<p>This is a 4 stage process:</p>\n<ol>\n<li>(Step 1-5) As per normal payment sequence, i.e. transaction is approved.</li>\n<li>(Step 6) The QR/VT server sends a reversal to NETS host.</li>\n<li>(Step 7) NETS host send the reversal request to the issuing host.</li>\n<li>(Step 8) NETS host informs mobile server of the event.</li>\n</ol>","frontmatter":{"date":"December 17, 2018","path":"/docs/qr","title":"NETS QR","type":"api-guide","section":"qr"}}},"pageContext":{}},"staticQueryHashes":["3649515864"]}