const res = await fetch('https://app.trdrs.co/api/risk?provider=rithmic&account=PA-4821-07', {
method: 'PUT',
headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
})
const data = await res.json()curl -X PUT 'https://app.trdrs.co/api/risk?provider=rithmic&account=PA-4821-07' \
-H "Authorization: Bearer $TRDRS_API_KEY"import requests
url = "https://app.trdrs.co/api/risk"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trdrs.co/api/risk"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.trdrs.co/api/risk")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"lock": {
"provider": "rithmic",
"accountNumber": "PA-4821-07",
"tradingLocked": false,
"lockReason": null,
"lockWindow": null,
"tradingUnlockAt": null
},
"limits": {
"inForce": {
"version": "4f1c0e9a7b2d6e31a8c5f0d2b9e7a614",
"terms": [
{
"rule": "daily_loss",
"authority": "firm",
"amount": "2500"
}
],
"endOfDay": null,
"session": {
"timeZone": "America/Chicago",
"rolloverHour": 17
}
},
"next": null
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Read the risk state (deprecated)
Returns the same state as GET /api/risk. The request body is ignored.
Required key: Trading API key. A Connect app’s backend can also send it with the app’s API key, and a venue’s backend with its Venue key, which carries trader:trade, each naming one of its own traders in x-trdrs-trader: it then runs on that trader’s own accounts.
const res = await fetch('https://app.trdrs.co/api/risk?provider=rithmic&account=PA-4821-07', {
method: 'PUT',
headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
})
const data = await res.json()curl -X PUT 'https://app.trdrs.co/api/risk?provider=rithmic&account=PA-4821-07' \
-H "Authorization: Bearer $TRDRS_API_KEY"import requests
url = "https://app.trdrs.co/api/risk"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trdrs.co/api/risk"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.trdrs.co/api/risk")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"lock": {
"provider": "rithmic",
"accountNumber": "PA-4821-07",
"tradingLocked": false,
"lockReason": null,
"lockWindow": null,
"tradingUnlockAt": null
},
"limits": {
"inForce": {
"version": "4f1c0e9a7b2d6e31a8c5f0d2b9e7a614",
"terms": [
{
"rule": "daily_loss",
"authority": "firm",
"amount": "2500"
}
],
"endOfDay": null,
"session": {
"timeZone": "America/Chicago",
"rolloverHour": 17
}
},
"next": null
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.
Query Parameters
The provider the account is at. Required.
The account number, when the login holds more than one. It must be one of your own accounts, or the call is refused with 400.
Response
The account lock and effective limits.
The account lock and effective limits.
Whether the account is locked now.
Show child attributes
Show child attributes
Every limit on an account bound to a risk policy, read-only. inForce is the version the account is held to now, and next is a version recorded since, which takes effect at the next session day. Null on an account no risk policy binds.
Show child attributes
Show child attributes