{"collection":{"info":{"_postman_id":"01514099-a2b3-4c6f-b44f-9c650141967b","name":"Create_order_BUY_success","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json","updatedAt":"2023-12-22T08:22:02.000Z","uid":"14729559-01514099-a2b3-4c6f-b44f-9c650141967b","createdAt":"2023-12-21T03:20:53.000Z","lastUpdatedBy":"14729559"},"item":[{"name":"Before_balance","event":[{"listen":"test","script":{"id":"54efc331-80ab-4598-b466-db968bcb6c26","exec":["var jsonData = JSON.parse(responseBody);\r","var arraycoa=jsonData.map(item => {\r"," pm.globals.set(item.coaPath, item.balance);\r","})\r",""],"type":"text/javascript"}}],"id":"8ded1bf6-0691-4931-a375-b41e58864ba2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/getWalletAccountByPaths?cif=test_00010&coaPaths=Cash%3AAsset%3ASGD%3AUpliftedBuy&coaPaths=Cash%3AAsset%3ASGD%3AFees&coaPaths=Global%3ALiability%3ASGD%3AUpliftedUtilized","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","getWalletAccountByPaths"],"query":[{"key":"cif","value":"test_00010"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-8ded1bf6-0691-4931-a375-b41e58864ba2"},{"name":"Before_getTradingLimit","event":[{"listen":"test","script":{"id":"3becdba9-2329-4542-a216-b921981cdd64","exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","\r","\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript"}}],"id":"35adc6ee-5c3c-40e4-8ca7-a179a7c01571","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00010¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00010"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-35adc6ee-5c3c-40e4-8ca7-a179a7c01571"},{"name":"Create_order","event":[{"listen":"test","script":{"id":"bbf065a2-7816-4981-8544-efa41da8654b","exec":["//TC_1: Check status code\r","pm.test(\"status code is 200\", function(){\r"," pm.response.to.have.status(200);\r","});\r","//TC_2:Check message\r","let jsondata=pm.response.json();\r","pm.test(\"Check message response: success\",function(){\r"," pm.expect(jsondata.result).to.eql(\"Success\");\r","});"],"type":"text/javascript"}}],"id":"fa02b99e-53c2-4e0c-9334-b5ed68286bb8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000128\",\r\n \"cif\": \"test_00010\",\r\n \"clordId\": \"ab65r1\",\r\n \"orderSide\": \"BUY\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"STO\",\r\n \"currencyCode\": \"SGD\",\r\n \"orderValidity\": \"DAY\",\r\n \"orderLot\": \"BOARD\",\r\n \"orderType\": \"LIMIT_ORDER\",\r\n \"rewardCode\": \"null\",\r\n \"estimatedNetAmount\": 100,\r\n \"fees\": \"5\",\r\n \"orderDatetime\": \"2023-12-27T16:55:41.864275200\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseUrl}}/internal/order-creation?price={{price}}&fee={{fee}}","host":["{{baseUrl}}"],"path":["internal","order-creation"],"query":[{"key":"price","value":"{{price}}"},{"key":"fee","value":"{{fee}}"}]}},"response":[],"uid":"14729559-fa02b99e-53c2-4e0c-9334-b5ed68286bb8"},{"name":"After_getTradingLimit","event":[{"listen":"test","script":{"id":"98b1734f-ec98-4c5f-bc0b-c2d19fdc0960","exec":["var jsonData = pm.response.json();\r","\r","var newTradingLimit = jsonData.value;\r","\r","var oldTradinglimit = pm.globals.get('tradinglimit');\r","\r","parseInt(pm.globals.get('price'))\r","\r","parseInt(pm.globals.get('fee'))\r","\r","pm.test(\"Difference between new and old trading limit \", function () {\r"," pm.expect(oldTradinglimit - newTradingLimit).to.be.eql(parseInt(pm.globals.get('price')) + parseInt(pm.globals.get('fee')));\r","});\r","\r",""],"type":"text/javascript"}}],"id":"d44c66be-685b-4e24-9a7c-80f79857565a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00010¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00010"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-d44c66be-685b-4e24-9a7c-80f79857565a"},{"name":"after_balance","event":[{"listen":"test","script":{"id":"7cc5c371-6c8f-4d03-8422-35ac06176d23","exec":["var jsonData = pm.response.json();\r","\r","var newFees = jsonData[0].coaPath;\r","var newUpliftedBuy = jsonData[0].coaPath;\r","var newUpliftedUtilized = jsonData[0].coaPath;\r","\r","var oldFee = pm.globals.get('Cash:Asset:SGD:Fees');\r","var oldUpliftedBuy = pm.globals.get('Cash:Asset:SGD:UpliftedBuy');\r","var oldUpliftedUtilized = pm.globals.get('Global:Liability:SGD:UpliftedUtilized');\r","parseInt(pm.globals.get('price'));\r","\r","parseInt(pm.globals.get('fee'));\r","parseInt(pm.globals.get('Cash:Asset:SGD:UpliftedBuy'));\r","\r","parseInt(pm.globals.get('Global:Liability:SGD:UpliftedUtilized'));\r","\r","pm.test(\"Difference between new and old balance \", function () {\r"," pm.expect(parseInt(pm.globals.get(newFees)) - parseInt(pm.globals.get(oldFee))).to.be.eql(parseInt(pm.globals.get('fee')));\r"," pm.expect(parseInt(pm.globals.get(newUpliftedBuy)) - parseInt(pm.globals.get(oldUpliftedBuy))).to.be.eql(parseInt(pm.globals.get('price')));\r"," pm.expect(parseInt(pm.globals.get(newUpliftedUtilized)) - parseInt(pm.globals.get(oldUpliftedUtilized))).to.be.eql(parseInt(pm.globals.get('price')) + parseInt(pm.globals.get('fee')));\r","});"],"type":"text/javascript"}}],"id":"59a20c3c-79e1-45e5-b401-54fe6195cc2e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/getWalletAccountByPaths?cif=test_00010&coaPaths=Cash%3AAsset%3ASGD%3AUpliftedBuy&coaPaths=Cash%3AAsset%3ASGD%3AFees&coaPaths=Global%3ALiability%3ASGD%3AUpliftedUtilized","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","getWalletAccountByPaths"],"query":[{"key":"cif","value":"test_00010"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-59a20c3c-79e1-45e5-b401-54fe6195cc2e"}]}}