UNPKG

upstox-js-sdk

Version:

The official Node Js client for communicating with the Upstox API

21 lines (17 loc) 547 B
## Cancel an open order ```javascript let UpstoxClient = require('upstox-js-sdk'); let defaultClient = UpstoxClient.ApiClient.instance; var OAUTH2 = defaultClient.authentications['OAUTH2']; OAUTH2.accessToken = "{your_access_token}"; let apiInstance = new UpstoxClient.OrderApi(); let orderId = "240111010403654"; let apiVersion = "2.0"; apiInstance.cancelOrder(orderId, apiVersion, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ```