All URIs are relative to https://api-v2.upstox.com
Method | HTTP request | Description |
---|---|---|
getProfile | GET /user/profile | Get profile |
getUserFundMargin | GET /user/get-funds-and-margin | Get User Fund And Margin |
GetProfileResponse getProfile(apiVersion)
Get profile
This API allows to fetch the complete information of the user who is logged in including the products, order types and exchanges enabled for the user
import {UpstoxClient} from 'upstox-js-sdk';
let defaultClient = UpstoxClient.ApiClient.instance;
// Configure OAuth2 access token for authorization: OAUTH2
let OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new UpstoxClient.UserApi();
let apiVersion = "apiVersion_example"; // String | API Version Header
apiInstance.getProfile(apiVersion, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header |
- Content-Type: Not defined
- Accept: /, application/json
GetUserFundMarginResponse getUserFundMargin(apiVersion, opts)
Get User Fund And Margin
Shows the balance of the user in equity and commodity market.
import {UpstoxClient} from 'upstox-js-sdk';
let defaultClient = UpstoxClient.ApiClient.instance;
// Configure OAuth2 access token for authorization: OAUTH2
let OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = 'YOUR ACCESS TOKEN';
let apiInstance = new UpstoxClient.UserApi();
let apiVersion = "apiVersion_example"; // String | API Version Header
let opts = {
'segment': "segment_example" // String |
};
apiInstance.getUserFundMargin(apiVersion, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header | |
segment | String | [optional] |
- Content-Type: Not defined
- Accept: application/json, /