Skip to main content
GET
/
tools
/
alpaca
/
get_order
{
  "provider": "<string>",
  "id": "<string>",
  "client_order_id": "<string>",
  "symbol": "<string>",
  "side": "buy",
  "type": "<string>",
  "time_in_force": "<string>",
  "status": "<string>",
  "qty": "<string>",
  "notional": "<string>",
  "filled_qty": "<string>",
  "filled_avg_price": "<string>",
  "limit_price": "<string>",
  "stop_price": "<string>",
  "submitted_at": "2023-11-07T05:31:56Z",
  "filled_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "provider_fields": {}
}

alpaca_get_order

tools = trading.alpaca(
    api_key=os.environ["ALPACA_KEY"],
    api_secret=os.environ["ALPACA_SECRET"],
    model="openai",
    paper=True,
    minimal=True,
    include=["alpaca_get_order"],
)
Options
  • include / exclude: filter which tools are exposed (use full names like alpaca_get_order).
  • minimal: omit provider and provider_fields when True.
  • paper: use Alpaca paper trading instead of live trading.
Request body
  • order_id (required): Alpaca order ID.
  • nested (optional): request nested/expanded order representation when supported.

Body

application/json

This is a request to obtain information. Your API keys are required. An order_id is required.

order_id
string
required

Provider order ID.

nested
boolean | null

Whether to request nested/expanded representation when supported by the provider.

Response

object | null

Order (OpenTools trading schema) or null if not found.

provider
string | null

Trading provider identifier. Omitted when minimal=True.

id
string | null

Provider order ID.

client_order_id
string | null

Client-supplied order ID when supported.

symbol
string | null

Instrument symbol (e.g. 'AAPL', 'BTC/USD').

side
enum<string> | null

Order side.

Available options:
buy,
sell
type
string | null

Order type (e.g. market, limit, stop, stop_limit). Provider-dependent.

time_in_force
string | null

Time in force (e.g. day, gtc, ioc, fok). Provider-dependent.

status
string | null

Order status as reported by the provider (e.g. accepted, filled, canceled).

qty
string | null

Requested quantity. String to preserve exact precision.

notional
string | null

Requested notional amount. String to preserve exact precision.

filled_qty
string | null

Filled quantity. String to preserve exact precision.

filled_avg_price
string | null

Average fill price. String to preserve exact precision.

limit_price
string | null

Limit price when applicable. String to preserve exact precision.

stop_price
string | null

Stop price when applicable. String to preserve exact precision.

submitted_at
string<date-time> | null

Submitted timestamp.

filled_at
string<date-time> | null

Filled timestamp when applicable.

created_at
string<date-time> | null

Created timestamp.

updated_at
string<date-time> | null

Last update timestamp.

provider_fields
object

Provider-specific fields. Omitted when minimal=True.