Limits
A limit order is an order to buy or sell a stock with a restriction on the maximum price to be paid or the minimum price to be received (the "limit price"). If the order is filled, it will only be at the specified limit price or better.
The limits provide comprehensive information regarding the available cash, utilized margin, collateral margin, daily pay-in, and other relevant details.
Method: POST
https://connect.thefirstock.com/api/V3/limit
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
jKey | Key Obtained on login success. | String | "dl9b4e1b1c79042476fd96 11eed81003b2dc34c3f13b0 b60a4842fd5a24c9f3f2" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/limit' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}'
from thefirstock import thefirstock
limits = thefirstock.firstock_Limits()
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.limits((err, result) => {
console.log("Error, ", err);
console.log("Result: ", result);
});
using thefirstock;
class Program
{
public static void Main()
{
Firstock firstock = new Firstock();
var result = firstock.limits();
}
}
Response success details
Parameter | Description | Data types | Examples |
---|---|---|---|
status | Success | String | "Success" |
data.requestTime | Response received time. | String | "15:50:24 15-02-2023" |
data.cash | Cash | String | "-142.37" |
data.payin | Total Amount transferred using Payins today | String | "0.00" |
data.marginused | Total margin / fund used today | String | "0.00" |
data.brkcollamt | Prevalued Collateral Amount | String | "0.00" |
data.peak_mar | Peak margin used by the client | String | "0.00" |
data.span | Span used | String | "0.00" |
data.expo | Exposure margin | String | "0.00" |
data.premium | Premium used | String | "0.00" |
data.collateral | Collateral calculated based on uploaded holdings | String | "0.00" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "401" |
name | Type of error | String | "INVALID_JKEY" |
error.field | Error field | String | "jKey" |
error.message | Error message | String | "jKey parameter is invalid" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": {
"requestTime": "15:50:24 15-02-2023",
"cash": "-142.37",
"payin": "0.00",
"marginused": "0.00",
"brkcollamt": "0.00",
"peak_mar": "0.00",
"span": "0.00",
"expo": "0.00",
"premium": "0.00",
"collateral": "0.00"
}
}
{
"status": "Failed",
"code": "401",
"name": "INVALID_JKEY",
"error": {
"field": "jKey",
"message": "jKey parameter is invalid"
}
}