Create a trade card
curl --request POST \
--url https://api.example.com/api/graph/v1/trade/cards \
--header 'Content-Type: application/json' \
--data '
{
"instrument": {
"symbol": "<string>",
"underlying": "<string>",
"option_details": {
"strike": 123,
"expiration": "2023-12-25"
}
},
"sizing": {
"type": "<string>",
"value": 123,
"computed_shares": "0",
"computed_risk_dollars": "0"
},
"source_ref": "<string>",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paper_live_mode": "paper",
"entry_triggers": {},
"exit_rules": {}
}
'import requests
url = "https://api.example.com/api/graph/v1/trade/cards"
payload = {
"instrument": {
"symbol": "<string>",
"underlying": "<string>",
"option_details": {
"strike": 123,
"expiration": "2023-12-25"
}
},
"sizing": {
"type": "<string>",
"value": 123,
"computed_shares": "0",
"computed_risk_dollars": "0"
},
"source_ref": "<string>",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paper_live_mode": "paper",
"entry_triggers": {},
"exit_rules": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
instrument: {
symbol: '<string>',
underlying: '<string>',
option_details: {strike: 123, expiration: '2023-12-25'}
},
sizing: {type: '<string>', value: 123, computed_shares: '0', computed_risk_dollars: '0'},
source_ref: '<string>',
strategy_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
paper_live_mode: 'paper',
entry_triggers: {},
exit_rules: {}
})
};
fetch('https://api.example.com/api/graph/v1/trade/cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/trade/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instrument' => [
'symbol' => '<string>',
'underlying' => '<string>',
'option_details' => [
'strike' => 123,
'expiration' => '2023-12-25'
]
],
'sizing' => [
'type' => '<string>',
'value' => 123,
'computed_shares' => '0',
'computed_risk_dollars' => '0'
],
'source_ref' => '<string>',
'strategy_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'paper_live_mode' => 'paper',
'entry_triggers' => [
],
'exit_rules' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/trade/cards"
payload := strings.NewReader("{\n \"instrument\": {\n \"symbol\": \"<string>\",\n \"underlying\": \"<string>\",\n \"option_details\": {\n \"strike\": 123,\n \"expiration\": \"2023-12-25\"\n }\n },\n \"sizing\": {\n \"type\": \"<string>\",\n \"value\": 123,\n \"computed_shares\": \"0\",\n \"computed_risk_dollars\": \"0\"\n },\n \"source_ref\": \"<string>\",\n \"strategy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paper_live_mode\": \"paper\",\n \"entry_triggers\": {},\n \"exit_rules\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/graph/v1/trade/cards")
.header("Content-Type", "application/json")
.body("{\n \"instrument\": {\n \"symbol\": \"<string>\",\n \"underlying\": \"<string>\",\n \"option_details\": {\n \"strike\": 123,\n \"expiration\": \"2023-12-25\"\n }\n },\n \"sizing\": {\n \"type\": \"<string>\",\n \"value\": 123,\n \"computed_shares\": \"0\",\n \"computed_risk_dollars\": \"0\"\n },\n \"source_ref\": \"<string>\",\n \"strategy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paper_live_mode\": \"paper\",\n \"entry_triggers\": {},\n \"exit_rules\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/trade/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrument\": {\n \"symbol\": \"<string>\",\n \"underlying\": \"<string>\",\n \"option_details\": {\n \"strike\": 123,\n \"expiration\": \"2023-12-25\"\n }\n },\n \"sizing\": {\n \"type\": \"<string>\",\n \"value\": 123,\n \"computed_shares\": \"0\",\n \"computed_risk_dollars\": \"0\"\n },\n \"source_ref\": \"<string>\",\n \"strategy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paper_live_mode\": \"paper\",\n \"entry_triggers\": {},\n \"exit_rules\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"source": "strategy_lib",
"paper_live_mode": "paper",
"mode": "autonomous",
"instrument": {
"kind": "equity",
"symbol": "<string>",
"underlying": "<string>",
"option_details": {
"strike": "<string>",
"expiration": "2023-12-25",
"type": "C"
}
},
"column_state": "queue",
"sizing": {
"type": "<string>",
"value": "<string>",
"computed_shares": "0",
"computed_risk_dollars": "0"
},
"source_ref": "<string>",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_name": "<string>",
"strategy_version": 123,
"substate": "hunting",
"entry_triggers": {},
"exit_rules": {},
"broker_order_id": "<string>",
"fill_ladder": [
{
"ts": "2023-11-07T05:31:56Z",
"shares": "<string>",
"price": "<string>",
"side": "buy",
"broker_fill_id": "<string>"
}
],
"position": {
"shares": "<string>",
"avg_price": "<string>",
"unrealized_pnl": "0",
"realized_pnl": "0"
},
"fitness": {
"regime_match": "active",
"fitness_score": 50,
"ripe": false,
"last_computed_at": "2023-11-07T05:31:56Z"
},
"costs": {
"expected_commission": "<string>",
"expected_slippage_bps": "<string>",
"realized_commission": "<string>",
"realized_slippage_bps": "<string>",
"expected_fill_price": "<string>",
"realized_fill_price": "<string>"
},
"reconcile_state": "ok",
"audit_log_count": 0,
"latest_audit_entry": {
"ts": "2023-11-07T05:31:56Z",
"actor": "user",
"action": "<string>",
"reason": "",
"correlation_id": "<string>",
"market_snapshot": {
"ts": "2023-11-07T05:31:56Z",
"bar_symbol": "",
"bar_open": "<string>",
"bar_high": "<string>",
"bar_low": "<string>",
"bar_close": "<string>",
"bar_volume": 123,
"bar_vwap": "<string>",
"quote_bid": "<string>",
"quote_ask": "<string>",
"quote_bid_size": 123,
"quote_ask_size": 123,
"indicators": {},
"regime_dominant": "",
"regime_confidence": 123,
"signals": {},
"risk_day_dollars": "<string>",
"risk_pct_cap": 123,
"risk_loss_remaining": "<string>"
},
"before": {},
"after": {},
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_version": 123
},
"schema_version": 1
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}trade-cards
Create a trade card
Create a new trade card in the Queue column (or Pending for Manual mode). Validates sizing, instrument, and mode against the user’s Risk Profile before persisting.
POST
/
api
/
graph
/
v1
/
trade
/
cards
Create a trade card
curl --request POST \
--url https://api.example.com/api/graph/v1/trade/cards \
--header 'Content-Type: application/json' \
--data '
{
"instrument": {
"symbol": "<string>",
"underlying": "<string>",
"option_details": {
"strike": 123,
"expiration": "2023-12-25"
}
},
"sizing": {
"type": "<string>",
"value": 123,
"computed_shares": "0",
"computed_risk_dollars": "0"
},
"source_ref": "<string>",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paper_live_mode": "paper",
"entry_triggers": {},
"exit_rules": {}
}
'import requests
url = "https://api.example.com/api/graph/v1/trade/cards"
payload = {
"instrument": {
"symbol": "<string>",
"underlying": "<string>",
"option_details": {
"strike": 123,
"expiration": "2023-12-25"
}
},
"sizing": {
"type": "<string>",
"value": 123,
"computed_shares": "0",
"computed_risk_dollars": "0"
},
"source_ref": "<string>",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paper_live_mode": "paper",
"entry_triggers": {},
"exit_rules": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
instrument: {
symbol: '<string>',
underlying: '<string>',
option_details: {strike: 123, expiration: '2023-12-25'}
},
sizing: {type: '<string>', value: 123, computed_shares: '0', computed_risk_dollars: '0'},
source_ref: '<string>',
strategy_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
paper_live_mode: 'paper',
entry_triggers: {},
exit_rules: {}
})
};
fetch('https://api.example.com/api/graph/v1/trade/cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/trade/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instrument' => [
'symbol' => '<string>',
'underlying' => '<string>',
'option_details' => [
'strike' => 123,
'expiration' => '2023-12-25'
]
],
'sizing' => [
'type' => '<string>',
'value' => 123,
'computed_shares' => '0',
'computed_risk_dollars' => '0'
],
'source_ref' => '<string>',
'strategy_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'paper_live_mode' => 'paper',
'entry_triggers' => [
],
'exit_rules' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/trade/cards"
payload := strings.NewReader("{\n \"instrument\": {\n \"symbol\": \"<string>\",\n \"underlying\": \"<string>\",\n \"option_details\": {\n \"strike\": 123,\n \"expiration\": \"2023-12-25\"\n }\n },\n \"sizing\": {\n \"type\": \"<string>\",\n \"value\": 123,\n \"computed_shares\": \"0\",\n \"computed_risk_dollars\": \"0\"\n },\n \"source_ref\": \"<string>\",\n \"strategy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paper_live_mode\": \"paper\",\n \"entry_triggers\": {},\n \"exit_rules\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/graph/v1/trade/cards")
.header("Content-Type", "application/json")
.body("{\n \"instrument\": {\n \"symbol\": \"<string>\",\n \"underlying\": \"<string>\",\n \"option_details\": {\n \"strike\": 123,\n \"expiration\": \"2023-12-25\"\n }\n },\n \"sizing\": {\n \"type\": \"<string>\",\n \"value\": 123,\n \"computed_shares\": \"0\",\n \"computed_risk_dollars\": \"0\"\n },\n \"source_ref\": \"<string>\",\n \"strategy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paper_live_mode\": \"paper\",\n \"entry_triggers\": {},\n \"exit_rules\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/trade/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrument\": {\n \"symbol\": \"<string>\",\n \"underlying\": \"<string>\",\n \"option_details\": {\n \"strike\": 123,\n \"expiration\": \"2023-12-25\"\n }\n },\n \"sizing\": {\n \"type\": \"<string>\",\n \"value\": 123,\n \"computed_shares\": \"0\",\n \"computed_risk_dollars\": \"0\"\n },\n \"source_ref\": \"<string>\",\n \"strategy_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"paper_live_mode\": \"paper\",\n \"entry_triggers\": {},\n \"exit_rules\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"source": "strategy_lib",
"paper_live_mode": "paper",
"mode": "autonomous",
"instrument": {
"kind": "equity",
"symbol": "<string>",
"underlying": "<string>",
"option_details": {
"strike": "<string>",
"expiration": "2023-12-25",
"type": "C"
}
},
"column_state": "queue",
"sizing": {
"type": "<string>",
"value": "<string>",
"computed_shares": "0",
"computed_risk_dollars": "0"
},
"source_ref": "<string>",
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_name": "<string>",
"strategy_version": 123,
"substate": "hunting",
"entry_triggers": {},
"exit_rules": {},
"broker_order_id": "<string>",
"fill_ladder": [
{
"ts": "2023-11-07T05:31:56Z",
"shares": "<string>",
"price": "<string>",
"side": "buy",
"broker_fill_id": "<string>"
}
],
"position": {
"shares": "<string>",
"avg_price": "<string>",
"unrealized_pnl": "0",
"realized_pnl": "0"
},
"fitness": {
"regime_match": "active",
"fitness_score": 50,
"ripe": false,
"last_computed_at": "2023-11-07T05:31:56Z"
},
"costs": {
"expected_commission": "<string>",
"expected_slippage_bps": "<string>",
"realized_commission": "<string>",
"realized_slippage_bps": "<string>",
"expected_fill_price": "<string>",
"realized_fill_price": "<string>"
},
"reconcile_state": "ok",
"audit_log_count": 0,
"latest_audit_entry": {
"ts": "2023-11-07T05:31:56Z",
"actor": "user",
"action": "<string>",
"reason": "",
"correlation_id": "<string>",
"market_snapshot": {
"ts": "2023-11-07T05:31:56Z",
"bar_symbol": "",
"bar_open": "<string>",
"bar_high": "<string>",
"bar_low": "<string>",
"bar_close": "<string>",
"bar_volume": 123,
"bar_vwap": "<string>",
"quote_bid": "<string>",
"quote_ask": "<string>",
"quote_bid_size": 123,
"quote_ask_size": 123,
"indicators": {},
"regime_dominant": "",
"regime_confidence": 123,
"signals": {},
"risk_day_dollars": "<string>",
"risk_pct_cap": 123,
"risk_loss_remaining": "<string>"
},
"before": {},
"after": {},
"strategy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategy_version": 123
},
"schema_version": 1
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request body for creating a new trade card.
Available options:
strategy_lib, order_builder, auto_respawn, thesis_promote, backtest_promote Show child attributes
Show child attributes
Available options:
autonomous, supervised, monitor, manual Show child attributes
Show child attributes
Available options:
paper, live Response
Successful Response
Full trade card state returned by the API.
Available options:
strategy_lib, order_builder, auto_respawn, thesis_promote, backtest_promote Available options:
paper, live Available options:
autonomous, supervised, monitor, manual Show child attributes
Show child attributes
Available options:
queue, pending, open, closed Show child attributes
Show child attributes
Available options:
hunting, working, partial, exited, cancelled, invalidated, confirm_pending Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
ok, reconciling, unreconciled, requires_manual_review Show child attributes
Show child attributes