Skip to content

User Limits

GET /limit/getLimits

Gets the user cash balances, available margin for trading in equity and commodity segments.

Sample Code

bash
curl -X GET 'https://tradeapi.samco.in/limit/getLimits' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-session-token: <SESSION_TOKEN>'
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Sample {
  public static void main(String[] args) throws Exception {
    HttpClient client = HttpClient.newHttpClient();

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://tradeapi.samco.in/limit/getLimits"))
        .header("Content-Type", "application/json")
        .header("Accept", "application/json")
        .header("x-session-token", "<SESSION_TOKEN>")
        .GET()
        .build();

    HttpResponse<String> response =
        client.send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.body());
  }
}
js
(async () => {
  const headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'x-session-token': '<SESSION_TOKEN>',
  };

  const response = await fetch('https://tradeapi.samco.in/limit/getLimits', {
    method: 'GET',
    headers,
  });

  const data = await response.json();
  console.log(data);
})();
py
import requests
import json

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-session-token': '<SESSION_TOKEN>',
}

r = requests.get('https://tradeapi.samco.in/limit/getLimits',
  headers=headers)

print(r.json())

Sample responses

json
{
    "serverTime": "10/04/24 13:29:07",
    "msgId": "77bb4c9b-17fc-4465-8e30-02e80eaff78c",
    "status": "Success",
    "statusMessage": "User Limit details retrieved successfully",
    "equityLimit": {
        "grossAvailableMargin": "0.00",
        "payInToday": "0",
        "notionalCash": "0",
        "marginUsed": "0",
        "netAvailableMargin": "0.00"
    },
    "commodityLimit": {
        "grossAvailableMargin": "0.00",
        "payInToday": "0",
        "notionalCash": "0",
        "marginUsed": "0",
        "netAvailableMargin": "0.00"
    }
}

Response Schema

Status Code 200

NameTypeDescription
serverTimestringTime at Server.
msgIdstringThis is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request.
statusstringThe status of the API response. It can be either 'Success' or 'Failure'.
statusMessagestringA message describing the result of the API call.
grossAvailableMarginstringTotal amount of margins or balances available for trading. Opening balance for the current day.
payInTodaystringCurrent day deposited amount.
notionalCashstringAdditional limit that may or may not be given by RMS for trading.
collateralMarginAgainstSharesstringMargin against shares offered by SAMCO to their clients for trading in stocks and shares.
marginUsedstringThe amount deducted from the opening balance for trading on the current day, and the amount blocked for creating a position when the user places an order.
netAvailableMarginstringActual margin available with the user for trading after making all necessary adjustments.