post
https://api.usetradecraft.io/v1/agents//orders
Submits a buy or sell order on behalf of an agent. Before sending to
Alpaca, the fund checker validates that:
- The agent has enough available cash for buys.
- The agent actually holds the shares being sold.
- The agent is
active(not paused or disabled).
If any check fails, the order is rejected with 422 before touching
Alpaca.
Order types
| Type | Description |
|---|---|
market | Executes immediately at the best available price |
limit | Executes only at limit_price or better |
The reasoning field
reasoning fieldPass a string explaining why the agent is making this trade. It is
stored on the order record and surfaced in the dashboard and run logs.
Useful for auditing agent decisions.
# Market buy
curl -X POST https://api.usetradecraft.io/v1/agents/momentum-trader/orders \
-H "Authorization: Bearer al_your_key" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AAPL",
"side": "buy",
"qty": 5,
"order_type": "market",
"reasoning": "AAPL broke above 50-day MA on high volume"
}'
# Limit sell
curl -X POST https://api.usetradecraft.io/v1/agents/momentum-trader/orders \
-H "Authorization: Bearer al_your_key" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AAPL",
"side": "sell",
"qty": 5,
"order_type": "limit",
"limit_price": 195.00,
"reasoning": "Taking profit at resistance level"
}'Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
