{"collection":{"info":{"_postman_id":"ff33c768-8439-4f2f-b30b-5289195010f1","name":"Testcase","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json","updatedAt":"2024-01-15T04:32:32.000Z","uid":"14729559-ff33c768-8439-4f2f-b30b-5289195010f1","createdAt":"2023-12-28T07:49:58.000Z","lastUpdatedBy":"14729559"},"item":[{"name":"Get_Trade_Order","item":[{"name":"TC_1+2+3+4+5+9","event":[{"listen":"test","script":{"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 mesage response: success\",function(){\r"," pm.response.to.have.status(200);\r","})\r","//TC_3: Check data response is an object\r","pm.test(\"data response is an object\",function(){\r"," pm.expect(jsondata).to.be.an('object');\r","});\r","//TC_5:Check duplicate data\r","const content = pm.response.json().content; // Fixed variable name to avoid redeclaration\r","\r","let orderId = content.map(obj => obj.orderId); // create a new flat array of just the orderId\r","\r","function hasDuplicates(array) {\r"," return (new Set(array)).size !== array.length;\r","}\r","\r","pm.test(\"Check orderId are unique\", () => {\r"," pm.expect(hasDuplicates(orderId)).to.equal(false);\r"," \r","});\r","//TC_4:Count total record\r","var body = pm.response.json();\r","tests[\"Count: \" + body.content.length] = true;\r","\r","//TC_9: Check định dạng dữ liệu trả về\r","var responseData = pm.response.json(); // Changed variable name to avoid redeclaration\r","pm.test(\"Test data type of the response\", () => \r","{\r"," pm.expect(responseData.content[0].id).to.be.a('number');\r"," pm.expect(responseData.content[0].tradeId).to.be.a('string');\r"," pm.expect(responseData.content[0].tan).to.be.a('string');\r"," pm.expect(responseData.content[0].orderId).to.be.a('string');\r"," pm.expect(responseData.content[0].originalOrderId).to.be.a('string');\r"," pm.expect(responseData.content[0].orderType).to.eql(\"LIMIT_ORDER\");\r"," pm.expect(responseData.content[0].lot).to.eql(\"BOARD\");\r"," pm.expect(responseData.content[0].matchedQuantity).to.be.a('number');\r"," pm.expect(responseData.content[0].earmarkedQuantity).to.be.a('number');\r"," pm.expect(responseData.content[0].amendingQuantity).to.be.a('number');\r"," pm.expect(responseData.content[0].earmarkedTotalPrice).to.be.a('number');\r"," pm.expect(responseData.content[0].matchedTotalPrice).to.be.a('number');\r"," pm.expect(responseData.content[0].amendingTotalPrice).to.be.a('number');\r"," pm.expect(responseData.content[0].earmarkedMiscCharged).to.be.a('number');\r"," pm.expect(responseData.content[0].matchedMiscCharged).to.be.a('number');\r"," pm.expect(responseData.content[0].amendingMiscCharged).to.be.a('number');\r"," pm.expect(responseData.content[0].orderAction).to.be.a('string');\r"," pm.expect(responseData.content[0].marketCode).to.be.a('string');\r"," pm.expect(responseData.content[0].stockCode).to.be.a('string');\r"," pm.expect(responseData.content[0].status).to.be.a('string');\r"," pm.expect(responseData.content[0].tradingDate).to.be.a('string');\r"," pm.expect(responseData.content[0].version).to.be.a('number');\r"," pm.expect(responseData.content[0].rewardCode).to.be.a('string');\r","})"],"type":"text/javascript","id":"65c84788-fd85-4d11-a9a8-f29aeaf4efc6"}}],"id":"c388b29a-c52d-48d8-bc49-cefeca527884","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"{{GetTradeOrder}}","host":["{{GetTradeOrder}}"]}},"response":[],"uid":"14729559-c388b29a-c52d-48d8-bc49-cefeca527884"},{"name":"TC_6+7","event":[{"listen":"test","script":{"exec":["//TC_6: Check status\r","pm.test(\"status code is 200\", function(){\r"," pm.response.to.have.status(200)\r","});\r","//TC_7: Check mesage\r","let jsondata = pm.response.json();\r","pm.test(\"List is empty\",function(){\r"," pm.expect(jsondata.content).to.eql([]);\r","})"],"type":"text/javascript","id":"bd9e1a06-a9a1-4a86-9984-444d8f67e3e4"}}],"id":"cbf9c9a3-f100-4e8b-bc91-210e42b66dfe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/internal/trade/orders?tan=CA-0000007hẻhehehe3&pageNumber=0&pageSize=20","host":["{{baseUrl}}"],"path":["internal","trade","orders"],"query":[{"key":"tan","value":"CA-0000007hẻhehehe3"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-cbf9c9a3-f100-4e8b-bc91-210e42b66dfe"},{"name":"TC_8","event":[{"listen":"test","script":{"exec":["pm.test(\"status code is 500\", function(){\r"," pm.response.to.have.status(500);\r","});\r","//Check message\r","let jsondata=pm.response.json();\r","pm.test(\"Check message response: 405 METHOD_NOT_ALLOWED\",function(){\r"," pm.expect(jsondata.messages[0]).to.eql(\"405 METHOD_NOT_ALLOWED \\\"Request method 'PUT' is not supported.\\\"\");\r","});"],"type":"text/javascript","id":"bca345d2-cfb5-400f-b465-28d8025071d3"}}],"id":"1a20edc5-b64e-4541-99f5-180f2647cd0b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":{"raw":"{{baseUrl}}/internal/trade/orders?tan=CA-00000073&pageNumber=0&pageSize=20","host":["{{baseUrl}}"],"path":["internal","trade","orders"],"query":[{"key":"tan","value":"CA-00000073"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-1a20edc5-b64e-4541-99f5-180f2647cd0b"}],"id":"a0987111-ed34-4711-9f70-4bca4dfee2ff","uid":"14729559-a0987111-ed34-4711-9f70-4bca4dfee2ff"},{"name":"CA_1_Cancel_OrderBUY_Status=Created","item":[{"name":"Create_order","event":[{"listen":"test","script":{"id":"ea222794-6b83-41de-85a9-370b04622242","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":"994b47c4-cc8a-467c-bff5-4da28b2ca9cb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"cif\": \"test_00013\",\r\n \"orderType\": \"LIMIT_ORDER\",\r\n \"fees\": 5.0,\r\n \"tradingBoard\": \"\",\r\n \"executedPrice\": 100.0,\r\n \"avgPrice\": 0.0,\r\n \"orderStatus\": \"NEW\",\r\n \"ltpPrice\": 0.0,\r\n \"orderChannel\": \"\",\r\n \"estimatedNetAmt\": 100.0,\r\n \"earmarkflag\": true,\r\n \"expiryDate\": \"\",\r\n \"tradeTerm\": \"\",\r\n \"orderDatetime\": 1703747751541,\r\n \"stockName\": \"\",\r\n \"TimeInForce\": \"DAY\",\r\n \"orderQty\": 10.0,\r\n \"id\": 1,\r\n \"origclordId\": \"\",\r\n \"limitPrice\": 0.0,\r\n \"accountType\": \"\",\r\n \"orderSide\": \"BUY\",\r\n \"stockCode\": \"Z74\",\r\n \"marketState\": \"\",\r\n \"exchangeId\": \"SGX\",\r\n \"transactionType\": \"\",\r\n \"orderLot\": \"BOARD\",\r\n \"stopPrice\": 0.0,\r\n \"productCode\": \"\",\r\n \"marketPhase\": \"\",\r\n \"clordId\": \"CA_1\",\r\n \"exchangeName\": \"\",\r\n \"currencyCode\": \"SGD\",\r\n \"account\": \"CA-00000146\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseUrl}}OrderCreationRequest","host":["{{baseUrl}}OrderCreationRequest"]}},"response":[],"uid":"14729559-994b47c4-cc8a-467c-bff5-4da28b2ca9cb"},{"name":"Before_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript","id":"97f6dcf5-f3c3-4054-8219-7e5cdbeaad60"}}],"id":"27596e20-61ba-4635-880e-9fac9a8732f2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-27596e20-61ba-4635-880e-9fac9a8732f2"},{"name":"CA_1","event":[{"listen":"test","script":{"id":"e25d0686-3f69-46a2-bd80-fd5f23feb435","exec":["//TC_1: Check status code\r","pm.test(\"status code is 200\", function(){\r"," pm.response.to.have.status(200);\r","});\r",""],"type":"text/javascript"}}],"id":"717b4442-d27b-4d33-8b96-18c02ff65c0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"\",\n \"ordStatus\": \"\",\n \"cxlRejResponseTo\": \"\",\n \"clordId\": \"\",\n \"text\": \"\",\n \"origclordId\": \"CA_1\"\n}"},"url":{"raw":"{{baseUrl}}OrderCancelRequest","host":["{{baseUrl}}OrderCancelRequest"]}},"response":[],"uid":"14729559-717b4442-d27b-4d33-8b96-18c02ff65c0a"},{"name":"After_tradingLimit","event":[{"listen":"test","script":{"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 + parseInt(pm.globals.get('price')) + parseInt(pm.globals.get('fee'))).to.be.eql(newTradingLimit);\r","});\r",""],"type":"text/javascript","id":"3000ac23-d8d9-4ee5-99dc-f49e5ace0321"}}],"id":"4d4bb19b-5f00-40ca-a0e6-c7226887ae73","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-4d4bb19b-5f00-40ca-a0e6-c7226887ae73"}],"id":"0d38da2c-76b2-4484-8f19-7fe3f35e1c67","uid":"14729559-0d38da2c-76b2-4484-8f19-7fe3f35e1c67"},{"name":"CA_2_Cancel_OrderSELL_Status=Created","item":[{"name":"Create_order","event":[{"listen":"test","script":{"id":"37e40af3-759d-41ae-8dd1-f9a71a602e12","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":"179976a5-4c4b-4329-b0fd-50b4bdaac2cf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"cif\": \"test_00013\",\n \"orderType\": \"LIMIT_ORDER\",\n \"fees\": 5.0,\n \"tradingBoard\": \"\",\n \"executedPrice\": 100.0,\n \"avgPrice\": 0.0,\n \"orderStatus\": \"NEW\",\n \"ltpPrice\": 0.0,\n \"orderChannel\": \"\",\n \"estimatedNetAmt\": 100.0,\n \"earmarkflag\": true,\n \"expiryDate\": \"\",\n \"tradeTerm\": \"\",\n \"orderDatetime\": 1703747751541,\n \"stockName\": \"\",\n \"TimeInForce\": \"DAY\",\n \"orderQty\": 10.0,\n \"id\": 1,\n \"origclordId\": \"\",\n \"limitPrice\": 0.0,\n \"accountType\": \"\",\n \"orderSide\": \"BUY\",\n \"stockCode\": \"Z74\",\n \"marketState\": \"\",\n \"exchangeId\": \"SGX\",\n \"transactionType\": \"\",\n \"orderLot\": \"BOARD\",\n \"stopPrice\": 0.0,\n \"productCode\": \"\",\n \"marketPhase\": \"\",\n \"clordId\": \"CA_2\",\n \"exchangeName\": \"\",\n \"currencyCode\": \"SGD\",\n \"account\": \"CA-00000146\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/produce-avro-message?avro=OrderCreationRequest","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","produce-avro-message"],"query":[{"key":"avro","value":"OrderCreationRequest"}]}},"response":[],"uid":"14729559-179976a5-4c4b-4329-b0fd-50b4bdaac2cf"},{"name":"Before_Stock","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"stock\", jsonData.value);\r","pm.globals.get (\"stock\");"],"type":"text/javascript","id":"928b4b89-2a79-4208-9f08-5fdddfb20c80"}}],"id":"cfb27fc3-24cc-4f9a-b16c-a0ffd5f9365a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://cash-fo-api.dev.rakutentrade.com/api/v1/bo/stock-account/getStockTradingLimit?tan=CA-00000146&marketCode=SGX&stockCode=Z74","protocol":"https","host":["cash-fo-api","dev","rakutentrade","com"],"path":["api","v1","bo","stock-account","getStockTradingLimit"],"query":[{"key":"tan","value":"CA-00000146"},{"key":"marketCode","value":"SGX"},{"key":"stockCode","value":"Z74"}]}},"response":[],"uid":"14729559-cfb27fc3-24cc-4f9a-b16c-a0ffd5f9365a"},{"name":"Before_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript","id":"69be4c2e-c41f-4279-9dfd-c41096cce003"}}],"id":"4827e5f7-8efb-4169-9256-7a1381701a76","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-4827e5f7-8efb-4169-9256-7a1381701a76"},{"name":"CA_2","event":[{"listen":"test","script":{"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":"def4754d-dc30-4886-93e0-172f874d8e8b"}}],"id":"beb2f9c6-c8b3-4b24-b9da-3b151e0bfa43","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"CA_2\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-cancel","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-cancel"]}},"response":[],"uid":"14729559-beb2f9c6-c8b3-4b24-b9da-3b151e0bfa43"},{"name":"After_tradingLimit","event":[{"listen":"test","script":{"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).to.be.eql(newTradingLimit);\r","});\r",""],"type":"text/javascript","id":"9ff8ab5e-b269-4897-9c89-9f06bc12e903"}}],"id":"9734e881-a0ab-4a1e-a4a4-aacca4c6c233","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-9734e881-a0ab-4a1e-a4a4-aacca4c6c233"},{"name":"After_Stock","event":[{"listen":"test","script":{"exec":["var jsonData = pm.response.json();\r","\r","var newStock = jsonData.value;\r","\r","var oldStock = pm.globals.get('stock');\r","\r","parseInt(pm.globals.get('orderQty'))\r","\r","\r","pm.test(\"Difference between new and old stock \", function () {\r"," pm.expect(parseInt(oldStock) + parseInt(pm.globals.get('orderQty'))).to.be.eql(newStock);\r","});"],"type":"text/javascript","id":"1a721c03-561e-4265-8f4b-ee67c480eac5"}}],"id":"532aabf2-2e10-4d5c-bdc1-138e6e72d322","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://cash-fo-api.dev.rakutentrade.com/api/v1/bo/stock-account/getStockTradingLimit?tan=CA-00000146&marketCode=SGX&stockCode=Z74","protocol":"https","host":["cash-fo-api","dev","rakutentrade","com"],"path":["api","v1","bo","stock-account","getStockTradingLimit"],"query":[{"key":"tan","value":"CA-00000146"},{"key":"marketCode","value":"SGX"},{"key":"stockCode","value":"Z74"}]}},"response":[],"uid":"14729559-532aabf2-2e10-4d5c-bdc1-138e6e72d322"}],"id":"8ef16351-4524-4288-a139-a6a4bc9f1da5","uid":"14729559-8ef16351-4524-4288-a139-a6a4bc9f1da5"},{"name":"CA_3_Cancel_OrderBUY_Status=Matched","item":[{"name":"Create_order","event":[{"listen":"test","script":{"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":"fde9bc42-844b-4047-ac28-fd59ce53a635"}}],"id":"af140a52-7eea-4c36-ac9f-e4f35350f0aa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000146\",\r\n \"cif\": \"test_00013\",\r\n \"clordId\": \"CA_3\",\r\n \"orderSide\": \"BUY\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"Z74\",\r\n \"currencyCode\": \"SGD\",\r\n \"timeInForce\": \"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-26T16: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-af140a52-7eea-4c36-ac9f-e4f35350f0aa"},{"name":"matchOrder","event":[{"listen":"test","script":{"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":"041b2f97-c676-430a-b75e-4086150c380d"}}],"id":"eed49222-ddf8-4e9e-8df6-133c8798b219","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"tan\": \"CA-00000146\",\n \"orderId\": \"CA_3\",\n \"originalOrderId\": \"CA_3\",\n \"matchQuantity\": 5,\n \"avgUnitPrice\": 10,\n \"matchPrice\": 60,\n \"marketCode\": \"SGX\",\n \"stockCode\": \"Z74\",\n \"orderAction\": \"BUY\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-match","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-match"]}},"response":[],"uid":"14729559-eed49222-ddf8-4e9e-8df6-133c8798b219"},{"name":"Before_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript","id":"de47638f-e4ea-4bcf-814b-42b8730fd5d2"}}],"id":"40d3e160-a16f-44fe-b1e7-714ec1bd1248","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-40d3e160-a16f-44fe-b1e7-714ec1bd1248"},{"name":"CA_3","event":[{"listen":"test","script":{"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":"4d8ac720-6a3f-4681-886d-bf4ec136dd55"}}],"id":"b03b6e08-bfb3-4300-aa0d-6aa0487c689e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"CA_3\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-cancel","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-cancel"]}},"response":[],"uid":"14729559-b03b6e08-bfb3-4300-aa0d-6aa0487c689e"},{"name":"After_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = pm.response.json();\r","var newTradingLimit = jsonData.value;\r","var oldTradinglimit = pm.globals.get('tradinglimit');\r","\r","parseInt(pm.globals.get('matchPrice'))\r","parseInt(pm.globals.get('price'))\r","\r","pm.test(\"Difference between new and old trading limit \", function () {\r"," pm.expect(oldTradinglimit + (parseInt(pm.globals.get('price')) - parseInt(pm.globals.get('matchPrice')))).to.be.eql(newTradingLimit);\r","});\r",""],"type":"text/javascript","id":"7a01c475-11e7-424c-8257-1dd7b3f0b0d9"}}],"id":"ec06c6bc-0004-4072-9c6a-f92b4314f280","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-ec06c6bc-0004-4072-9c6a-f92b4314f280"}],"id":"cf15887b-558a-45ed-bfa7-42e9cdc2b5df","uid":"14729559-cf15887b-558a-45ed-bfa7-42e9cdc2b5df"},{"name":"CA_4_Cancel_OrderSELL_Status=Matched","item":[{"name":"Create_order","event":[{"listen":"test","script":{"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":"b38a3210-4c03-45d2-a645-77103d38251b"}}],"id":"0f660b1f-e06e-4e72-8e39-7d7aafc8ad70","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000146\",\r\n \"cif\": \"test_00013\",\r\n \"clordId\": \"CA_4\",\r\n \"orderSide\": \"SELL\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"Z74\",\r\n \"currencyCode\": \"SGD\",\r\n \"timeInForce\": \"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-26T16: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-0f660b1f-e06e-4e72-8e39-7d7aafc8ad70"},{"name":"matchOrder","event":[{"listen":"test","script":{"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":"1c4313c5-4f3c-4920-af2c-7d3547551dd8"}}],"id":"313e1771-8295-4279-bdcf-c60b42352b15","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"tan\": \"CA-00000146\",\n \"orderId\": \"CA_4\",\n \"originalOrderId\": \"CA_4\",\n \"matchQuantity\": 5,\n \"avgUnitPrice\": 10,\n \"matchPrice\": 60,\n \"marketCode\": \"SGX\",\n \"stockCode\": \"Z74\",\n \"orderAction\": \"SELL\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-match","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-match"]}},"response":[],"uid":"14729559-313e1771-8295-4279-bdcf-c60b42352b15"},{"name":"Before_stock","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"stock\", jsonData.value);\r","pm.globals.get (\"stock\");"],"type":"text/javascript","id":"347fb288-f935-444c-b6b5-ddf8b5f97ad6"}}],"id":"826970ee-72f5-4a5d-a55f-b487f83e0370","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://cash-fo-api.dev.rakutentrade.com/api/v1/bo/stock-account/getStockTradingLimit?tan=CA-00000146&marketCode=SGX&stockCode=Z74","protocol":"https","host":["cash-fo-api","dev","rakutentrade","com"],"path":["api","v1","bo","stock-account","getStockTradingLimit"],"query":[{"key":"tan","value":"CA-00000146"},{"key":"marketCode","value":"SGX"},{"key":"stockCode","value":"Z74"}]}},"response":[],"uid":"14729559-826970ee-72f5-4a5d-a55f-b487f83e0370"},{"name":"Before_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript","id":"79bb8238-0617-406b-98e8-82259371493c"}}],"id":"395068c4-9512-4aee-8248-b9c6d4ddf996","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-395068c4-9512-4aee-8248-b9c6d4ddf996"},{"name":"CA_4","event":[{"listen":"test","script":{"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":"5214dc7c-c53d-447b-ad72-224ec256ff39"}}],"id":"dcb5804c-978e-4d4c-abd8-4b60ed616b48","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"CA_4\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-cancel","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-cancel"]}},"response":[],"uid":"14729559-dcb5804c-978e-4d4c-abd8-4b60ed616b48"},{"name":"After_tradingLimit","event":[{"listen":"test","script":{"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('matchPrice'))\r","\r","\r","pm.test(\"Difference between new and old trading limit \", function () {\r"," pm.expect(parseInt(oldTradinglimit) + parseInt(pm.globals.get('matchPrice'))).to.be.eql(newTradingLimit);\r","});\r",""],"type":"text/javascript","id":"e59c0d5a-d6f3-46ef-b0c4-70b86c33f427"}}],"id":"9eee06e1-6238-4eca-bd90-e54ac911611e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-9eee06e1-6238-4eca-bd90-e54ac911611e"},{"name":"After_stock","event":[{"listen":"test","script":{"exec":["var jsonData = pm.response.json();\r","\r","var newStock = jsonData.value;\r","\r","var oldStock = pm.globals.get('stock');\r","\r","parseInt(pm.globals.get('matchQuantityStock'))\r","\r","pm.test(\"Difference between new and old stock \", function () {\r"," pm.expect(parseInt(oldStock) + parseInt(pm.globals.get('matchQuantityStock'))).to.be.eql(newStock);\r","});"],"type":"text/javascript","id":"8874cc87-0dbd-473d-9c59-614196b37d10"}}],"id":"4ff9af33-2e56-4fde-82d7-7f25457dd9d2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://cash-fo-api.dev.rakutentrade.com/api/v1/bo/stock-account/getStockTradingLimit?tan=CA-00000146&marketCode=SGX&stockCode=Z74","protocol":"https","host":["cash-fo-api","dev","rakutentrade","com"],"path":["api","v1","bo","stock-account","getStockTradingLimit"],"query":[{"key":"tan","value":"CA-00000146"},{"key":"marketCode","value":"SGX"},{"key":"stockCode","value":"Z74"}]}},"response":[],"uid":"14729559-4ff9af33-2e56-4fde-82d7-7f25457dd9d2"}],"id":"c8a41de8-3455-458b-8975-182d89c5b25f","uid":"14729559-c8a41de8-3455-458b-8975-182d89c5b25f"},{"name":"CA_5_Cancel_Order_Fail","item":[{"name":"OrderID wrong","event":[{"listen":"test","script":{"exec":["//TC_1: Check status code\r","pm.test(\"status code is 400\", function () {\r"," pm.response.to.have.status(400);\r","});\r","//TC_2:Check result\r","let jsondata = pm.response.json();\r","pm.test(\"Check result response: Failure\", function () {\r"," pm.expect(jsondata.result).to.eql(\"Failure\");\r","});\r","//TC_2:Check reason\r","pm.test(\"Check reason response: Trade order not found!\", function () {\r"," pm.expect(jsondata.reason).to.eql(\"Trade order not found!\");\r","});"],"type":"text/javascript","id":"4c737939-a031-47d9-84c9-22d08396d7d9"}}],"id":"bd372c52-fd8c-4f44-ad38-7346bc437ba1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"egr4wyhgrehwh\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-cancel","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-cancel"]}},"response":[],"uid":"14729559-bd372c52-fd8c-4f44-ad38-7346bc437ba1"}],"id":"afd9a0ca-f009-4ac7-9b6d-297f429ca6b2","uid":"14729559-afd9a0ca-f009-4ac7-9b6d-297f429ca6b2"},{"name":"CA_6_Cancel_Order_BUY_matched full","item":[{"name":"Create_order","event":[{"listen":"test","script":{"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":"df33ff5b-87f8-415c-b212-381eac6601c0"}}],"id":"5909a274-b69a-458f-bb5f-e1c45349e624","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000146\",\r\n \"cif\": \"test_00013\",\r\n \"clordId\": \"CA_6\",\r\n \"orderSide\": \"BUY\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"Z74\",\r\n \"currencyCode\": \"SGD\",\r\n \"timeInForce\": \"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-26T16: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-5909a274-b69a-458f-bb5f-e1c45349e624"},{"name":"matchOrder","event":[{"listen":"test","script":{"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":"b0fe3e14-d522-4731-b4a4-80fae740268e"}}],"id":"00f9f640-257a-4319-85a8-aadccc462e33","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"tan\": \"CA-00000146\",\n \"orderId\": \"CA_6\",\n \"originalOrderId\": \"CA_6\",\n \"matchQuantity\": 10,\n \"avgUnitPrice\": 10,\n \"matchPrice\": 100,\n \"marketCode\": \"SGX\",\n \"stockCode\": \"Z74\",\n \"orderAction\": \"BUY\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-match","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-match"]}},"response":[],"uid":"14729559-00f9f640-257a-4319-85a8-aadccc462e33"},{"name":"Before_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript","id":"3b9ed557-1a71-421e-a1dd-080980426651"}}],"id":"886f6786-df56-463a-9ec4-e57e43c70fb8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-886f6786-df56-463a-9ec4-e57e43c70fb8"},{"name":"CA_6","event":[{"listen":"test","script":{"exec":["//TC_1: Check status code\r","pm.test(\"status code is 400\", function(){\r"," pm.response.to.have.status(400);\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":"3d795b1a-6059-4d1f-a12d-cf19f89054ba"}}],"id":"37c9cfad-fa0d-42aa-a9d7-72ba0d7dba31","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"CA_6\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-cancel","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-cancel"]}},"response":[],"uid":"14729559-37c9cfad-fa0d-42aa-a9d7-72ba0d7dba31"},{"name":"After_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = pm.response.json();\r","var newTradingLimit = jsonData.value;\r","var oldTradinglimit = pm.globals.get('tradinglimit');\r","\r","parseInt(pm.globals.get('matchPrice'))\r","parseInt(pm.globals.get('price'))\r","\r","pm.test(\"Difference between new and old trading limit \", function () {\r"," pm.expect(oldTradinglimit).to.be.eql(newTradingLimit);\r","});\r",""],"type":"text/javascript","id":"7c011a2e-ddaf-44f8-a7b3-c8273ab95260"}}],"id":"7c7758fe-8e53-4cfc-a6e6-bc0bdeffac28","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-7c7758fe-8e53-4cfc-a6e6-bc0bdeffac28"}],"id":"794cf400-2cd5-479e-b215-a80c85590c91","uid":"14729559-794cf400-2cd5-479e-b215-a80c85590c91"},{"name":"CA_7_Cancel_OrderSELL_Matched full","item":[{"name":"Create_order","event":[{"listen":"test","script":{"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":"f65ffb9c-e9da-480c-b064-78fa4a2d4d13"}}],"id":"4e85f3c1-22e1-47e3-a7da-e0db5239d0f2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000146\",\r\n \"cif\": \"test_00013\",\r\n \"clordId\": \"CA_7\",\r\n \"orderSide\": \"SELL\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"Z74\",\r\n \"currencyCode\": \"SGD\",\r\n \"timeInForce\": \"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-26T16: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-4e85f3c1-22e1-47e3-a7da-e0db5239d0f2"},{"name":"matchOrder","event":[{"listen":"test","script":{"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":"50385fdf-cc2e-4bc2-b56f-a37cde60dd29"}}],"id":"5ddc6ea2-36ab-4622-a3e6-1bdc3927431d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"tan\": \"CA-00000146\",\n \"orderId\": \"CA_7\",\n \"originalOrderId\": \"CA_7\",\n \"matchQuantity\": 10,\n \"avgUnitPrice\": 10,\n \"matchPrice\": 100,\n \"marketCode\": \"SGX\",\n \"stockCode\": \"Z74\",\n \"orderAction\": \"SELL\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-match","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-match"]}},"response":[],"uid":"14729559-5ddc6ea2-36ab-4622-a3e6-1bdc3927431d"},{"name":"Before_stock","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"stock\", jsonData.value);\r","pm.globals.get (\"stock\");"],"type":"text/javascript","id":"517f6210-7c80-4f4e-b856-0d26f4d4425f"}}],"id":"1270feb8-4ee5-44f9-8ed0-8b0e33bbe486","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://cash-fo-api.dev.rakutentrade.com/api/v1/bo/stock-account/getStockTradingLimit?tan=CA-00000146&marketCode=SGX&stockCode=Z74","protocol":"https","host":["cash-fo-api","dev","rakutentrade","com"],"path":["api","v1","bo","stock-account","getStockTradingLimit"],"query":[{"key":"tan","value":"CA-00000146"},{"key":"marketCode","value":"SGX"},{"key":"stockCode","value":"Z74"}]}},"response":[],"uid":"14729559-1270feb8-4ee5-44f9-8ed0-8b0e33bbe486"},{"name":"Before_tradingLimit","event":[{"listen":"test","script":{"exec":["var jsonData = JSON.parse(responseBody);\r","pm.globals.set(\"tradinglimit\", jsonData.value);\r","pm.globals.get (\"tradinglimit\");"],"type":"text/javascript","id":"ade1063c-fd8e-4bfd-8c23-d56598b12adf"}}],"id":"89c767ff-5505-48c4-befb-f4f147f61c9d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-89c767ff-5505-48c4-befb-f4f147f61c9d"},{"name":"CA_7","event":[{"listen":"test","script":{"exec":["//TC_1: Check status code\r","pm.test(\"status code is 400\", function(){\r"," pm.response.to.have.status(400);\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":"8fb06ce6-50a4-4270-b8e2-3c7f596ae669"}}],"id":"2e0ed65f-0d11-45b5-8d7d-4533c528fda2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"orderId\": \"CA_7\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-cancel","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-cancel"]}},"response":[],"uid":"14729559-2e0ed65f-0d11-45b5-8d7d-4533c528fda2"},{"name":"After_tradingLimit","event":[{"listen":"test","script":{"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('matchPrice'))\r","\r","\r","pm.test(\"Difference between new and old trading limit \", function () {\r"," pm.expect(parseInt(oldTradinglimit)).to.be.eql(newTradingLimit);\r","});\r",""],"type":"text/javascript","id":"5aa5db6d-4b64-4d83-97a6-8e5ae6c58b03"}}],"id":"786c8dbe-e951-45e7-b667-d1a1d7c160ec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00013¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00013"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-786c8dbe-e951-45e7-b667-d1a1d7c160ec"},{"name":"After_stock","event":[{"listen":"test","script":{"exec":["var jsonData = pm.response.json();\r","\r","var newStock = jsonData.value;\r","\r","var oldStock = pm.globals.get('stock');\r","\r","parseInt(pm.globals.get('matchQuantityStock'))\r","\r","pm.test(\"Difference between new and old stock \", function () {\r"," pm.expect(oldStock).to.be.eql(newStock);\r","});"],"type":"text/javascript","id":"02c0c6e6-307f-40f2-8107-2628cec0b213"}}],"id":"066e3dfa-4500-4963-b178-17d41d1a73a3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://cash-fo-api.dev.rakutentrade.com/api/v1/bo/stock-account/getStockTradingLimit?tan=CA-00000146&marketCode=SGX&stockCode=Z74","protocol":"https","host":["cash-fo-api","dev","rakutentrade","com"],"path":["api","v1","bo","stock-account","getStockTradingLimit"],"query":[{"key":"tan","value":"CA-00000146"},{"key":"marketCode","value":"SGX"},{"key":"stockCode","value":"Z74"}]}},"response":[],"uid":"14729559-066e3dfa-4500-4963-b178-17d41d1a73a3"}],"id":"803db67b-8844-4a23-ae9a-6d4c5cec9ddf","uid":"14729559-803db67b-8844-4a23-ae9a-6d4c5cec9ddf"},{"name":"Create_order_BUY_success","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_00012&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_00012"},{"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_00012¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00012"},{"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-00000130\",\r\n \"cif\": \"test_00012\",\r\n \"clordId\": \"agsssd31\",\r\n \"orderSide\": \"BUY\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"Z74\",\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_00012¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00012"},{"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 newFee = jsonData.filter(obj => obj.coaPath === \"Cash:Asset:SGD:Fees\")[0].balance;\r","var newUpliftedBuy = jsonData.filter(obj => obj.coaPath === \"Cash:Asset:SGD:UpliftedBuy\")[0].balance;\r","var newUpliftedUtilized = jsonData.filter(obj => obj.coaPath === \"Global:Liability:SGD:UpliftedUtilized\")[0].balance;\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(newFee) - parseInt(oldFee)).to.be.eql(parseInt(pm.globals.get('fee')));\r"," pm.expect(parseInt(newUpliftedBuy) - parseInt(oldUpliftedBuy)).to.be.eql(parseInt(pm.globals.get('price')));\r"," pm.expect(parseInt(newUpliftedUtilized) - parseInt(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_00012&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_00012"},{"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"}],"id":"6a6dcc31-464d-4fb1-89cf-0adf7e5df6eb","uid":"14729559-6a6dcc31-464d-4fb1-89cf-0adf7e5df6eb"},{"name":"Create_order_SELL_success","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":"472919b6-fd87-46b7-85a6-20bdae5f8462","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_00012&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_00012"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-472919b6-fd87-46b7-85a6-20bdae5f8462"},{"name":"Before_getTradingLimit","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":"45df99d3-051f-4bb8-bcd8-7f8d830fa31a","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_00012&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_00012"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-45df99d3-051f-4bb8-bcd8-7f8d830fa31a"},{"name":"Before_stock","id":"baceeb20-49e4-46af-a912-72ed93d488c1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[]},"response":[],"uid":"14729559-baceeb20-49e4-46af-a912-72ed93d488c1"},{"name":"Create_order_SELL","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":"c4b8e3c2-5037-44bd-a47e-5f6002b03534","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000130\",\r\n \"cif\": \"test_00012\",\r\n \"clordId\": \"agsssd31\",\r\n \"orderSide\": \"BUY\",\r\n \"orderQty\": 10,\r\n \"exchangeCode\": \"SGX\",\r\n \"stockCode\": \"Z74\",\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-c4b8e3c2-5037-44bd-a47e-5f6002b03534"},{"name":"After_stock","id":"4a26dfb3-f811-4d24-9675-cf0f74d28122","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[]},"response":[],"uid":"14729559-4a26dfb3-f811-4d24-9675-cf0f74d28122"},{"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":"8a5339cd-d34e-476a-b25b-11d08bbc2996","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/calculateTradingLimitValue?cif=test_00012¤cy=SGD","protocol":"https","host":["gcw-bo-api","dev","rakutentrade","com"],"path":["api","v1","bo","wallet","calculateTradingLimitValue"],"query":[{"key":"cif","value":"test_00012"},{"key":"currency","value":"SGD"}]}},"response":[],"uid":"14729559-8a5339cd-d34e-476a-b25b-11d08bbc2996"},{"name":"After_balance","event":[{"listen":"test","script":{"id":"7cc5c371-6c8f-4d03-8422-35ac06176d23","exec":["var jsonData = pm.response.json();\r","\r","var newFee = jsonData.filter(obj => obj.coaPath === \"Cash:Asset:SGD:Fees\")[0].balance;\r","var newUpliftedBuy = jsonData.filter(obj => obj.coaPath === \"Cash:Asset:SGD:UpliftedBuy\")[0].balance;\r","var newUpliftedUtilized = jsonData.filter(obj => obj.coaPath === \"Global:Liability:SGD:UpliftedUtilized\")[0].balance;\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(newFee) - parseInt(oldFee)).to.be.eql(parseInt(pm.globals.get('fee')));\r"," pm.expect(parseInt(newUpliftedBuy) - parseInt(oldUpliftedBuy)).to.be.eql(parseInt(pm.globals.get('price')));\r"," pm.expect(parseInt(newUpliftedUtilized) - parseInt(oldUpliftedUtilized)).to.be.eql(parseInt(pm.globals.get('price')) + parseInt(pm.globals.get('fee')));\r","});"],"type":"text/javascript"}}],"id":"fee285df-4d20-4777-ab40-38b983457f37","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/getWalletAccountByPaths?cif=test_00012&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_00012"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-fee285df-4d20-4777-ab40-38b983457f37"}],"id":"d96e1b93-94cc-4872-a8f0-f051bdbb215b","uid":"14729559-d96e1b93-94cc-4872-a8f0-f051bdbb215b"},{"name":"Free_test","item":[{"name":"TC_28+29","event":[{"listen":"test","script":{"id":"bbf065a2-7816-4981-8544-efa41da8654b","exec":["//TC_23: Check status code\r","pm.test(\"status code is 500\", function(){\r"," pm.response.to.have.status(500);\r","});\r","\r","//TC_24:Check message\r","let jsondata=pm.response.json();\r","pm.test(\"Check messages response: Sai orderAction\",function(){\r"," pm.expect(jsondata.messages[0]).to.eql(\"No enum constant rt.domain.enums.OrderType.Action.SELLrtyeryer\");\r","});"],"type":"text/javascript"}}],"id":"2b7f5135-925c-4df4-bc65-b09995a4b201","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000078\",\r\n \"cif\": \"thaohtt_002\",\r\n \"clordId\": \"156\",\r\n \"orderSide\": \"SELLrtyeryer\",\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\": \"10\",\r\n \"fees\": \"1\",\r\n \"orderDatetime\": \"2023-12-18T16:55:41.864275200\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseUrl}}/internal/order-creation","host":["{{baseUrl}}"],"path":["internal","order-creation"]}},"response":[],"uid":"14729559-2b7f5135-925c-4df4-bc65-b09995a4b201"},{"name":"TC_21+22","event":[{"listen":"test","script":{"id":"11f3e989-f340-42cf-b15b-c68bb9381f8c","exec":["//TC_21: Check status code\r","pm.test(\"status code is 400\", function(){\r"," pm.response.to.have.status(400);\r","});\r","\r","//TC_22:Check message\r","let jsondata=pm.response.json();\r","pm.test(\"Check result response: Failure \",function(){\r"," pm.expect(jsondata.result).to.eql(\"Failure\");\r","});\r","pm.test(\"Check reason response: Insufficient amount of cash\",function(){\r"," pm.expect(jsondata.reason).to.eql(\"Insufficient amount of cash\");\r","});"],"type":"text/javascript"}}],"id":"dae97db6-a8e2-4ada-8313-d330d3af625a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000078\",\r\n \"cif\": \"thaohtt_002\",\r\n \"clordId\": \"125\",\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\": \"10\",\r\n \"fees\": \"1\",\r\n \"orderDatetime\": \"2023-12-18T16:55:41.864275200\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseUrl}}/internal/order-creation","host":["{{baseUrl}}"],"path":["internal","order-creation"]}},"response":[],"uid":"14729559-dae97db6-a8e2-4ada-8313-d330d3af625a"},{"name":"TC_23+24","event":[{"listen":"test","script":{"id":"bbf065a2-7816-4981-8544-efa41da8654b","exec":["//TC_23: Check status code\r","pm.test(\"status code is 400\", function(){\r"," pm.response.to.have.status(400);\r","});\r","\r","//TC_24:Check message\r","let jsondata=pm.response.json();\r","pm.test(\"Check result response: Failure \",function(){\r"," pm.expect(jsondata.result).to.eql(\"Failure\");\r","});\r","pm.test(\"Check reason response: Stock Account COS not found \",function(){\r"," pm.expect(jsondata.reason).to.eql(\"Stock Account COS not found: Cash:Asset:SGX:STO:Stock\");\r","});"],"type":"text/javascript"}}],"id":"57eb39a0-9711-4a12-a300-72ca1ce7ac5d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000079\",\r\n \"cif\": \"thaohtt_003\",\r\n \"clordId\": \"121\",\r\n \"orderSide\": \"SELL\",\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\": \"10\",\r\n \"fees\": \"1\",\r\n \"orderDatetime\": \"2023-12-18T16:55:41.864275200\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseUrl}}/internal/order-creation","host":["{{baseUrl}}"],"path":["internal","order-creation"]}},"response":[],"uid":"14729559-57eb39a0-9711-4a12-a300-72ca1ce7ac5d"},{"name":"TC_26+27","event":[{"listen":"test","script":{"id":"bbf065a2-7816-4981-8544-efa41da8654b","exec":["//TC_23: Check status code\r","pm.test(\"status code is 400\", function(){\r"," pm.response.to.have.status(400);\r","});\r","\r","//TC_24:Check message\r","let jsondata=pm.response.json();\r","pm.test(\"Check result response: Failure \",function(){\r"," pm.expect(jsondata.result).to.eql(\"Failure\");\r","});\r","pm.test(\"Check reason response:value\",function(){\r"," pm.expect(jsondata.reason).to.eql(\"value\");\r","});"],"type":"text/javascript"}}],"id":"d79d2ff8-f6d6-445f-8a76-f255fec8eb7f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n \"accountNo\": \"CA-00000078453543535543\",\r\n \"cif\": \"thaohtt_002\",\r\n \"clordId\": \"155\",\r\n \"orderSide\": \"SELL\",\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\": \"10\",\r\n \"fees\": \"1\",\r\n \"orderDatetime\": \"2023-12-18T16:55:41.864275200\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseUrl}}/internal/order-creation","host":["{{baseUrl}}"],"path":["internal","order-creation"]}},"response":[],"uid":"14729559-d79d2ff8-f6d6-445f-8a76-f255fec8eb7f"}],"id":"d94424ab-8384-4cf1-9457-183a814d9873","uid":"14729559-d94424ab-8384-4cf1-9457-183a814d9873"},{"name":"Create_Product","item":[{"name":"Success","item":[{"name":"Product_account","event":[{"listen":"test","script":{"id":"1bd02327-42ad-4e56-ab07-f939ced09083","exec":["let jsondata = pm.response.json()\r","pm.test(\"List is empty\",function(){\r"," pm.expect(jsondata.content).to.eql([]);\r","})"],"type":"text/javascript"}}],"id":"fe15660f-bd73-4410-833e-1c96b3efffbe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"body":{"mode":"formdata","formdata":[{"key":"","type":"file","value":null,"disabled":true}]},"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/api/v1/customer/product-accounts?cif={{cif}}&pageNumber=0&pageSize=20","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["api","v1","customer","product-accounts"],"query":[{"key":"cif","value":"{{cif}}"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-fe15660f-bd73-4410-833e-1c96b3efffbe"},{"name":"Create_Account","event":[{"listen":"test","script":{"id":"5c7bbb43-0a25-4346-b6e3-1ef59871e21c","exec":["pm.test(\"status code is 200\", function(){\r"," pm.response.to.have.status(200);\r","});"],"type":"text/javascript"}}],"id":"cbbccf26-b0d6-4392-9975-3c30480511b9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"cif\": \"{{cif}}\"\n}"},"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/internal/produce-avro-message?avro=RegistrationCompleted","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["internal","produce-avro-message"],"query":[{"key":"avro","value":"RegistrationCompleted"}]}},"response":[],"uid":"14729559-cbbccf26-b0d6-4392-9975-3c30480511b9"},{"name":"After_Product_account","event":[{"listen":"test","script":{"id":"1bd02327-42ad-4e56-ab07-f939ced09083","exec":["pm.test('Check create product account success', () => {\r"," let cif = pm.response.json().content.find(a => a.cif === pm.variables.get(\"cif\"));\r"," pm.expect(cif.status).to.equal(\"ACTIVE\");\r","});"],"type":"text/javascript"}}],"id":"e1165824-c98a-42a7-b23e-bbeaf4181f87","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/api/v1/customer/product-accounts?cif={{cif}}&pageNumber=0&pageSize=20","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["api","v1","customer","product-accounts"],"query":[{"key":"cif","value":"{{cif}}"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-e1165824-c98a-42a7-b23e-bbeaf4181f87"}],"id":"12022d51-1e8b-48d7-8148-efa774cebbe4","uid":"14729559-12022d51-1e8b-48d7-8148-efa774cebbe4"},{"name":"Fail","item":[{"name":"Product_account","event":[{"listen":"test","script":{"id":"1bd02327-42ad-4e56-ab07-f939ced09083","exec":["let jsondata = pm.response.json()\r","pm.test(\"List does not exist yet CIF\",function(){\r"," pm.expect(jsondata.content).to.eql([]);\r","})"],"type":"text/javascript"}}],"id":"0f317fd8-46f5-4ae4-a668-a16be38d6ae5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/api/v1/customer/product-accounts?cif={{cif}}&pageNumber=0&pageSize=20","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["api","v1","customer","product-accounts"],"query":[{"key":"cif","value":"{{cif}}"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-0f317fd8-46f5-4ae4-a668-a16be38d6ae5"},{"name":"Create_Account","event":[{"listen":"test","script":{"id":"5c7bbb43-0a25-4346-b6e3-1ef59871e21c","exec":["pm.test(\"status code is 200\", function(){\r"," pm.response.to.have.status(200);\r","});"],"type":"text/javascript"}}],"id":"f5dc985f-6bbd-4c14-afdf-57b779e725b9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"cif\": \"{{cif}}\"\n}"},"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/internal/produce-avro-message?avro=RegistrationCompleted","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["internal","produce-avro-message"],"query":[{"key":"avro","value":"RegistrationCompleted"}]}},"response":[],"uid":"14729559-f5dc985f-6bbd-4c14-afdf-57b779e725b9"},{"name":"After_Product_account","event":[{"listen":"test","script":{"id":"1bd02327-42ad-4e56-ab07-f939ced09083","exec":["let jsondata = pm.response.json()\r","pm.test(\"Create CIF account failed\",function(){\r"," pm.expect(jsondata.content).to.eql([]);\r","})"],"type":"text/javascript"}}],"id":"31f3676f-14ef-4309-b9f2-56a8b8032977","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/api/v1/customer/product-accounts?cif=test invest &pageNumber=0&pageSize=20","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["api","v1","customer","product-accounts"],"query":[{"key":"cif","value":"test invest "},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-31f3676f-14ef-4309-b9f2-56a8b8032977"}],"id":"9882c092-2b4b-47e6-a7ee-2711ed8462e0","uid":"14729559-9882c092-2b4b-47e6-a7ee-2711ed8462e0"},{"name":"Fail_exist CIF","item":[{"name":"Product_account","event":[{"listen":"test","script":{"id":"1bd02327-42ad-4e56-ab07-f939ced09083","exec":["let jsondata = pm.response.json()\r","pm.test(\"CIF already exists\",function(){\r"," let cif = pm.response.json().content.find(a => a.cif === 'check777888');\r"," pm.expect(cif.tan).to.equal(\"CO-00000033\");\r","})"],"type":"text/javascript"}}],"id":"0a14815f-51a8-4ace-96dc-0dd35f4e799d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/api/v1/customer/product-accounts?cif=check777888&pageNumber=0&pageSize=20","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["api","v1","customer","product-accounts"],"query":[{"key":"cif","value":"check777888"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-0a14815f-51a8-4ace-96dc-0dd35f4e799d"},{"name":"Create_Account","event":[{"listen":"test","script":{"id":"5c7bbb43-0a25-4346-b6e3-1ef59871e21c","exec":["pm.test(\"status code is 200\", function(){\r"," pm.response.to.have.status(200);\r","});"],"type":"text/javascript"}}],"id":"5cffcb70-1d8c-4bc7-b129-696678184319","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"cif\": \"check777888\"\n}"},"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/internal/produce-avro-message?avro=RegistrationCompleted","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["internal","produce-avro-message"],"query":[{"key":"avro","value":"RegistrationCompleted"}]}},"response":[],"uid":"14729559-5cffcb70-1d8c-4bc7-b129-696678184319"},{"name":"After_Product_account","event":[{"listen":"test","script":{"id":"1bd02327-42ad-4e56-ab07-f939ced09083","exec":["pm.test('Cannot create an existing account', () => {\r"," let cif = pm.response.json().content.find(a => a.cif === 'check777888');\r"," pm.expect(cif.tan).to.equal(\"CO-00000033\");\r","});"],"type":"text/javascript"}}],"id":"c3866fc3-efdb-4bb4-9cd6-e138891d7c23","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"url":{"raw":"https://contra-bo-api.dev.rakutentrade.com/api/v1/customer/product-accounts?cif=check777888&pageNumber=0&pageSize=20","protocol":"https","host":["contra-bo-api","dev","rakutentrade","com"],"path":["api","v1","customer","product-accounts"],"query":[{"key":"cif","value":"check777888"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-c3866fc3-efdb-4bb4-9cd6-e138891d7c23"}],"id":"9b51d4af-831d-401d-a0bc-bd78fdbfba9a","uid":"14729559-9b51d4af-831d-401d-a0bc-bd78fdbfba9a"}],"id":"558a67b9-074f-456c-a4e7-c8cf2acd7e78","uid":"14729559-558a67b9-074f-456c-a4e7-c8cf2acd7e78"},{"name":"Order_Match_BUY","item":[{"name":"before_trade_order","event":[{"listen":"test","script":{"id":"c9d9e2da-a329-499d-9d99-48bcd164dbb4","exec":["pm.test('Check status: CREATED', () => {\r"," let orderId = pm.response.json().content.find(a => a.orderId === '133');\r"," pm.expect(orderId.status).to.equal(\"CREATED\");\r","});\r","\r",""],"type":"text/javascript"}}],"id":"f77045fc-6502-4f78-ba51-13c75a1301f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/trade/orders?tan=CA-00000073&pageNumber=0&pageSize=20","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","trade","orders"],"query":[{"key":"tan","value":"CA-00000073"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-f77045fc-6502-4f78-ba51-13c75a1301f4"},{"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":"19aa45df-079e-4ee6-af9d-8bd58d276b04","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"application/json"}],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/getWalletAccountByPaths?cif=thaohtt_001&coaPaths=Cash%3AAsset%3ASGD%3AUpliftedBuyMatched&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":"thaohtt_001"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuyMatched"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-19aa45df-079e-4ee6-af9d-8bd58d276b04"},{"name":"matchOrder","event":[{"listen":"test","script":{"id":"87005a13-4aee-4234-9833-4ed17ba48d82","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":"e37cffc8-78f6-4882-9247-92064a1805ca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"accept","value":"*/*"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"tan\": \"string\",\n \"orderId\": \"string\",\n \"originalOrderId\": \"string\",\n \"matchQuantity\": 0,\n \"avgUnitPrice\": 0,\n \"matchPrice\": 0,\n \"marketCode\": \"string\",\n \"stockCode\": \"string\",\n \"orderAction\": \"string\"\n}"},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/order-match","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","order-match"]}},"response":[],"uid":"14729559-e37cffc8-78f6-4882-9247-92064a1805ca"},{"name":"after_trade_order","event":[{"listen":"test","script":{"id":"c9d9e2da-a329-499d-9d99-48bcd164dbb4","exec":["pm.test('Check status: MATCHED', () => {\r"," let orderId = pm.response.json().content.find(a => a.orderId === '133');\r"," pm.expect(orderId.status).to.equal(\"MATCHED\");\r","});\r","\r",""],"type":"text/javascript"}}],"id":"405c8770-b05d-4475-b31a-7cd44a0162d4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"accept","value":"*/*"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"https://cash-bo-api.dev.rakutentrade.com/internal/trade/orders?tan=CA-00000073&pageNumber=0&pageSize=20","protocol":"https","host":["cash-bo-api","dev","rakutentrade","com"],"path":["internal","trade","orders"],"query":[{"key":"tan","value":"CA-00000073"},{"key":"pageNumber","value":"0"},{"key":"pageSize","value":"20"}]}},"response":[],"uid":"14729559-405c8770-b05d-4475-b31a-7cd44a0162d4"},{"name":"after_balance","event":[{"listen":"test","script":{"id":"b50017da-73a4-48d1-b48c-90680637ecf5","exec":["var jsonData = JSON.parse(responseBody);\r","\r","var newFees = jsonData.coaPath;\r","var newUpliftedBuy = jsonData.coaPath;\r","var newUpliftedBuyMatched = jsonData.coaPath;\r","var newUpliftedUtilized = jsonData.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('Cash:Asset:SGD:UpliftedBuyMatched');\r","var oldUpliftedBuyMatched = pm.globals.get('Cash:Asset:SGD:UpliftedBuyMatched');\r","\r","parseInt(pm.globals.get('price'));\r","parseInt(pm.globals.get('fee'));\r","parseInt(pm.globals.get('Cash:Asset:SGD:UpliftedBuy'));\r","parseInt(pm.globals.get('Cash:Asset:SGD:Fees'));\r","parseInt(pm.globals.get('Cash:Asset:SGD:UpliftedBuyMatched'));\r","\r","pm.test(\"Difference between new and old balance \", function () {\r"," pm.expect(parseInt(pm.globals.get(newFees)).to.eql(parseInt(pm.globals.get('fee'))));\r"," pm.expect(parseInt(pm.globals.get(oldUpliftedBuy)) - parseInt(pm.globals.get('price'))).to.be.eql(parseInt(pm.globals.get('newUpliftedBuy')));\r"," pm.expect(parseInt(pm.globals.get(newUpliftedUtilized)).to.eql(parseInt(pm.globals.get(oldUpliftedUtilized))));\r"," pm.expect(parseInt(pm.globals.get(oldUpliftedBuyMatched)) + parseInt(pm.globals.get('price'))).to.be.eql(parseInt(pm.globals.get('newUpliftedBuyMatched')));\r","});"],"type":"text/javascript"}}],"id":"2fbecfe0-f73c-4f6d-96cd-b645c7a1665a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":{"raw":"https://gcw-bo-api.dev.rakutentrade.com/api/v1/bo/wallet/getWalletAccountByPaths?cif=thaohtt_001&coaPaths=Cash%3AAsset%3ASGD%3AUpliftedBuyMatched&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":"thaohtt_001"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuyMatched"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AUpliftedBuy"},{"key":"coaPaths","value":"Cash%3AAsset%3ASGD%3AFees"},{"key":"coaPaths","value":"Global%3ALiability%3ASGD%3AUpliftedUtilized"}]}},"response":[],"uid":"14729559-2fbecfe0-f73c-4f6d-96cd-b645c7a1665a"}],"id":"0ae84128-2a17-483a-8d3f-5876c428d881","uid":"14729559-0ae84128-2a17-483a-8d3f-5876c428d881"},{"name":"New Folder","item":[],"id":"5d8f4c20-d53a-42b4-a356-49047158ca4e","uid":"14729559-5d8f4c20-d53a-42b4-a356-49047158ca4e"}]}}