{"openapi":"3.0.0","info":{"title":"Trading API","description":"Alpaca's Trading API is a modern platform for algorithmic trading.","version":"2.0.1","contact":{"name":"Alpaca Support","email":"support@alpaca.markets","url":"https://alpaca.markets/support"},"termsOfService":"https://s3.amazonaws.com/files.alpaca.markets/disclosures/library/TermsAndConditions.pdf"},"servers":[{"url":"https://paper-api.alpaca.markets","description":"Paper"},{"url":"https://api.alpaca.markets","description":"Live"}],"tags":[{"name":"Accounts"},{"name":"Assets"},{"name":"Corporate Actions"},{"name":"Orders"},{"name":"Positions"},{"name":"Portfolio History"},{"name":"Watchlists"},{"name":"Account Configurations"},{"name":"Account Activities"},{"name":"Calendar"},{"name":"Clock"},{"name":"Crypto Funding"},{"name":"Crypto Perpetuals Funding (Beta)"},{"name":"Crypto Perpetuals Account Vitals (Beta)"},{"name":"Crypto Perpetuals Leverage (Beta)"}],"paths":{"/v2/account":{"get":{"summary":"Get Account","tags":["Accounts"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"},"example":{"id":"1d9eed04-be39-4e01-9b84-a48ac5bbafcf","admin_configurations":{},"user_configurations":null,"account_number":"PALPACA_123","status":"ACTIVE","crypto_status":"ACTIVE","currency":"USD","buying_power":"245432.61","regt_buying_power":"245432.61","daytrading_buying_power":"0","options_buying_power":"122716.305","effective_buying_power":"245432.61","non_marginable_buying_power":"122086.5","bod_dtbp":0,"cash":"122086.5","accrued_fees":"0","pending_transfer_in":"0","portfolio_value":"123346.11","pattern_day_trader":true,"trading_blocked":false,"transfers_blocked":false,"account_blocked":false,"created_at":"2023-01-01T18:20:20.272275Z","trade_suspended_by_user":false,"multiplier":"2","shorting_enabled":true,"equity":"123346.11","last_equity":"122011.09751111286868","long_market_value":"1259.61","short_market_value":"0","position_market_value":"1259.61","initial_margin":"629.8","maintenance_margin":"377.88","last_maintenance_margin":"480.73","sma":"123369.74","daytrade_count":0,"balance_asof":"2023-09-27","crypto_tier":1,"options_trading_level":2,"intraday_adjustments":"0","pending_reg_taf_fees":"0"}}}}},"operationId":"getAccount","parameters":[],"description":"Returns your account details."}},"/v2/orders":{"post":{"tags":["Orders"],"summary":"Create an Order","operationId":"postOrder","description":"Places a new order for the given account. An order request may be rejected if the account is not authorized for trading, or if the tradable balance is insufficient to fill the order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","x-stoplight":{"id":"ss5ik56n2ju1s"},"description":"symbol, asset ID, or currency pair to identify the asset to trade, required for all order classes except for `mleg`."},"qty":{"type":"string","x-stoplight":{"id":"o73n1g4sdbylf"},"description":"number of shares to trade. Can be fractionable for only market and day order types. Required for `mleg` order class, represents the number of units to trade of this strategy."},"notional":{"type":"string","x-stoplight":{"id":"0pqrvqmmsladt"},"description":"dollar amount to trade. Cannot work with `qty`. Can only work for market order types and day for time in force."},"side":{"$ref":"#/components/schemas/OrderSide"},"type":{"$ref":"#/components/schemas/OrderType"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","x-stoplight":{"id":"0pz01a130upwd"},"description":"Required if type is `limit` or `stop_limit`.\nIn case of `mleg`, the limit_price parameter is expressed with the following notation:\n- A positive value indicates a debit, representing a cost or payment to be made.\n- A negative value signifies a credit, reflecting an amount to be received."},"stop_price":{"type":"string","x-stoplight":{"id":"ctaacyol2uvib"},"description":"required if type is `stop` or `stop_limit`"},"trail_price":{"type":"string","x-stoplight":{"id":"eje00dcpg2s0c"},"description":"this or `trail_percent` is required if type is `trailing_stop`"},"trail_percent":{"type":"string","x-stoplight":{"id":"l72my4e1qz36r"},"description":"this or `trail_price` is required if type is `trailing_stop`"},"extended_hours":{"type":"boolean","x-stoplight":{"id":"gqhf6gxwkrzr8"},"description":"(default) false. If true, order will be eligible to execute in premarket/afterhours. Only works with type limit and time_in_force day."},"client_order_id":{"type":"string","x-stoplight":{"id":"duyztdwi66wfk"},"description":"A unique identifier for the order. Automatically generated if not sent. (<= 128 characters)","maxLength":128},"order_class":{"$ref":"#/components/schemas/OrderClass"},"legs":{"type":"array","description":"list of order legs (<= 4)","items":{"$ref":"#/components/schemas/MLegOrderLeg"},"maxLength":4},"take_profit":{"type":"object","description":"Takes in a string/number value for limit_price","properties":{"limit_price":{"type":"string","format":"decimal","example":"3.14"}}},"stop_loss":{"description":"Takes in string/number values for stop_price and limit_price","type":"object","properties":{"stop_price":{"type":"string","format":"decimal","example":"3.14"},"limit_price":{"type":"string","format":"decimal","example":"3.14"}}},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"advanced_instructions":{"$ref":"#/components/schemas/AdvancedInstructions"}},"required":["type","time_in_force"]},"examples":{"Equity":{"summary":"Buy an equity stock","value":{"symbol":"AAPL","qty":"2","side":"buy","type":"limit","limit_price":"150","time_in_force":"gtc"}},"Options":{"summary":"Buy an option contract","value":{"symbol":"AAPL250620C00100000","qty":"2","side":"buy","type":"limit","limit_price":"10","time_in_force":"day"}},"MultilegOptions":{"summary":"Option Call spread","value":{"order_class":"mleg","type":"limit","limit_price":"10","qty":"3","time_in_force":"day","legs":[{"side":"buy","position_intent":"buy_to_open","symbol":"AAPL241213C00250000","ratio_qty":"3"},{"side":"sell","position_intent":"sell_to_open","symbol":"AAPL241213C00260000","ratio_qty":"1"}]}},"Crypto":{"summary":"Buy a crypto coin","value":{"symbol":"ETH/USD","qty":"0.02","side":"buy","type":"limit","limit_price":"2100","time_in_force":"gtc"}}}}},"description":""},"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"},"Crypto":{"$ref":"#/components/examples/CryptoOrderResponse"},"MultilegOptions":{"$ref":"#/components/examples/MultilegOptionsOrderResponse"}}}}},"403":{"description":"Forbidden\n\nBuying power or shares is not sufficient."},"422":{"description":"Unprocessable\n\nInput parameters are not recognized."}}},"get":{"tags":["Orders"],"summary":"Get All Orders","parameters":[{"schema":{"type":"string","enum":["open","closed","all"],"example":"open"},"in":"query","name":"status","description":"Order status to be queried. open, closed or all. Defaults to open."},{"schema":{"type":"integer"},"in":"query","name":"limit","description":"The maximum number of orders in response. Defaults to 50 and max is 500."},{"schema":{"type":"string"},"in":"query","name":"after","description":"The response will include only ones submitted after this timestamp (exclusive.)"},{"schema":{"type":"string"},"in":"query","name":"until","description":"The response will include only ones submitted until this timestamp (exclusive.)"},{"schema":{"type":"string","enum":["asc","desc"]},"in":"query","name":"direction","description":"The chronological order of response based on the submission time. asc or desc. Defaults to desc."},{"schema":{"type":"boolean"},"in":"query","name":"nested","description":"If true, the result will roll up multi-leg orders under the legs field of primary order."},{"schema":{"type":"string"},"in":"query","name":"symbols","description":"A comma-separated list of symbols to filter by (ex. “AAPL,TSLA,MSFT”). A currency pair is required for crypto orders (ex. “BTCUSD,BCHUSD,LTCUSD,ETCUSD”)."},{"schema":{"type":"string"},"in":"query","name":"side","description":"Filters down to orders that have a matching side field set."},{"name":"asset_class","in":"query","description":"A comma seperated list of asset classes, the response will include only orders in the specified asset classes. By specifying `us_option` as the class, you can query option orders by underlying symbol using the symbols parameter.","schema":{"type":"array","items":{"type":"string","enum":["us_equity","us_option","crypto","all"]}}}],"responses":{"200":{"description":"Successful response\n\nAn array of Order objects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"examples":{"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"},"Crypto":{"$ref":"#/components/examples/CryptoOrderResponse"},"MultilegOptions":{"$ref":"#/components/examples/MultilegOptionsOrderResponse"}}}}}},"operationId":"getAllOrders","description":"Retrieves a list of orders for the account, filtered by the supplied query parameters.","x-internal":false},"delete":{"tags":["Orders"],"summary":"Delete All Orders","parameters":[],"responses":{"207":{"description":"Multi-Status with body.\n\nan array of objects that include the order id and http status code for each status request.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CanceledOrderResponse"}}}}},"500":{"description":"Failed to cancel order."}},"operationId":"deleteAllOrders","description":"Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request."}},"/v2/orders:by_client_order_id":{"get":{"tags":["Orders"],"summary":"Get Order by Client Order ID","description":"Retrieves a single order specified by the client order ID.","operationId":"getOrderByClientOrderId","parameters":[{"name":"client_order_id","in":"query","required":true,"description":"The client-assigned order ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the order matching the client_order_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}}}},"/v2/orders/{order_id}":{"get":{"tags":["Orders"],"summary":"Get Order by ID","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"nested","description":"If true, the result will roll up multi-leg orders under the legs field of primary order."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"},"Crypto":{"$ref":"#/components/examples/CryptoOrderResponse"},"MultilegOptions":{"$ref":"#/components/examples/MultilegOptionsOrderResponse"}}}}}},"operationId":"getOrderByOrderID","description":"Retrieves a single order for the given order_id."},"patch":{"tags":["Orders"],"summary":"Replace Order by ID","description":"Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order.\n\nA success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel.\n\nWhile an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order.\n\nNote: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchOrderRequest"}}}},"responses":{"200":{"description":"Successful response\n\nThe new Order object with the new order ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}},"operationId":"patchOrderByOrderId"},"delete":{"tags":["Orders"],"summary":"Delete Order by ID","parameters":[],"responses":{"204":{"description":"No Content"},"422":{"description":"The order status is not cancelable."}},"operationId":"deleteOrderByOrderID","description":"Attempts to cancel an Open Order. If the order is no longer cancelable, the request will be rejected with status 422; otherwise accepted with return status 204."},"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"order_id","in":"path","required":true,"description":"order id"}]},"/v2/positions":{"get":{"tags":["Positions"],"summary":"All Open Positions","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Position"}}}}}},"operationId":"getAllOpenPositions","description":"The positions API provides information about an account’s current open positions. The response will include information such as cost basis, shares traded, and market value, which will be updated live as price information is updated. Once a position is closed, it will no longer be queryable through this API\n\nRetrieves a list of the account’s open positions"},"delete":{"tags":["Positions"],"summary":"Close All Positions","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"cancel_orders","description":"If true is specified, cancel all open orders before liquidating all positions."}],"responses":{"207":{"description":"Multi-Status with body.\n\nan array of PositionClosed responses","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PositionClosedReponse"}}}}},"500":{"description":"Failed to liquidate"}},"operationId":"deleteAllOpenPositions","description":"Closes (liquidates) all of the account’s open long and short positions. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request."}},"/v2/positions/{symbol_or_asset_id}":{"get":{"tags":["Positions"],"summary":"Get an Open Position","description":"Retrieves the account’s open position for the given symbol or assetId.","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Position"}}}}},"operationId":"getOpenPosition"},"delete":{"tags":["Positions"],"summary":"Close a Position","parameters":[{"schema":{"type":"number"},"in":"query","name":"qty","description":"the number of shares to liquidate. Can accept up to 9 decimal points. Cannot work with percentage"},{"schema":{"type":"number"},"in":"query","name":"percentage","description":"percentage of position to liquidate. Must be between 0 and 100. Would only sell fractional if position is originally fractional. Can accept up to 9 decimal points. Cannot work with qty"}],"responses":{"200":{"description":"Successful response\n\nReturns the order created to close out this position","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}},"description":"Closes (liquidates) the account’s open position for the given symbol. Works for both long and short positions.","operationId":"deleteOpenPosition"},"parameters":[{"schema":{"type":"string"},"name":"symbol_or_asset_id","in":"path","required":true,"description":"symbol or assetId"}]},"/v2/positions/{symbol_or_contract_id}/exercise":{"post":{"tags":["Positions"],"summary":"Exercise an Options Position","description":"This endpoint enables users to exercise a held option contract, converting it into the underlying asset based on the specified terms.\nAll available held shares of this option contract will be exercised.\nBy default, Alpaca will automatically exercise in-the-money (ITM) contracts at expiry.\nExercise requests will be processed immediately once received. Exercise requests submitted between market close and midnight will be rejected to avoid any confusion about when the exercise will settle.\nTo cancel an exercise request or to submit a Do-not-exercise (DNE) instruction, please contact our support team.","operationId":"optionExercise","parameters":[{"schema":{"type":"string","format":"uuid"},"name":"symbol_or_contract_id","in":"path","required":true,"description":"Option contract symbol or ID."}],"requestBody":{"description":"Empty request body","content":{}},"responses":{"200":{"description":"Successful Response\n\nExercise instruction successfully submitted."},"403":{"description":"Forbidden\n\nAvailable position quantity is not sufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"No Available Position":{"value":{"code":40310000,"message":"no available position for the specified contract"}},"Short Position":{"value":{"code":40310001,"message":"cannot exercise short position"}}}}}},"422":{"description":"Invalid Parameters.\n\nOne or more parameters provided are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"Invalid Symbol":{"value":{"code":42210000,"message":"invalid symbol"}}}}}}}}},"/v2/account/portfolio/history":{"get":{"tags":["Portfolio History"],"summary":"Get Account Portfolio History","parameters":[{"schema":{"type":"string"},"in":"query","name":"period","description":"The duration of the data in `number` + `unit` format, such as 1D, where `unit` can be D for day, W for week, M for month and A for year. Defaults to 1M.\n\nOnly two of `start`, `end` and `period` can be specified at the same time.\n\nFor intraday timeframes (\\<1D) only 30 days or less can be queried, for 1D resolutions there is no such limit, data is available since the\ncreation of the account.\n"},{"schema":{"type":"string"},"in":"query","name":"timeframe","description":"The resolution of time window. 1Min, 5Min, 15Min, 1H, or 1D. If omitted, 1Min for less than 7 days period,\n15Min for less than 30 days, or otherwise 1D.\n\nFor queries with longer than 30 days of `period`, the system only accepts 1D as `timeframe`.\n"},{"schema":{"type":"string","enum":["market_hours","extended_hours","continuous"],"default":"market_hours"},"in":"query","name":"intraday_reporting","description":"For intraday resolutions (<1D) this specfies which timestamps to return data points for:\n\nAllowed values are:\n- **market_hours**\n\n  Only timestamps for the core requity trading hours are returned (usually 9:30am to 4:00pm, trading days only)\n\n- **extended_hours**\n\n  Returns timestamps for the whole session including extended hours (usually 4:00am to 8:00pm, trading days only)\n\n- **continuous**\n\n  Returns price data points 24/7 (for off-session times too). To calculate the equity values we are using the following prices:\n\n  Between 4:00am and 10:00pm on trading days the valuation will be calculated based on the last trade (extended hours and normal hours respectively).\n\n  After 10:00pm, until the next session open the equities will be valued at their official closing price on the primary exchange.\n"},{"schema":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01Z"},"in":"query","name":"start","description":"The timestamp the data is returned starting from in RFC3339 format (including timezone specification). Defaults to `end` minus `period`\n\nIf provided, the `start` value is always normalized to the `America/New_York` timezone and adjusted to the nearest `timeframe` interval, e.g. seconds are always truncated and the time is rounded backwards to the nearest ineterval of `1Min`, `5Min`, `15Min`, or `1H`.\n\nIf `timeframe=1D` and `start` is not a valid trading date, find the next available trading date. For example, if `start` occurs on Saturday or Sunday after converting to the America/New_York timezone, `start` is adjusted to the first weekday that is not a market holiday (e.g. Monday).\n\nIf `timeframe` is less than `1D` and `intraday_reporting` is not `continuous`, `start` always reflects the beginning of a market session. If `start` is between midnight and the end (inclusive) of an active trading day, `start` is set to the beginning of the session on the specified day. Otherwise, if `start` occurs outside of the market session, the next avaialble market date is used.\n\nFor example, when `intraday_reporting=market_hours` and `start=2023-10-19T23:59:59-04:00`, the provided `start` date occurs outside of the regular market session. The effective `start` timestamp is adjusted to the beginning of the next session: `2023-10-20T09:30:00-04:00`\n\n`start` may be be combined with one of `end` or `period`.\n\nProviding all of `start`, `end`, and `period` is invalid.\n"},{"schema":{"type":"string","enum":["no_reset","per_day"],"default":"per_day"},"in":"query","name":"pnl_reset","description":"`pnl_reset` defines how we are calculating the baseline values for Profit And Loss (pnl) for queries with `timeframe` less than 1D (intraday queries).\n\nThe default behavior for intraday queries is that we reset the pnl value to the previous day's closing equity for each **trading** day.\n\nIn case of crypto (given it's continous nature), this might not be desired: specifying \"no_reset\" disables this behavior and all pnl values\nreturned will be relative to the closing equity of the previous trading day.\n\nFor 1D resolution all PnL values are calculated relative to the `base_value`, we are not reseting the base value.\n"},{"schema":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01Z"},"in":"query","name":"end","description":"The timestamp the data is returned up to in RFC3339 format (including timezone specification). Defaults to the current time.\n\nIf provided, the `end` value is always normalized to the `America/New_York` timezone and adjusted to the nearest `timeframe` interval, e.g. seconds are always truncated and the time is rounded backwards to the nearest ineterval of `1Min`, `5Min`, `15Min`, or `1H`.\n\nWhen `intraday_reporting` is either `market_hours` or `extended_hours`, the `end` value is adjusted to not occur after session close on the specified day. For example if the `intraday_reporting` is `extended_hours`, and the timestamp specified is `2023-10-19T21:33:00-04:00`, `end` is adjusted to `2023-10-19T20:00:00-04:00`.\n\n`end` may be combined with `start` or `period`.\n\nProviding all of `start`, `end`, and `period` is invalid.\n"},{"schema":{"type":"string"},"in":"query","name":"extended_hours","description":"**deprecated**: Users are strongly advised to **rely on the `intraday_reporting` query parameter** for better control\nof the reporting range.\n\nIf true, include extended hours in the result. This is effective only for timeframe less than 1D.\n"},{"schema":{"type":"string"},"in":"query","name":"cashflow_types","description":"The cashflow activities to include in the report. One of 'ALL', 'NONE', or a comma-separated list of activity types."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioHistory"}}}}},"operationId":"getAccountPortfolioHistory","description":"Returns timeseries data about equity and profit/loss (P/L) of the account in requested timespan."}},"/v2/watchlists":{"get":{"tags":["Watchlists"],"summary":"Get All Watchlists","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"examples":{"example-1":{"value":[{"id":"3174d6df-7726-44b4-a5bd-7fda5ae6e009","account_id":"abe25343-a7ba-4255-bdeb-f7e013e9ee5d","created_at":"2022-01-31T21:49:05.14628Z","updated_at":"2022-01-31T21:49:05.14628Z","name":"Primary Watchlist"}]}},"schema":{"type":"array","items":{"$ref":"#/components/schemas/WatchlistWithoutAsset"}}}}}},"operationId":"getWatchlists","description":"Returns the list of watchlists registered under the account."},"post":{"tags":["Watchlists"],"summary":"Create Watchlist","description":"Create a new watchlist with initial set of assets.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWatchlistRequest"}}}},"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"postWatchlist"}},"/v2/watchlists/{watchlist_id}":{"get":{"tags":["Watchlists"],"summary":"Get Watchlist by ID","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"getWatchlistById","description":"Returns a watchlist identified by the ID."},"put":{"tags":["Watchlists"],"summary":"Update Watchlist By Id","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWatchlistRequest"}}}},"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"updateWatchlistById","description":"Update the name and/or content of watchlist"},"post":{"tags":["Watchlists"],"summary":"Add Asset to Watchlist","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","x-stoplight":{"id":"wb0v0f7q0ms5e"},"description":"the symbol name to add to the watchlist"}}}}}},"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"addAssetToWatchlist","description":"Append an asset for the symbol to the end of watchlist asset list"},"delete":{"tags":["Watchlists"],"summary":"Delete Watchlist By Id","parameters":[],"responses":{"204":{"description":"No Content"},"404":{"description":"Watchlist not found"}},"operationId":"deleteWatchlistById","description":"Delete a watchlist. This is a permanent deletion."},"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"watchlist_id","in":"path","required":true,"description":"watchlist id"}]},"/v2/watchlists:by_name":{"get":{"tags":["Watchlists"],"summary":"Get Watchlist by Name","parameters":[{"schema":{"type":"string"},"in":"query","name":"name","required":true,"description":"name of the watchlist"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"getWatchlistByName","description":"You can also call GET, PUT, POST and DELETE with watchlist name with another endpoint /v2/watchlists:by_name and query parameter name=<watchlist_name>, instead of /v2/watchlists/{watchlist_id} endpoints\n\nReturns a watchlist by name"},"put":{"tags":["Watchlists"],"summary":"Update Watchlist By Name","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWatchlistRequest"}}}},"parameters":[{"schema":{"type":"string"},"in":"query","name":"name","required":true,"description":"name of the watchlist"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"updateWatchlistByName","description":"Update the name and/or content of watchlist"},"post":{"tags":["Watchlists"],"summary":"Add Asset to Watchlist By Name","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","x-stoplight":{"id":"w4vw4ifmq7o9e"},"description":"the symbol name to add to the watchlist"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"query","name":"name","required":true,"description":"name of the watchlist"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"addAssetToWatchlistByName","description":"Append an asset for the symbol to the end of watchlist asset list"},"delete":{"tags":["Watchlists"],"summary":"Delete Watchlist By Name","parameters":[{"schema":{"type":"string"},"in":"query","name":"name","required":true,"description":"name of the watchlist"}],"responses":{"204":{"description":"No Content"}},"operationId":"deleteWatchlistByName","description":"Delete a watchlist. This is a permanent deletion."},"parameters":[]},"/v2/watchlists/{watchlist_id}/{symbol}":{"delete":{"tags":["Watchlists"],"summary":"Delete Symbol from Watchlist","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Returns the updated watchlist"}},"operationId":"removeAssetFromWatchlist","description":"Delete one entry for an asset by symbol name"},"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"watchlist_id","in":"path","required":true,"description":"Watchlist ID"},{"schema":{"type":"string"},"name":"symbol","in":"path","required":true,"description":"symbol name to remove from the watchlist content"}]},"/v2/account/configurations":{"get":{"tags":["Account Configurations"],"summary":"Get Account Configurations","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}}}},"operationId":"getAccountConfig","description":"gets the current account configuration values"},"patch":{"tags":["Account Configurations"],"summary":"Account Configurations","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}}}},"operationId":"patchAccountConfig","description":"Updates and returns the current account configuration values"}},"/v2/account/activities":{"get":{"summary":"Retrieve Account Activities","tags":["Account Activities"],"responses":{"200":{"description":"returns an array of Account activities","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TradingActivities"},{"$ref":"#/components/schemas/NonTradeActivities"}],"description":"Will be a mix of TradingActivity or NonTradeActivity objects based on what is passed in the activity_types parameter"}}}}}},"operationId":"getAccountActivities","description":"Returns a list of activities\n\nNotes:\n* Pagination is handled using the `page_token` and `page_size` parameters.\n* `page_token` represents the ID of the last item on your current page of results.\n   For example, if the ID of the last activity in your first response is `20220203000000000::045b3b8d-c566-4bef-b741-2bf598dd6ae7`, you would pass that value as `page_token` to retrieve the next page of results.","parameters":[{"name":"activity_types","in":"query","schema":{"type":"array","items":{"$ref":"#/components/schemas/ActivityType"}},"style":"form","explode":false,"description":"A comma-separated list of activity types used to filter the results."},{"name":"category","in":"query","schema":{"type":"string","enum":["trade_activity","non_trade_activity"]},"description":"The activity category. Cannot be used with \"activity_types\" parameter."},{"name":"date","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter activities by the activity date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported."},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"Get activities created before this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported."},{"name":"after","in":"query","schema":{"type":"string","format":"date-time"},"description":"Get activities created after this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported."},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc","example":"desc"},"description":"The chronological order of response based on the activity datetime."},{"name":"page_size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"description":"The maximum number of entries to return in the response."},{"name":"page_token","in":"query","schema":{"type":"string"},"description":"Token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results."}]}},"/v2/account/activities/{activity_type}":{"parameters":[{"schema":{"type":"string"},"name":"activity_type","in":"path","description":"The activity type you want to view entries for. A list of valid activity types can be found at the bottom of this page.","required":true}],"get":{"summary":"Retrieve Account Activities of Specific Type","tags":["Account Activities"],"responses":{"200":{"description":"returns an array of Account activities","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/TradingActivities"},{"$ref":"#/components/schemas/NonTradeActivities"}],"description":"Will be one of a TradingActivity or NonTradeActivity based on activity_type used in path"}}}}}},"operationId":"getAccountActivitiesByActivityType","description":"Returns account activity entries for a specific type of activity.","parameters":[{"name":"date","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter activities by the activity date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported."},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"Get activities created before this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported."},{"name":"after","in":"query","schema":{"type":"string","format":"date-time"},"description":"Get activities created after this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported."},{"name":"direction","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc","example":"desc"},"description":"The chronological order of response based on the activity datetime."},{"name":"page_size","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"description":"The maximum number of entries to return in the response."},{"name":"page_token","in":"query","schema":{"type":"string"},"description":"Token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results."}]}},"/v2/calendar":{"get":{"summary":"Get Market Calendar info","tags":["Calendar"],"parameters":[{"schema":{"type":"string","format":"date-time"},"in":"query","name":"start","description":"The first date to retrieve data for (inclusive)"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"end","description":"The last date to retrieve data for (inclusive)"},{"schema":{"type":"string"},"in":"query","name":"date_type","description":"Indicates what start and end mean. Enum: ‘TRADING’ or ‘SETTLEMENT’. Default value is ‘TRADING’. If TRADING is specified, returns a calendar whose trading date matches start, end. If SETTLEMENT is specified, returns the calendar whose settlement date matches start and end."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Calendar"}}}}}},"operationId":"getCalendar","description":"The calendar API serves the full list of market days from 1970 to 2029. It can also be queried by specifying a start and/or end time to narrow down the results. In addition to the dates, the response also contains the specific open and close times for the market days, taking into account early closures.\n\nReturns the market calendar."}},"/v2/clock":{"get":{"summary":"Get Market Clock info","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Clock"}}}}},"operationId":"getClock","description":"The clock API serves the current market timestamp, whether or not the market is currently open, as well as the times of the next market open and close.\n\nReturns the market clock.","tags":["Clock"]}},"/v2/assets":{"get":{"summary":"Get Assets","tags":["Assets"],"responses":{"200":{"description":"An array of asset objects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Assets"}}}}}},"operationId":"get-v2-assets","description":"The assets API serves as the master list of assets available for trade and data consumption from Alpaca. Assets are sorted by asset class, exchange and symbol.","parameters":[{"schema":{"type":"string"},"in":"query","name":"status","description":"e.g. “active”. By default, all statuses are included."},{"schema":{"type":"string"},"in":"query","name":"asset_class","description":"Defaults to us_equity."},{"schema":{"type":"string"},"in":"query","name":"exchange","description":"Optional AMEX, ARCA, BATS, NYSE, NASDAQ, NYSEARCA or OTC"},{"schema":{"type":"array","items":{"type":"string","enum":["ptp_no_exception","ptp_with_exception","ipo","has_options","options_late_close"]},"example":["ptp_no_exception","ipo"],"default":[]},"in":"query","name":"attributes","description":"Comma separated values to query for more than one attribute. Assets which have any of the given attributes will be included.\nSupported values are `ptp_no_exception`, `ptp_with_exception`, `ipo`, `has_options`, `options_late_close`.","explode":false}]}},"/v2/assets/{symbol_or_asset_id}":{"parameters":[{"schema":{"type":"string"},"name":"symbol_or_asset_id","in":"path","required":true,"description":"symbol or assetId. CUSIP is also accepted for US equities."}],"get":{"summary":"Get an Asset by ID or Symbol","tags":["Assets"],"responses":{"200":{"description":"An Asset object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assets"}}}},"404":{"description":"Not Found"}},"operationId":"get-v2-assets-symbol_or_asset_id","description":"Get the asset model for a given symbol or asset_id. The symbol or asset_id should be passed in as a path parameter.\n\n**Note**: For crypto, the symbol has to follow old symbology, e.g. BTCUSD.\n\n**Note**: For coin pairs, the symbol should be separated by spare symbol (/), e.g. BTC/USDT. Since spare is a special character in HTTP, use the URL encoded version instead, e.g. /v2/assets/BTC%2FUSDT"}},"/v2/options/contracts":{"get":{"summary":"Get Option Contracts","description":"This endpoint allows you to retrieve a list of option contracts based on various filtering criteria.\nBy default only active contracts that expire before the upcoming weekend are returned.\n","tags":["Assets"],"operationId":"get-options-contracts","parameters":[{"name":"underlying_symbols","in":"query","description":"Filter contracts by one or more underlying symbols.","schema":{"type":"string"},"example":"AAPL,SPY"},{"name":"show_deliverables","in":"query","description":"Include deliverables array in the response.","schema":{"type":"boolean"},"example":true},{"name":"status","in":"query","description":"Filter contracts by status (active/inactive). By default only active contracts are returned.","schema":{"type":"string","enum":["active","inactive"]},"example":"active"},{"name":"expiration_date","in":"query","description":"Filter contracts by the exact expiration date (format: YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2025-06-20"},{"name":"expiration_date_gte","in":"query","description":"Filter contracts with expiration date greater than or equal to the specified date.","schema":{"type":"string","format":"date"},"example":"2025-06-20"},{"name":"expiration_date_lte","in":"query","description":"Filter contracts with expiration date less than or equal to the specified date. By default this is set to the next weekend.","schema":{"type":"string","format":"date"},"example":"2025-06-20"},{"name":"root_symbol","in":"query","description":"Filter contracts by the root symbol.","schema":{"type":"string"},"example":"AAPL"},{"name":"type","in":"query","description":"Filter contracts by the type (call/put).","schema":{"type":"string","enum":["call","put"]},"example":"call"},{"name":"style","in":"query","description":"Filter contracts by the style (american/european).","schema":{"type":"string","enum":["american","european"]},"example":"american"},{"name":"strike_price_gte","in":"query","description":"Filter contracts with strike price greater than or equal to the specified value.","schema":{"type":"number"},"example":50},{"name":"strike_price_lte","in":"query","description":"Filter contracts with strike price less than or equal to the specified value.","schema":{"type":"number"},"example":100},{"$ref":"#/components/parameters/PageToken"},{"name":"limit","in":"query","description":"The number of contracts to limit per page (default=100, max=10000).","schema":{"type":"integer"},"example":100},{"name":"ppind","in":"query","schema":{"type":"boolean"},"example":"true","description":"The ppind(Penny Program Indicator) field indicates whether an option contract is eligible for penny price increments,\nwith `true` meaning it is part of the Penny Program and `false` meaning it is not."}],"responses":{"200":{"description":"Successful Response.","content":{"application/json":{"schema":{"type":"object","properties":{"option_contracts":{"type":"array","items":{"$ref":"#/components/schemas/OptionContract"}},"next_page_token":{"$ref":"#/components/schemas/NextPageToken"}},"required":["option_contracts"]}}}}}}},"/v2/options/contracts/{symbol_or_id}":{"parameters":[{"schema":{"type":"string"},"name":"symbol_or_id","in":"path","required":true,"description":"symbol or contract ID"}],"get":{"summary":"Get an option contract by ID or Symbol","description":"Get an option contract by symbol or contract ID. The symbol or id should be passed in as a path parameter.","tags":["Assets"],"operationId":"get-option-contract-symbol_or_id","responses":{"200":{"description":"An option contract","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionContract"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"Contract Not Found":{"value":{"code":40410000,"message":"option contract TSLA231110C00021000 not found"}}}}}}}}},"/v2/assets/fixed_income/us_treasuries":{"get":{"summary":"Get US treasuries","tags":["Assets"],"parameters":[{"name":"subtype","in":"query","schema":{"$ref":"#/components/schemas/treasury_subtype"}},{"name":"bond_status","in":"query","schema":{"$ref":"#/components/schemas/bond_status"}},{"name":"cusips","description":"A comma-separated list of CUSIPs with a limit of 1000.","in":"query","schema":{"type":"string"},"example":"912810UG1,912797PM3"},{"name":"isins","description":"A comma-separated list of ISINs with a limit of 1000.","in":"query","schema":{"type":"string"},"example":"US912810UG12,US912797PM34"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/us_treasuries_resp"}}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"operationId":"UsTreasuries","description":"Serves the list of US treasuries available at Alpaca. The response is sorted by ISIN."}},"/v2/corporate_actions/announcements/{id}":{"parameters":[{"schema":{"type":"string"},"name":"id","in":"path","required":true,"description":"The corporate announcement’s id"}],"get":{"summary":"Retrieve a Specific Announcement","deprecated":true,"tags":["Corporate Actions"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"id":"be3c368a-4c7c-4384-808e-f02c9f5a8afe","corporate_actions_id":"F58684224_XY37","ca_type":"Dividend","ca_sub_type":"DIV","initiating_symbol":"MLLAX","initiating_original_cusip":5.5275e+105,"target_symbol":"MLLAX","target_original_cusip":5.5275e+105,"declaration_date":"2021-01-05","expiration_date":"2021-01-12","record_date":"2021-01-13","payable_date":"2021-01-14","cash":"0.018","old_rate":"1","new_rate":"1"}},"properties":{"id":{"type":"string"},"corporate_actions_id":{"type":"string"},"ca_type":{"type":"string","description":"A comma-delimited list of Dividend, Merger, Spinoff, or Split."},"ca_sub_type":{"type":"string"},"initiating_symbol":{"type":"string"},"initiating_original_cusip":{"type":"string"},"target_symbol":{"type":"string"},"target_original_cusip":{"type":"string"},"declaration_date":{"type":"string"},"expiration_date":{"type":"string"},"record_date":{"type":"string"},"payable_date":{"type":"string"},"cash":{"type":"string"},"old_rate":{"type":"string"},"new_rate":{"type":"string"}}}}}}},"operationId":"get-v2-corporate_actions-announcements-id","description":"This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead."}},"/v2/corporate_actions/announcements":{"get":{"summary":"Retrieve Announcements","deprecated":true,"tags":["Corporate Actions"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"corporate_actions_id":{"type":"string"},"ca_type":{"type":"string"},"ca_sub_type":{"type":"string"},"initiating_symbol":{"type":"string"},"initiating_original_cusip":{"type":"string"},"target_symbol":{"type":"string"},"target_original_cusip":{"type":"string"},"declaration_date":{"type":"string"},"expiration_date":{"type":"string"},"record_date":{"type":"string"},"payable_date":{"type":"string"},"cash":{"type":"string"},"old_rate":{"type":"string"},"new_rate":{"type":"string"},"corporate_action_id":{"type":"string"},"ex_date":{"type":"string"}}},"x-examples":{"Example 1":[{"id":"be3c368a-4c7c-4384-808e-f02c9f5a8afe","corporate_actions_id":"F58684224_XY37","ca_type":"Dividend","ca_sub_type":"DIV","initiating_symbol":"MLLAX","initiating_original_cusip":5.5275e+105,"target_symbol":"MLLAX","target_original_cusip":5.5275e+105,"declaration_date":"2021-01-05","expiration_date":"2021-01-12","record_date":"2021-01-13","payable_date":"2021-01-14","cash":"0.018","old_rate":"1","new_rate":"1"},{"corporate_action_id":"48251W104_AD21","ca_type":"Dividend","ca_sub_type":"cash","initiating_symbol":"KKR","initiating_original_cusip":"G52830109","target_symbol":"KKR","target_original_cusip":"G52830109","declaration_date":"2021-11-01","ex_date":"2021-11-12","record_date":"2021-11-15","payable_date":"2021-11-30","cash":"0.145","old_rate":"1","new_rate":"1"}]}}}}}},"operationId":"get-v2-corporate_actions-announcements","description":"This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead.","parameters":[{"schema":{"type":"string"},"in":"query","name":"ca_types","description":"A comma-delimited list of Dividend, Merger, Spinoff, or Split.","required":true},{"schema":{"type":"string"},"in":"query","name":"since","description":"The start (inclusive) of the date range when searching corporate action announcements. This should follow the YYYY-MM-DD format. The date range is limited to 90 days.","required":true},{"schema":{"type":"string"},"in":"query","name":"until","description":"The end (inclusive) of the date range when searching corporate action announcements. This should follow the YYYY-MM-DD format. The date range is limited to 90 days.","required":true},{"schema":{"type":"string"},"in":"query","name":"symbol","description":"The symbol of the company initiating the announcement."},{"schema":{"type":"string"},"in":"query","name":"cusip","description":"The CUSIP of the company initiating the announcement."},{"schema":{"type":"string"},"in":"query","name":"date_type","description":"declaration_date, ex_date, record_date, or payable_date"}]}},"/v2/wallets":{"parameters":[{"name":"asset","in":"query","schema":{"type":"string"}},{"name":"network","in":"query","description":"Optional network identifier. Use to request wallets for a specific network when asset is a multi-chain crypto asset. If not specified, the default network (ehtereum) will be used.","schema":{"type":"string","enum":["ethereum","solana"]}}],"get":{"tags":["Crypto Funding"],"summary":"Retrieve Crypto Funding Wallets","description":"Lists wallets for the account given in the path parameter. If an asset is specified and no wallet for the account and asset pair exists one will be created. If no asset is specified only existing wallets will be listed for the account. An account may have at most one wallet per asset.","operationId":"listCryptoFundingWallets","responses":{"200":{"description":"A single wallet object if an asset is specified or an array of wallet objects if no asset is specified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoWallet"}}}}}}},"/v2/wallets/transfers":{"get":{"tags":["Crypto Funding"],"summary":"Retrieve Crypto Funding Transfers","description":"Returns an array of all transfers associated with the given account across all wallets.","operationId":"listCryptoFundingTransfers","responses":{"200":{"description":"An array of transfer objects","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}}}}},"post":{"tags":["Crypto Funding"],"summary":"Request a New Withdrawal","operationId":"createCryptoTransferForAccount","description":"Creates a withdrawal request. Note that outgoing withdrawals must be sent to a whitelisted address and you must whitelist addresses at least 24 hours in advance. If you attempt to withdraw funds to a non-whitelisted address then the transfer will be rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCryptoTransferRequest"}}}},"responses":{"200":{"description":"Successfully requested a transfer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}}}}}},"/v2/wallets/transfers/{transfer_id}":{"parameters":[{"schema":{"type":"string"},"name":"transfer_id","in":"path","required":true,"description":"The crypto transfer to retrieve"}],"get":{"tags":["Crypto Funding"],"summary":"Retrieve a Crypto Funding Transfer","description":"Returns a specific wallet transfer by passing into the query the transfer_id.","operationId":"getCryptoFundingTransfer","responses":{"200":{"description":"A single crypto transfer object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}}}}}},"/v2/wallets/whitelists":{"get":{"tags":["Crypto Funding"],"summary":"An array of whitelisted addresses","operationId":"listWhitelistedAddress","responses":{"200":{"description":"An array of whitelisted objects","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}}}},"post":{"tags":["Crypto Funding"],"summary":"Request a new whitelisted address","operationId":"createWhitelistedAddress","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","description":"The address to be whitelisted"},"asset":{"type":"string","description":"Symbol of underlying asset for the whitelisted address"}}}}}},"responses":{"200":{"description":"Successfully requested a whitelisted address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}}}}},"/v2/wallets/whitelists/{whitelisted_address_id}":{"parameters":[{"schema":{"type":"string"},"name":"whitelisted_address_id","in":"path","required":true,"description":"The whitelisted address to delete"}],"delete":{"tags":["Crypto Funding"],"summary":"Delete a whitelisted address","operationId":"deleteWhitelistedAddress","responses":{"200":{"description":"Successfully deleted a whitelisted address"}}}},"/v2/wallets/fees/estimate":{"get":{"tags":["Crypto Funding"],"summary":"Returns the estimated gas fee for a proposed transaction.","operationId":"getCryptoTransferEstimate","parameters":[{"name":"asset","in":"query","description":"The asset for the proposed transaction","schema":{"type":"string"}},{"name":"from_address","in":"query","description":"The originating address of the proposed transaction","schema":{"type":"string"}},{"name":"to_address","in":"query","description":"The destination address of the proposed transaction","schema":{"type":"string"}},{"name":"amount","in":"query","description":"The amount, denoted in the specified asset, of the proposed transaction","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fee":{"type":"string"}}}}}}}}},"/v2/perpetuals/wallets":{"parameters":[{"name":"asset","in":"query","schema":{"type":"string"}}],"get":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Retrieve Crypto Funding Wallets","description":"Lists wallets for the account given in the path parameter. If an asset is specified and no wallet for the account and asset pair exists one will be created. If no asset is specified only existing wallets will be listed for the account. An account may have at most one wallet per asset","operationId":"listCryptoPerpFundingWallets","responses":{"200":{"description":"A single wallet object if an asset is specified or an array of wallet objects if no asset is specified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoWallet"}}}}}}},"/v2/perpetuals/wallets/transfers":{"get":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Retrieve Crypto Funding Transfers","description":"Returns an array of all transfers associated with the given account across all wallets","operationId":"listCryptoPerpFundingTransfers","responses":{"200":{"description":"An array of transfer objects","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}}}}},"post":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Request a New Withdrawal","operationId":"createCryptoPerpTransferForAccount","description":"Creates a withdrawal request. Note that outgoing withdrawals must be sent to a whitelisted address and you must whitelist addresses at least 24 hours in advance. If you attempt to withdraw funds to a non-whitelisted address then the transfer will be rejected","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCryptoTransferRequest"}}}},"responses":{"200":{"description":"Successfully requested a transfer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}}}}}},"/v2/perpetuals/wallets/transfers/{transfer_id}":{"parameters":[{"schema":{"type":"string"},"name":"transfer_id","in":"path","required":true,"description":"The crypto transfer to retrieve"}],"get":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Retrieve a Crypto Funding Transfer","description":"Returns a specific wallet transfer by passing into the query the transfer_id","operationId":"getCryptoPerpFundingTransfer","responses":{"200":{"description":"A single crypto transfer object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}}}}}},"/v2/perpetuals/wallets/whitelists":{"get":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"An array of whitelisted addresses","operationId":"listWhitelistedPerpAddress","responses":{"200":{"description":"An array of whitelisted objects","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}}}},"post":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Request a new whitelisted address","operationId":"createWhitelistedPerpAddress","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","description":"The address to be whitelisted"},"asset":{"type":"string","description":"Symbol of underlying asset for the whitelisted address"}}}}}},"responses":{"200":{"description":"Successfully requested a whitelisted address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}}}}},"/v2/perpetuals/wallets/whitelists/{whitelisted_address_id}":{"parameters":[{"schema":{"type":"string"},"name":"whitelisted_address_id","in":"path","required":true,"description":"The whitelisted address to delete"}],"delete":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Delete a whitelisted address","operationId":"deleteWhitelistedPerpAddress","responses":{"200":{"description":"Successfully deleted a whitelisted address"}}}},"/v2/perpetuals/wallets/fees/estimate":{"get":{"tags":["Crypto Perpetuals Funding (Beta)"],"summary":"Returns the estimated gas fee for a proposed transaction","operationId":"getCryptoPerpTransferEstimate","parameters":[{"name":"asset","in":"query","description":"The asset for the proposed transaction","schema":{"type":"string"}},{"name":"from_address","in":"query","description":"The originating address of the proposed transaction","schema":{"type":"string"}},{"name":"to_address","in":"query","description":"The destination address of the proposed transaction","schema":{"type":"string"}},{"name":"amount","in":"query","description":"The amount, denoted in the specified asset, of the proposed transaction","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fee":{"type":"string"}}}}}}}}},"/v2/perpetuals/leverage":{"get":{"tags":["Crypto Perpetuals Leverage (Beta)"],"summary":"Get Account Leverage for an Asset","description":"Retrieves the current leverage setting for the crypto perpetuals account, specific to a given underlying asset. To use this endpoint, provide the 'symbol' of the asset as a query parameter. The system will return the asset's symbol and the integer value representing the current leverage applied to it within the account","operationId":"getCryptoPerpAccountLeverage","parameters":[{"name":"symbol","in":"query","description":"Symbol of underlying asset","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","description":"Symbol of underlying asset"},"leverage":{"type":"integer"}}}}}}}},"post":{"tags":["Crypto Perpetuals Leverage (Beta)"],"summary":"Set Account Leverage for an Asset","description":"Updates the leverage for the crypto perpetuals account for a specific underlying asset. Provide the 'symbol' of the asset and the desired 'leverage' (as an integer) using query parameters. The system will return the asset's symbol and the newly set leverage value upon successful update","operationId":"setCryptoPerpAccountLeverage","parameters":[{"name":"symbol","in":"query","description":"Symbol of underlying asset","schema":{"type":"string"}},{"name":"leverage","in":"query","description":"Leverage for the underlying asset","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","description":"Symbol of underlying asset"},"leverage":{"type":"integer"}}}}}}}}},"/v2/perpetuals/account_vitals":{"get":{"tags":["Crypto Perpetuals Account Vitals (Beta)"],"summary":"Retrieve Account Vitals","description":"Fetches key financial metrics for the crypto perpetuals account, providing a snapshot of its current status by detailing the relationship between the user's positions and their collateral. The response includes maintenance margin (USDT), collateral balance (USDT), total collateral (USDT), and profit/loss (USDT)","operationId":"getCryptoPerpAccountVitals","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"maintenance_margin":{"type":"number","description":"MaintenanceMargin (USDT) is the sum of each position's individual maintenance margin"},"collateral_balance":{"type":"integer","description":"CollateralBalance (USDT) is the sum of the unrealized PnL on each position plus TotalCollateral"},"total_collateral":{"type":"integer","description":"TotalCollateral (USDT) across all collateral assets"},"profit_loss":{"type":"integer","description":"ProfitAndLoss (USDT) is the net of realized and unrealized PnL across all positions"}}}}}}}}}},"components":{"securitySchemes":{"API_Key":{"name":"APCA-API-KEY-ID","type":"apiKey","in":"header","description":""},"API_Secret":{"name":"APCA-API-SECRET-KEY","type":"apiKey","in":"header","description":""}},"parameters":{"PageToken":{"name":"page_token","in":"query","required":false,"description":"Used for pagination, this token retrieves the next page of results. It is obtained from the response of the preceding page when additional pages are available.","schema":{"type":"string","example":"MA=="}}},"schemas":{"Account":{"title":"Account","type":"object","description":"The account API serves important information related to an account, including account status, funds available for trade, funds available for withdrawal, and various flags relevant to an account’s ability to trade. An account maybe be blocked for just for trades (trades_blocked flag) or for both trades and transfers (account_blocked flag) if Alpaca identifies the account to engaging in any suspicious activity. Also, in accordance with FINRA’s pattern day trading rule, an account may be flagged for pattern day trading (pattern_day_trader flag), which would inhibit an account from placing any further day-trades. Please note that cryptocurrencies are not eligible assets to be used as collateral for margin accounts and will require the asset be traded using cash only.\n","x-examples":{"example-1":{"account_blocked":false,"account_number":"010203ABCD","buying_power":"262113.632","cash":"-23140.2","created_at":"2019-06-12T22:47:07.99658Z","currency":"USD","daytrade_count":0,"balance_asof":"2023-09-27","daytrading_buying_power":"262113.632","equity":"103820.56","id":"e6fe16f3-64a4-4921-8928-cadf02f92f98","initial_margin":"63480.38","last_equity":"103529.24","last_maintenance_margin":"38000.832","long_market_value":"126960.76","maintenance_margin":"38088.228","multiplier":"4","pattern_day_trader":false,"portfolio_value":"103820.56","regt_buying_power":"80680.36","options_buying_power":"40340.18","short_market_value":"0","shorting_enabled":true,"sma":"0","status":"ACTIVE","trade_suspended_by_user":false,"trading_blocked":false,"transfers_blocked":false,"options_approved_level":2,"options_trading_level":1,"intraday_adjustments":"0","pending_reg_taf_fees":"0"}},"properties":{"id":{"type":"string","description":"Account Id.\n","format":"uuid"},"account_number":{"type":"string","description":"Account number."},"status":{"$ref":"#/components/schemas/AccountStatus"},"currency":{"type":"string","description":"USD\n","example":"USD"},"cash":{"description":"Cash Balance\n","type":"string"},"portfolio_value":{"description":"Total value of cash + holding positions (This field is deprecated. It is equivalent to the equity field.)","type":"string"},"non_marginable_buying_power":{"description":"Current available non-margin dollar buying power","type":"string","x-stoplight":{"id":"z0ydzt6yqegll"}},"accrued_fees":{"description":"The fees collected.","type":"string","x-stoplight":{"id":"b1gospbwoz961"}},"pending_transfer_in":{"description":"Cash pending transfer in.","type":"string","x-stoplight":{"id":"83ckvzqu3jewp"}},"pending_transfer_out":{"description":"Cash pending transfer out.","type":"string","x-stoplight":{"id":"gkxijaueofvdg"}},"pattern_day_trader":{"type":"boolean","description":"Whether or not the account has been flagged as a pattern day trader"},"trade_suspended_by_user":{"type":"boolean","description":"User setting. If true, the account is not allowed to place orders."},"trading_blocked":{"type":"boolean","description":"If true, the account is not allowed to place orders.\n"},"transfers_blocked":{"type":"boolean","description":"If true, the account is not allowed to request money transfers."},"account_blocked":{"type":"boolean","description":"If true, the account activity by user is prohibited."},"created_at":{"type":"string","description":"Timestamp this account was created at\n","format":"date-time"},"shorting_enabled":{"type":"boolean","description":"Flag to denote whether or not the account is permitted to short"},"long_market_value":{"description":"Real-time MtM value of all long positions held in the account\n","type":"string"},"short_market_value":{"description":"Real-time MtM value of all short positions held in the account","type":"string"},"equity":{"description":"Cash + long_market_value + short_market_value","type":"string"},"last_equity":{"description":"Equity as of previous trading day at 16:00:00 ET","type":"string"},"multiplier":{"description":"Buying power multiplier that represents account margin classification; valid values 1 (standard limited margin account with 1x buying power), 2 (reg T margin account with 2x intraday and overnight buying power; this is the default for all non-PDT accounts with $2,000 or more equity), 4 (PDT account with 4x intraday buying power and 2x reg T overnight buying power)","type":"string"},"buying_power":{"description":"Current available $ buying power; If multiplier = 4, this is your daytrade buying power which is calculated as (last_equity - (last) maintenance_margin) * 4; If multiplier = 2, buying_power = max(equity – initial_margin,0) * 2; If multiplier = 1, buying_power = cash","type":"string"},"initial_margin":{"description":"Reg T initial margin requirement (continuously updated value)","type":"string"},"maintenance_margin":{"description":"Maintenance margin requirement (continuously updated value)","type":"string"},"sma":{"type":"string","description":"Value of special memorandum account (will be used at a later date to provide additional buying_power)"},"daytrade_count":{"type":"integer","description":"The current number of daytrades that have been made in the last 5 trading days (inclusive of today)"},"balance_asof":{"type":"string","example":"2021-04-01","description":"The date of the snapshot for `last_*` fields"},"last_maintenance_margin":{"description":"Your maintenance margin requirement on the previous trading day","type":"string"},"daytrading_buying_power":{"description":"Your buying power for day trades (continuously updated value)","type":"string"},"regt_buying_power":{"description":"Your buying power under Regulation T (your excess equity - equity minus margin value - times your margin multiplier)\n","type":"string"},"options_buying_power":{"description":"Your buying power for options trading\n","type":"string"},"options_approved_level":{"type":"integer","example":3,"description":"The options trading level that was approved for this account.\n0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\n","enum":[0,1,2,3]},"options_trading_level":{"type":"integer","example":3,"description":"The effective options trading level of the account.\nThis is the minimum between account options_approved_level and account configurations max_options_trading_level.\n0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\n","enum":[0,1,2,3]},"intraday_adjustments":{"type":"string","example":"0","description":"The intraday adjustment by non_trade_activities such as fund deposit/withdraw.\n"},"pending_reg_taf_fees":{"type":"string","description":"Pending regulatory fees for the account.\n"}},"required":["id","status"]},"AccountStatus":{"type":"string","title":"AccountStatus","enum":["ONBOARDING","SUBMISSION_FAILED","SUBMITTED","ACCOUNT_UPDATED","APPROVAL_PENDING","ACTIVE","REJECTED"],"description":"An enum representing the various possible account status values.\n\nMost likely, the account status is ACTIVE unless there is any problem. The account status may get in ACCOUNT_UPDATED when personal information is being updated from the dashboard, in which case you may not be allowed trading for a short period of time until the change is approved.\n\n- ONBOARDING\n  The account is onboarding.\n- SUBMISSION_FAILED\n  The account application submission failed for some reason.\n- SUBMITTED\n  The account application has been submitted for review.\n- ACCOUNT_UPDATED\n  The account information is being updated.\n- APPROVAL_PENDING\n  The final account approval is pending.\n- ACTIVE\n  The account is active for trading.\n- REJECTED\n  The account application has been rejected.","x-examples":{"example-1":"ACTIVE"},"example":"ACTIVE"},"AccountConfigurations":{"title":"AccountConfigurations","type":"object","x-examples":{"example-1":{"dtbp_check":"entry","trade_confirm_email":"all","suspend_trade":false,"no_shorting":false,"fractional_trading":true,"max_margin_multiplier":"4","pdt_check":"entry"}},"description":"The account configuration API provides custom configurations about your trading account settings. These configurations control various allow you to modify settings to suit your trading needs.","properties":{"dtbp_check":{"type":"string","description":"both, entry, or exit. Controls Day Trading Margin Call (DTMC) checks.","enum":["both","entry","exit"]},"trade_confirm_email":{"type":"string","description":"all or none. If none, emails for order fills are not sent."},"suspend_trade":{"type":"boolean","description":"If true, new orders are blocked."},"no_shorting":{"type":"boolean","description":"If true, account becomes long-only mode."},"fractional_trading":{"type":"boolean","description":"If true, account is able to participate in fractional trading"},"max_margin_multiplier":{"type":"string","description":"Can be \"1\", \"2\", or \"4\""},"max_options_trading_level":{"type":"integer","description":"The desired maximum options trading level. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.","enum":[0,1,2,3]},"pdt_check":{"type":"string","example":"entry","description":"`both`, `entry`, or `exit`. If entry orders will be rejected on entering a position if it could result in PDT being set for the account. exit will reject exiting orders if they would result in PDT being set."},"ptp_no_exception_entry":{"type":"boolean","x-stoplight":{"id":"8qvrtnzouzp80"},"description":"If set to true then Alpaca will accept orders for PTP symbols with no exception. Default is false."}}},"TradingActivities":{"title":"AccountTradingActivities","type":"object","x-examples":{"example-1":{"id":"20220202135509981::2d7be4ff-d1f3-43e9-856a-0f5cf5c5088e","activity_type":"FILL","transaction_time":"2022-02-02T18:55:09.981482Z","type":"fill","price":"174.78","qty":"2","side":"buy","symbol":"AAPL","leaves_qty":"0","order_id":"b5abe576-6a8a-49f3-a353-46b72c1ccae9","cum_qty":"2","order_status":"filled"}},"properties":{"activity_type":{"$ref":"#/components/schemas/ActivityType"},"id":{"type":"string","description":"An id for the activity. Always in “::” format. Can be sent as page_token in requests to facilitate the paging of results."},"cum_qty":{"description":"The cumulative quantity of shares involved in the execution.","type":"string"},"leaves_qty":{"type":"string","description":"For partially_filled orders, the quantity of shares that are left to be filled.\n"},"price":{"type":"string","description":"The per-share price that the trade was executed at."},"qty":{"type":"string","description":"The number of shares involved in the trade execution."},"side":{"type":"string","description":"buy or sell"},"symbol":{"type":"string","description":"The symbol of the security being traded.","example":"AAPL"},"transaction_time":{"type":"string","description":"The time at which the execution occurred.","format":"date-time"},"order_id":{"type":"string","description":"The id for the order that filled.","format":"uuid"},"type":{"type":"string","description":"fill or partial_fill","enum":["fill","partial_fill"],"example":"fill"},"order_status":{"$ref":"#/components/schemas/OrderStatus"}}},"NonTradeActivities":{"title":"AccountNonTradeActivities","type":"object","properties":{"activity_type":{"$ref":"#/components/schemas/ActivityType"},"activity_sub_type":{"$ref":"#/components/schemas/ActivitySubType"},"id":{"type":"string","description":"An ID for the activity, always in “::” format. Can be sent as page_token in requests to facilitate the paging of results."},"date":{"type":"string","description":"The date on which the activity occurred or on which the transaction associated with the activity settled.","format":"date-time"},"net_amount":{"type":"string","description":"The net amount of money (positive or negative) associated with the activity."},"symbol":{"type":"string","description":"The symbol of the security involved with the activity. Not present for all activity types."},"cusip":{"type":"string","description":"The CUSIP of the security involved with the activity. Not present for all activity types."},"qty":{"type":"string","description":"For dividend activities, the number of shares that contributed to the payment. Not present for other activity types.\n"},"per_share_amount":{"type":"string","description":"For dividend activities, the average amount paid per share. Not present for other activity types."},"group_id":{"type":"string","description":"ID used to link activities who share a sibling relationship."},"status":{"type":"string","description":"The activity status.","enum":["executed","correct","canceled"]},"created_at":{"type":"string","format":"date-time","description":"Valid only for non-trading activity types. Null for trading activites."}},"x-examples":{"example-1":{"activity_type":"DIV","activity_sub_type":"SDIV","id":"20190801011955195::5f596936-6f23-4cef-bdf1-3806aae57dbf","date":"2019-08-01","net_amount":"1.02","symbol":"T","qty":"2","per_share_amount":"0.51","status":"executed","created_at":"2021-05-10T14:01:04.650275Z"}}},"ActivityType":{"type":"string","title":"ActivityType","description":"- FILL\n  Order fills (both partial and full fills)\n\n- TRANS\n  Cash transactions (both CSD and CSW)\n\n- MISC\n  Miscellaneous or rarely used activity types (All types except those in TRANS, DIV, or FILL)\n\n- ACATC\n  ACATS IN/OUT (Cash)\n\n- ACATS\n  ACATS IN/OUT (Securities)\n\n- CFEE\n  Crypto fee\n\n- CSD\n  Cash deposit(+)\n\n- CSW\n  Cash withdrawal(-)\n\n- DIV\n  Dividends\n\n- DIVCGL\n  Dividend (capital gain long term)\n\n- DIVCGS\n  Dividend (capital gain short term)\n\n- DIVFEE\n  Dividend fee\n\n- DIVFT\n  Dividend adjusted (Foreign Tax Withheld)\n\n- DIVNRA\n  Dividend adjusted (NRA Withheld)\n\n- DIVROC\n  Dividend return of capital\n\n- DIVTW\n  Dividend adjusted (Tefra Withheld)\n\n- DIVTXEX\n  Dividend (tax exempt)\n\n- FEE\n  Fee denominated in USD\n\n- INT\n  Interest (credit/margin)\n\n- INTNRA\n  Interest adjusted (NRA Withheld)\n\n- INTTW\n  Interest adjusted (Tefra Withheld)\n\n- JNL\n  Journal entry\n\n- JNLC\n  Journal entry (cash)\n\n- JNLS\n  Journal entry (stock)\n\n- MA\n  Merger/Acquisition\n\n- NC\n  Name change\n\n- OPASN\n  Option assignment\n\n- OPCA\n  Option corporate action\n\n- OPCSH\n  Option cash deliverable for non-standard contracts\n\n- OPEXC\n  Option exercise\n\n- OPEXP\n  Option expiration\n\n- OPTRD\n  Option trade\n\n- PTC\n  Pass Thru Charge\n\n- PTR\n  Pass Thru Rebate\n\n- REORG\n  Reorg CA\n\n- SPIN\n  Stock spinoff\n\n- SPLIT\n  Stock split","enum":["FILL","TRANS","MISC","ACATC","ACATS","CFEE","CSD","CSW","DIV","DIVCGL","DIVCGS","DIVFEE","DIVFT","DIVNRA","DIVROC","DIVTW","DIVTXEX","FEE","INT","INTNRA","INTTW","JNL","JNLC","JNLS","MA","NC","OPASN","OPCA","OPCSH","OPEXC","OPEXP","OPTRD","PTC","PTR","REORG","SPIN","SPLIT"],"x-examples":{"example-1":"FILL"}},"ActivitySubType":{"title":"ActivitySubType","type":"string","description":"Represents a more specific classification to the `activity_type`.\nThis field is optional and may not always be populated, depending on the activity type and the available data.\nEach `activity_type` has a set of valid `activity_sub_type` values.\n\nFull mapping of `activity_type` to `activity_sub_type`:\n\n- **DIV**: Dividend activity sub-types:\n  - **CDIV**: Cash Dividend\n  - **SDIV**: Stock Dividend\n\n- **FEE**: Fee-related activity sub-types:\n  - **REG**: Regulatory Fee\n  - **TAF**: Trading Activity Fee\n  - **LCT**: Local Currency Trading Fee\n  - **ORF**: Options Regulatory Fee\n  - **OCC**: Options Clearing Corporation Fee\n  - **NRC**: Non-Retail Commission Fee\n  - **NRV**: Non-Retail Venue Fee\n  - **COM**: Commission\n  - **CAT**: Consolidated Audit Trail Fee\n\n- **INT**: Interest-related activity sub-types:\n  - **MGN**: Margin Interest\n  - **CDT**: Credit Interest\n  - **SWP**: Sweep Interest\n  - **QII**: Qualified Interest\n\n- **MA**: Merger and Acquisition activity sub-types:\n  - **CMA**: Cash Merger\n  - **SMA**: Stock Merger\n  - **SCMA**: Stock & Cash Merger\n\n- **NC**: Name Change activity sub types\n  - **SNC**: Symbol Name Change\n  - **CNC**: CUSIP Name Change\n  - **SCNC**: Symbol & CUSIP Name Change\n\n- **OPCA**: Option Corporate Action activity sub-types:\n  - **DIV.CDIV**: Cash Dividend\n  - **DIV.SDIV**: Stock Dividend\n  - **MA.CMA**: Cash Merger\n  - **MA.SMA**: Stock Merger\n  - **MA.SCMA**: Stock & Cash Merger\n  - **NC.CNC**: CUSIP Name Change\n  - **NC.SNC**: Symbol Name Change\n  - **NC.SCNC**: Symbol & CUSIP Name Change\n  - **SPIN**: Spin-off\n  - **SPLIT.FSPLIT**: Forward Stock Split\n  - **SPLIT.RSPLIT**: Reverse Stock Split\n  - **SPLIT.USPLIT**: Unit Split\n\n- **REORG**: Reorganization activity sub-types:\n  - **WRM**: Worthless Removal\n\n- **SPLIT**: Stock Split activity sub-types:\n  - **FSPLIT**: Forward Stock Split\n  - **RSPLIT**: Reverse Stock Split\n  - **USPLIT**: Unit Split\n\n- **VOF**: Voluntary Offering activity sub-types:\n  - **VTND**: Tender Offer\n  - **VWRT**: Warrant Exercise\n  - **VRGT**: Rights Offer\n  - **VEXH**: Exchange Offer\n\n- **WH**: Withholding activity sub-types:\n  - **SWH**: State Withholding\n  - **FWH**: Federal Withholding\n  - **SLWH**: Sales Withholding"},"Order":{"description":"The Orders API allows a user to monitor, place and cancel their orders with Alpaca.\n\nEach order has a unique identifier provided by the client. This client-side unique order ID will be automatically generated by the system if not provided by the client, and will be returned as part of the order object along with the rest of the fields described below. Once an order is placed, it can be queried using the client-side order ID to check the status.\n\nUpdates on open orders at Alpaca will also be sent over the streaming interface, which is the recommended method of maintaining order state.","type":"object","title":"Order","properties":{"id":{"type":"string","description":"Order ID"},"client_order_id":{"type":"string","description":"Client unique order ID","maxLength":128},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true},"submitted_at":{"type":"string","format":"date-time","nullable":true},"filled_at":{"type":"string","format":"date-time","nullable":true},"expired_at":{"type":"string","format":"date-time","nullable":true},"canceled_at":{"type":"string","format":"date-time","nullable":true},"failed_at":{"type":"string","format":"date-time","nullable":true},"replaced_at":{"type":"string","format":"date-time","nullable":true},"replaced_by":{"type":"string","format":"uuid","description":"The order ID that this order was replaced by","nullable":true},"replaces":{"type":"string","format":"uuid","description":"The order ID that this order replaces","nullable":true},"asset_id":{"type":"string","format":"uuid","description":"Asset ID (For options this represents the option contract ID)"},"symbol":{"type":"string","minLength":1,"description":"Asset symbol, required for all order classes except for `mleg`"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"notional":{"type":"string","minLength":1,"description":"Ordered notional amount. If entered, qty will be null. Can take up to 9 decimal points.","nullable":true},"qty":{"type":"string","minLength":1,"description":"Ordered quantity. If entered, notional will be null. Can take up to 9 decimal points. Required if order class is `mleg`.","nullable":true},"filled_qty":{"type":"string","minLength":1,"description":"Filled quantity"},"filled_avg_price":{"type":"string","description":"Filled average price","nullable":true},"order_class":{"$ref":"#/components/schemas/OrderClass"},"order_type":{"type":"string","deprecated":true,"description":"Deprecated in favour of the field \"type\" "},"type":{"$ref":"#/components/schemas/OrderType"},"side":{"$ref":"#/components/schemas/OrderSide"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","description":"Limit price","nullable":true},"stop_price":{"description":"Stop price","type":"string","nullable":true},"status":{"$ref":"#/components/schemas/OrderStatus"},"extended_hours":{"type":"boolean","description":"If true, eligible for execution outside regular trading hours."},"legs":{"type":"array","description":"When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order. Otherwise, null. Required if order class is `mleg`.","nullable":true,"items":{"$ref":"#/components/schemas/OrderLeg"}},"trail_percent":{"type":"string","description":"The percent value away from the high water mark for trailing stop orders.","nullable":true},"trail_price":{"type":"string","description":"The dollar value away from the high water mark for trailing stop orders.","nullable":true},"hwm":{"type":"string","description":"The highest (lowest) market price seen since the trailing stop order was submitted.","nullable":true},"position_intent":{"$ref":"#/components/schemas/PositionIntent"}},"required":["notional","type","time_in_force"]},"OrderLeg":{"description":"This is copy of Order response schemas as a workaround of displaying issue of nested Order recursively for legs","type":"object","title":"Order","properties":{"id":{"type":"string","description":"Order ID"},"client_order_id":{"type":"string","description":"Client unique order ID","maxLength":128},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true},"submitted_at":{"type":"string","format":"date-time","nullable":true},"filled_at":{"type":"string","format":"date-time","nullable":true},"expired_at":{"type":"string","format":"date-time","nullable":true},"canceled_at":{"type":"string","format":"date-time","nullable":true},"failed_at":{"type":"string","format":"date-time","nullable":true},"replaced_at":{"type":"string","format":"date-time","nullable":true},"replaced_by":{"type":"string","format":"uuid","description":"The order ID that this order was replaced by","nullable":true},"replaces":{"type":"string","format":"uuid","description":"The order ID that this order replaces","nullable":true},"asset_id":{"type":"string","format":"uuid","description":"Asset ID (For options this represents the option contract ID)"},"symbol":{"type":"string","minLength":1,"description":"Asset symbol"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"notional":{"type":"string","minLength":1,"description":"Ordered notional amount. If entered, qty will be null. Can take up to 9 decimal points.","nullable":true},"qty":{"type":"string","minLength":1,"description":"Ordered quantity. If entered, notional will be null. Can take up to 9 decimal points.","nullable":true},"filled_qty":{"type":"string","minLength":1,"description":"Filled quantity"},"filled_avg_price":{"type":"string","description":"Filled average price","nullable":true},"order_class":{"$ref":"#/components/schemas/OrderClass"},"order_type":{"type":"string","deprecated":true,"description":"Deprecated in favour of the field \"type\" "},"type":{"$ref":"#/components/schemas/OrderType"},"side":{"$ref":"#/components/schemas/OrderSide"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","description":"Limit price","nullable":true},"stop_price":{"description":"Stop price","type":"string","nullable":true},"status":{"$ref":"#/components/schemas/OrderStatus"},"extended_hours":{"type":"boolean","description":"If true, eligible for execution outside regular trading hours."},"legs":{"type":"array","description":"When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order. Otherwise, null.","nullable":true},"trail_percent":{"type":"string","description":"The percent value away from the high water mark for trailing stop orders.","nullable":true},"trail_price":{"type":"string","description":"The dollar value away from the high water mark for trailing stop orders.","nullable":true},"hwm":{"type":"string","description":"The highest (lowest) market price seen since the trailing stop order was submitted.","nullable":true},"position_intent":{"$ref":"#/components/schemas/PositionIntent"}},"required":["symbol","notional","qty","type","side","time_in_force"]},"MLegOrderLeg":{"description":"Represents an individual leg of a multi-leg options order.","type":"object","title":"MLegOrderLeg","properties":{"side":{"$ref":"#/components/schemas/OrderSide"},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"symbol":{"type":"string","description":"symbol or asset ID to identify the asset to trade"},"ratio_qty":{"type":"string","description":"proportional quantity of this leg in relation to the overall multi-leg order qty"}},"required":["symbol","ratio_qty"]},"AdvancedInstructions":{"description":"Advanced instructions for Elite Smart Router: https://docs.alpaca.markets/docs/alpaca-elite-smart-router","type":"object","title":"AdvancedInstructions","properties":{"algorithm":{"description":"The advanced routing algorithm to use for the order","type":"string","example":"DMA","enum":["DMA","TWAP","VWAP"]},"destination":{"description":"Target exchange for order execution","type":"string","example":"NYSE","enum":["NYSE","NASDAQ","ARCA"]},"display_qty":{"description":"Maximum shares/contracts displayed on the exchange at any time. Must be in round lot increments","type":"string","format":"decimal","example":"100"},"start_time":{"description":"When the algorithm is to start executing. Must be within current market trading hours","type":"string","format":"date-time","example":"2025-07-21T09:30:00-04:00"},"end_time":{"description":"When the algorithm is to be done executing. Must be within current market trading hours","type":"string","format":"date-time","example":"2025-07-21T15:30:00-04:00"},"max_percentage":{"description":"Maximum percentage of the ticker's period volume this order might participate in. Must be 0 < max_percentage < 1, with up to 3 decimal points precision.","type":"string","format":"decimal","example":"0.314"}},"x-examples":{"example-1":{"algorithm":"DMA","destination":"NYSE","display_qty":100},"example-2":{"algorithm":"TWAP","start_time":"2025-07-21T09:30:00-04:00","end_time":"2025-07-21T15:30:00-04:00","max_percentage":0.314},"example-3":{"algorithm":"VWAP","start_time":"2025-07-21T09:30:00-04:00","end_time":"2025-07-21T15:30:00-04:00","max_percentage":0.314}}},"OrderType":{"type":"string","enum":["market","limit","stop","stop_limit","trailing_stop"],"example":"market","description":"The order types supported by Alpaca vary based on the order's security type. The following provides a comprehensive breakdown of the supported order types for each category:\n - Equity trading: market, limit, stop, stop_limit, trailing_stop.\n - Options trading: market, limit.\n - Multileg Options trading: market, limit.\n - Crypto trading: market, limit, stop_limit.","title":"OrderType"},"OrderSide":{"type":"string","enum":["buy","sell"],"example":"buy","title":"OrderSide","description":"Represents which side this order was on:\n- buy\n- sell\nRequired for all order classes except for mleg."},"OrderClass":{"type":"string","enum":["simple","bracket","oco","oto","mleg",""],"example":"bracket","description":"The order classes supported by Alpaca vary based on the order's security type. The following provides a comprehensive breakdown of the supported order classes for each category:\n  - Equity trading: simple (or \"\"), oco, oto, bracket.\n  - Options trading:\n    - simple (or \"\")\n    - mleg (required for multi-leg complex option strategies)\n  - Crypto trading: simple (or \"\").","title":"OrderClass"},"OrderStatus":{"type":"string","title":"OrderStatus","description":"An order executed through Alpaca can experience several status changes during its lifecycle. The most common statuses are described in detail below:\n\n- new\n  The order has been received by Alpaca, and routed to exchanges for execution. This is the usual initial state of an order.\n\n- partially_filled\n  The order has been partially filled.\n\n- filled\n  The order has been filled, and no further updates will occur for the order.\n\n- done_for_day\n  The order is done executing for the day, and will not receive further updates until the next trading day.\n\n- canceled\n  The order has been canceled, and no further updates will occur for the order. This can be either due to a cancel request by the user, or the order has been canceled by the exchanges due to its time-in-force.\n\n- expired\n  The order has expired, and no further updates will occur for the order.\n\n- replaced\n  The order was replaced by another order, or was updated due to a market event such as corporate action.\n\n- pending_cancel\n  The order is waiting to be canceled.\n\n- pending_replace\n  The order is waiting to be replaced by another order. The order will reject cancel request while in this state.\n\nLess common states are described below. Note that these states only occur on very rare occasions, and most users will likely never see their orders reach these states:\n\n- accepted\n  The order has been received by Alpaca, but hasn’t yet been routed to the execution venue. This could be seen often out side of trading session hours.\n\n- pending_new\n  The order has been received by Alpaca, and routed to the exchanges, but has not yet been accepted for execution. This state only occurs on rare occasions.\n\n- accepted_for_bidding\n  The order has been received by exchanges, and is evaluated for pricing. This state only occurs on rare occasions.\n\n- stopped\n  The order has been stopped, and a trade is guaranteed for the order, usually at a stated price or better, but has not yet occurred. This state only occurs on rare occasions.\n\n- rejected\n  The order has been rejected, and no further updates will occur for the order. This state occurs on rare occasions and may occur based on various conditions decided by the exchanges.\n\n- suspended\n  The order has been suspended, and is not eligible for trading. This state only occurs on rare occasions.\n\n- calculated\n  The order has been completed for the day (either filled or done for day), but remaining settlement calculations are still pending. This state only occurs on rare occasions.\n\n\nAn order may be canceled through the API up until the point it reaches a state of either filled, canceled, or expired.","enum":["new","partially_filled","filled","done_for_day","canceled","expired","replaced","pending_cancel","pending_replace","accepted","pending_new","accepted_for_bidding","stopped","rejected","suspended","calculated"],"example":"new"},"TimeInForce":{"type":"string","title":"TimeInForce","description":"The Time-In-Force values supported by Alpaca vary based on the order's security type. Here is a breakdown of the supported TIFs for each specific security type:\n- Equity trading: day, gtc, opg, cls, ioc, fok.\n- Options trading: day.\n- Crypto trading: gtc, ioc.\n\nBelow are the descriptions of each TIF:\n- day:\n  A day order is eligible for execution only on the day it is live. By default, the order is only valid during Regular Trading Hours (9:30am - 4:00pm ET). If unfilled after the closing auction, it is automatically canceled. If submitted after the close, it is queued and submitted the following trading day. However, if marked as eligible for extended hours, the order can also execute during supported extended hours.\n\n- gtc:\n  The order is good until canceled. Non-marketable GTC limit orders are subject to price adjustments to offset corporate actions affecting the issue. We do not currently support Do Not Reduce(DNR) orders to opt out of such price adjustments.\n\n- opg:\n  Use this TIF with a market/limit order type to submit “market on open” (MOO) and “limit on open” (LOO) orders. This order is eligible to execute only in the market opening auction. Any unfilled orders after the open will be cancelled. OPG orders submitted after 9:28am but before 7:00pm ET will be rejected. OPG orders submitted after 7:00pm will be queued and routed to the following day’s opening auction. On open/on close orders are routed to the primary exchange. Such orders do not necessarily execute exactly at 9:30am / 4:00pm ET but execute per the exchange’s auction rules.\n\n- cls:\n  Use this TIF with a market/limit order type to submit “market on close” (MOC) and “limit on close” (LOC) orders. This order is eligible to execute only in the market closing auction. Any unfilled orders after the close will be cancelled. CLS orders submitted after 3:50pm but before 7:00pm ET will be rejected. CLS orders submitted after 7:00pm will be queued and routed to the following day’s closing auction. Only available with API v2.\n\n- ioc:\n  An Immediate Or Cancel (IOC) order requires all or part of the order to be executed immediately. Any unfilled portion of the order is canceled. Only available with API v2. Most market makers who receive IOC orders will attempt to fill the order on a principal basis only, and cancel any unfilled balance. On occasion, this can result in the entire order being cancelled if the market maker does not have any existing inventory of the security in question.\n\n- fok:\n  A Fill or Kill (FOK) order is only executed if the entire order quantity can be filled, otherwise the order is canceled. Only available with API v2.","enum":["day","gtc","opg","cls","ioc","fok"],"example":"day"},"PositionIntent":{"type":"string","enum":["buy_to_open","buy_to_close","sell_to_open","sell_to_close"],"example":"buy_to_open","title":"PositionIntent","description":"Represents the desired position strategy."},"Assets":{"description":"The assets API serves as the master list of assets available for trade and data consumption from Alpaca. Assets are sorted by asset class, exchange and symbol. Some assets are only available for data consumption via Polygon, and are not tradable with Alpaca. These assets will be marked with the flag tradable=false.\n","type":"object","x-examples":{"example-1":{"id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","class":"us_equity","exchange":"NASDAQ","symbol":"AAPL","name":"Apple Inc. Common Stock","status":"active","tradable":true,"marginable":true,"shortable":true,"easy_to_borrow":true,"fractionable":true}},"title":"Assets","properties":{"id":{"type":"string","format":"uuid","description":"Asset ID"},"class":{"$ref":"#/components/schemas/AssetClass"},"cusip":{"type":"string","nullable":true,"description":"The CUSIP identifier for the asset (US Equities only).\nTo request a specific CUSIP, please reach out to Alpaca support.\n","example":"987654321"},"exchange":{"$ref":"#/components/schemas/Exchange"},"symbol":{"type":"string","description":"The symbol of the asset","example":"AAPL"},"name":{"type":"string","minLength":1,"description":"The official name of the asset"},"status":{"type":"string","description":"active or inactive","example":"active","enum":["active","inactive"]},"tradable":{"type":"boolean","description":"Asset is tradable on Alpaca or not"},"marginable":{"type":"boolean","description":"Asset is marginable or not"},"shortable":{"type":"boolean","description":"Asset is shortable or not"},"easy_to_borrow":{"type":"boolean","description":"Asset is easy-to-borrow or not (filtering for easy_to_borrow = True is the best way to check whether the name is currently available to short at Alpaca)."},"fractionable":{"type":"boolean","description":"Asset is fractionable or not"},"maintenance_margin_requirement":{"type":"number","x-stoplight":{"id":"kujwjd2dcq9bn"},"deprecated":true,"description":"**deprecated**: Please use margin_requirement_long or margin_requirement_short instead. Note that these fields are of type string.\nShows the margin requirement percentage for the asset (equities only).\n"},"margin_requirement_long":{"type":"string","description":"The margin requirement percentage for the asset's long positions (equities only)."},"margin_requirement_short":{"type":"string","description":"The margin requirement percentage for the asset's short positions (equities only)."},"attributes":{"type":"array","x-stoplight":{"id":"40mjg4fj0ykl8"},"description":"One of `ptp_no_exception`, `ptp_with_exception`, `ipo`, `has_options`, or `options_late_close`. We will include unique characteristics of the asset here.","items":{"type":"string","enum":["ptp_no_exception","ptp_with_exception","ipo","has_options","options_late_close"]},"example":["ptp_no_exception","ipo"]}},"required":["id","class","exchange","symbol","name","status","tradable","marginable","shortable","easy_to_borrow","fractionable"]},"AssetClass":{"type":"string","title":"AssetClass","enum":["us_equity","us_option","crypto"],"example":"us_equity","description":"This represents the category to which the asset belongs to. It serves to identify the nature of the financial instrument, with options including \"us_equity\" for U.S. equities, \"us_option\" for U.S. options, and \"crypto\" for cryptocurrencies.","x-examples":{"example-1":"us_equity"}},"OptionContract":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the option contract.","example":"98359ef7-5124-49f3-85ea-5cf02df6defa"},"symbol":{"type":"string","description":"The symbol representing the option contract.","example":"AAPL250620C00100000"},"name":{"type":"string","description":"The name of the option contract.","example":"AAPL Jun 20 2025 100 Call"},"status":{"type":"string","description":"The status of the option contract.","enum":["active","inactive"],"example":"active"},"tradable":{"type":"boolean","description":"Indicates whether the option contract is tradable.","example":true},"expiration_date":{"type":"string","format":"date","description":"The expiration date of the option contract.","example":"2025-06-20"},"root_symbol":{"type":"string","description":"The root symbol of the option contract.","example":"AAPL"},"underlying_symbol":{"type":"string","description":"The underlying symbol of the option contract.","example":"AAPL"},"underlying_asset_id":{"type":"string","description":"The unique identifier of the underlying asset.","example":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415"},"type":{"type":"string","description":"The type of the option contract.","enum":["call","put"],"example":"call"},"style":{"type":"string","description":"The style of the option contract.","enum":["american","european"],"example":"american"},"strike_price":{"type":"string","description":"The strike price of the option contract.","example":"100"},"multiplier":{"type":"string","description":"The multiplier of the option contract is crucial for calculating both the trade premium and the extended strike price. In standard contracts, the multiplier is always set to 100.\nFor instance, if a contract is traded at $1.50 and the multiplier is 100, the total amount debited when buying the contract would be $150.00.\nSimilarly, when exercising a call contract, the total cost will be equal to the strike price times the multiplier.","example":"100"},"size":{"type":"string","description":"Represents the number of underlying shares to be delivered in case the contract is exercised/assigned. For standard contracts, this is always 100.\nThis field should **not** be used as a multiplier, specially for non-standard contracts.","example":"100"},"open_interest":{"type":"string","description":"The open interest of the option contract.","example":"237"},"open_interest_date":{"type":"string","format":"date","description":"The date of the open interest data.","example":"2023-12-11"},"close_price":{"type":"string","description":"The close price of the option contract.","example":"148.38"},"close_price_date":{"type":"string","format":"date","example":"2023-12-11","description":"The date of the close price data."},"deliverables":{"type":"array","description":"Represents the deliverables tied to the option contract. While standard contracts entail a single deliverable, non-standard ones can encompass multiple deliverables, each potentially customized with distinct parameters.\nThis array is included in the list contracts response only if the query parameter show_deliverables=true is provided.\n","items":{"$ref":"#/components/schemas/OptionDeliverable"}}},"required":["id","symbol","name","status","tradable","expiration_date","underlying_symbol","underlying_asset_id","type","style","strike_price","multiplier","size"]},"OptionDeliverable":{"type":"object","properties":{"type":{"type":"string","description":"Type of deliverable, indicating whether it's cash or equity. For standard contracts, it is always \"equity\".\n","enum":["cash","equity"],"example":"equity"},"symbol":{"type":"string","description":"Symbol of the deliverable. For standard contracts, this is equivalent to the underlying symbol of the contract.\n","example":"AAPL"},"asset_id":{"type":"string","description":"Unique identifier of the deliverable asset. For standard contracts, this is equivalent to underlying_asset_id of the contracts.\nThis field is not returned for cash deliverables.\n","example":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415"},"amount":{"type":"string","description":"The deliverable amount. For cash deliverables, this is the cash amount.\nFor standard contract, this is always 100.\nThis field can be null in case the deliverable settlement is delayed and the amount is yet to be determined.\n","example":"100"},"allocation_percentage":{"type":"string","description":"Cost allocation percentage of the deliverable.\nThis is used to determine the cost basis of the equity shares received from the exercise, specially for non-standard contracts with multiple deliverables.\n","example":"100"},"settlement_type":{"type":"string","description":"Indicates when the deliverable will be settled if the contract is exercised/assigned.\n","enum":["T+0","T+1","T+2","T+3","T+4","T+5"],"example":"T+2"},"settlement_method":{"type":"string","description":"Indicates the settlement method that will be used:\n- **BTOB**: Broker to Broker\n- **CADF**: Cash Difference\n- **CAFX**: Cash Fixed\n- **CCC**: Correspondent Clearing Corp\n","enum":["BTOB","CADF","CAFX","CCC"],"example":"CCC"},"delayed_settlement":{"type":"boolean","description":"If true, the settlement of the deliverable will be delayed.\nFor instance, in the event of a contract with a delayed deliverable being exercised, both the availability of the deliverable and its settlement may be postponed beyond the typical timeframe.\n","example":false}},"required":["type","symbol","amount","allocation_percentage","settlement_type","settlement_method","delayed_settlement"]},"Position":{"description":"The positions API provides information about an account’s current open positions. The response will include information such as cost basis, shares traded, and market value, which will be updated live as price information is updated. Once a position is closed, it will no longer be queryable through this API.","type":"object","x-examples":{"example-1":{"asset_id":"904837e3-3b76-47ec-b432-046db621571b","symbol":"AAPL","exchange":"NASDAQ","asset_class":"us_equity","avg_entry_price":"100.0","qty":"5","qty_available":"4","side":"long","market_value":"600.0","cost_basis":"500.0","unrealized_pl":"100.0","unrealized_plpc":"0.20","unrealized_intraday_pl":"10.0","unrealized_intraday_plpc":"0.0084","current_price":"120.0","lastday_price":"119.0","change_today":"0.0084"},"example-2":{"asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","symbol":"AAPL","exchange":"NASDAQ","asset_class":"us_equity","asset_marginable":false,"qty":"2","qty_available":"2","avg_entry_price":"174.78","side":"long","market_value":"348.58","cost_basis":"349.56","unrealized_pl":"-0.98","unrealized_plpc":"-0.0028035244307129","unrealized_intraday_pl":"-0.98","unrealized_intraday_plpc":"-0.0028035244307129","current_price":"174.29","lastday_price":"174.61","change_today":"-0.0018326556325525"}},"title":"Position","properties":{"asset_id":{"type":"string","description":"Asset ID (For options this represents the option contract ID)","format":"uuid"},"symbol":{"type":"string","description":"Symbol name of the asset","example":"AAPL"},"exchange":{"$ref":"#/components/schemas/ExchangeForPosition"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"avg_entry_price":{"type":"string","minLength":1,"description":"Average entry price of the position"},"qty":{"type":"string","minLength":1,"description":"The number of shares"},"qty_available":{"type":"string","minLength":1,"description":"Total number of shares available minus open orders / locked for options covered call"},"side":{"type":"string","minLength":1,"description":"“long”"},"market_value":{"type":"string","minLength":1,"description":"Total dollar amount of the position"},"cost_basis":{"type":"string","minLength":1,"description":"Total cost basis in dollar"},"unrealized_pl":{"type":"string","minLength":1,"description":"Unrealized profit/loss in dollars"},"unrealized_plpc":{"type":"string","minLength":1,"description":"Unrealized profit/loss percent (by a factor of 1)"},"unrealized_intraday_pl":{"type":"string","minLength":1,"description":"Unrealized profit/loss in dollars for the day"},"unrealized_intraday_plpc":{"type":"string","minLength":1,"description":"Unrealized profit/loss percent (by a factor of 1)"},"current_price":{"type":"string","minLength":1,"description":"Current asset price per share"},"lastday_price":{"type":"string","minLength":1,"description":"Last day’s asset price per share based on the closing value of the last trading day"},"change_today":{"type":"string","minLength":1,"description":"Percent change from last day price (by a factor of 1)"},"asset_marginable":{"type":"boolean"}},"required":["asset_id","symbol","exchange","asset_class","avg_entry_price","qty","side","market_value","cost_basis","unrealized_pl","unrealized_plpc","unrealized_intraday_pl","unrealized_intraday_plpc","current_price","lastday_price","change_today","asset_marginable"]},"Watchlist":{"description":"The watchlist API provides CRUD operation for the account’s watchlist. An account can have multiple watchlists and each is uniquely identified by id but can also be addressed by user-defined name. Each watchlist is an ordered list of assets.\n","type":"object","x-examples":{"example-1":{"id":"3174d6df-7726-44b4-a5bd-7fda5ae6e009","account_id":"abe25343-a7ba-4255-bdeb-f7e013e9ee5d","created_at":"2022-01-31T21:49:05.14628Z","updated_at":"2022-01-31T21:49:05.14628Z","name":"Primary Watchlist","assets":[{"id":"8ccae427-5dd0-45b3-b5fe-7ba5e422c766","class":"us_equity","exchange":"NASDAQ","symbol":"TSLA","name":"Tesla, Inc. Common Stock","status":"active","tradable":true,"marginable":true,"shortable":true,"easy_to_borrow":true,"fractionable":true}]}},"title":"Watchlist","properties":{"id":{"type":"string","format":"uuid","description":"watchlist id"},"account_id":{"type":"string","format":"uuid","description":"account ID"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string","minLength":1,"description":"user-defined watchlist name (up to 64 characters)"},"assets":{"type":"array","description":"the content of this watchlist, in the order as registered by the client","items":{"$ref":"#/components/schemas/Assets"}}},"required":["id","account_id","created_at","updated_at","name"]},"WatchlistWithoutAsset":{"description":"The watchlist API provides CRUD operation for the account’s watchlist. An account can have multiple watchlists and each is uniquely identified by id but can also be addressed by user-defined name.\n","type":"object","x-examples":{"example-1":{"id":"3174d6df-7726-44b4-a5bd-7fda5ae6e009","account_id":"abe25343-a7ba-4255-bdeb-f7e013e9ee5d","created_at":"2022-01-31T21:49:05.14628Z","updated_at":"2022-01-31T21:49:05.14628Z","name":"Primary Watchlist"}},"title":"Watchlist","properties":{"id":{"type":"string","format":"uuid","description":"watchlist id"},"account_id":{"type":"string","format":"uuid","description":"account ID"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string","minLength":1,"description":"user-defined watchlist name (up to 64 characters)"}},"required":["id","account_id","created_at","updated_at","name"]},"Calendar":{"type":"object","x-examples":{"example-1":{"date":"2022-02-01","open":"09:30","close":"16:00","session_open":"0700","session_close":"1900"}},"title":"Calendar","properties":{"date":{"type":"string","minLength":1,"description":"Date string in “%Y-%m-%d” format"},"open":{"type":"string","minLength":1,"description":"The time the market opens at on this date in “%H:%M” format"},"close":{"type":"string","minLength":1,"description":"The time the market closes at on this date in “%H:%M” format"},"settlement_date":{"type":"string","x-stoplight":{"id":"e0st09dxvsjt5"},"description":"Date string in “%Y-%m-%d” format. representing the settlement date for the trade date."}},"required":["date","open","close","settlement_date"]},"Clock":{"title":"Clock","type":"object","properties":{"timestamp":{"type":"string","description":"Current timestamp\n","format":"date-time"},"is_open":{"type":"boolean","description":"Whether or not the market is open\n"},"next_open":{"type":"string","description":"Next Market open timestamp","format":"date-time"},"next_close":{"type":"string","description":"Next market close timestamp","format":"date-time"}},"x-examples":{"example-1":{"timestamp":"2019-08-24T14:15:22Z","is_open":true,"next_open":"2019-08-24T14:15:22Z","next_close":"2019-08-24T14:15:22Z"}}},"PortfolioHistory":{"title":"PortfolioHistory","description":"Timeseries data for equity and profit loss information of the account.","type":"object","properties":{"timestamp":{"type":"array","description":"Time of each data element, left-labeled (the beginning of time window).\n\nThe values returned are in [UNIX epoch format](https://en.wikipedia.org/wiki/Unix_time).\n","items":{"type":"integer"}},"equity":{"type":"array","description":"equity value of the account in dollar amount as of the end of each time window","items":{"type":"number"}},"profit_loss":{"type":"array","description":"profit/loss in dollar from the base value","items":{"type":"number"}},"profit_loss_pct":{"type":"array","description":"profit/loss in percentage from the base value","items":{"type":"number"},"example":[0.001,0.002]},"base_value":{"type":"number","description":"basis in dollar of the profit loss calculation"},"base_value_asof":{"type":"string","format":"date","example":"2023-10-20","description":"If included, then it indicates that the base_value is the account's closing\nequity value at this trading date.\n\nIf not specified, then the baseline calculation is done against the earliest returned data item. This could happen for\naccounts without prior closing balances (e.g. new account) or for queries with 1D timeframes, where the first data point\nis used as a reference point.\n"},"timeframe":{"type":"string","description":"time window size of each data element","example":"15Min"},"cashflow":{"type":"object","description":"accumulated value in dollar amount as of the end of each time window"}},"required":["timestamp","equity","profit_loss","profit_loss_pct","base_value","timeframe"],"x-examples":{"example-intraday-query-15min-1d":{"timestamp":[1697722200,1697723100,1697724000,1697724900,1697725800,1697726700,1697727600,1697728500,1697729400,1697730300,1697731200,1697732100,1697733000,1697733900,1697734800,1697735700,1697736600,1697737500,1697738400,1697739300,1697740200,1697741100,1697742000,1697742900,1697743800,1697744700,1697745600],"equity":[2773.79,2769.04,2768.65,2765.11,2763.03,2763.17,2763.17,2763.47,2763.91,2768.13,2774.98,2757.94,2757.65,2774.54,2775.58,2775.28,2767.9,2762.26,2762.56,2756.99,2756.84,2752.43,2752.13,2748.44,2751.23,2747.54,2748.74],"profit_loss":[-0.37,-5.12,-5.51,-9.05,-11.13,-10.99,-10.99,-10.69,-10.25,-6.03,0.82,-16.22,-16.51,0.38,1.42,1.12,-6.26,-11.9,-11.6,-17.17,-17.32,-21.73,-22.03,-25.72,-22.93,-26.62,-25.42],"profit_loss_pct":[-0.0001,-0.0018,-0.002,-0.0033,-0.004,-0.004,-0.004,-0.0039,-0.0037,-0.0022,0.0003,-0.0058,-0.006,0.0001,0.0005,0.0004,-0.0023,-0.0043,-0.0042,-0.0062,-0.0062,-0.0078,-0.0079,-0.0093,-0.0083,-0.0096,-0.0092],"base_value":2774.16,"base_value_asof":"2023-10-18","timeframe":"15Min"},"example-query-1d-7d":{"timestamp":[1697241600,1697500800,1697587200,1697673600,1697760000],"equity":[2784.79,2794.79,2805.46,2774.16,2748.73],"profit_loss":[0,10.0022,10.6692,-31.2996,-25.4232],"profit_loss_pct":[0,0.0035,0.0074,-0.0038,-0.0129],"base_value":2784.79,"timeframe":"1D"}}},"Exchange":{"title":"Exchange","type":"string","description":"Represents the current exchanges Alpaca supports. List is currently:\n\n- AMEX\n- ARCA\n- BATS\n- NYSE\n- NASDAQ\n- NYSEARCA\n- OTC","enum":["AMEX","ARCA","BATS","NYSE","NASDAQ","NYSEARCA","OTC"],"example":"NYSE"},"ExchangeForPosition":{"title":"Exchange","type":"string","description":"Represents the current exchanges Alpaca supports. List is currently:\n\n- AMEX\n- ARCA\n- BATS\n- NYSE\n- NASDAQ\n- NYSEARCA\n- OTC\n\nCan be empty if not applicable (e.g., for options contracts)","enum":["AMEX","ARCA","BATS","NYSE","NASDAQ","NYSEARCA","OTC",null],"example":"NYSE"},"CanceledOrderResponse":{"title":"CanceledOrderResponse","type":"object","x-examples":{"example-1":{"id":"d56ba3ea-6d04-48ce-8175-817e242ee608","status":200}},"description":"Represents the result of a request to cancel and order","properties":{"id":{"type":"string","format":"uuid","description":"orderId"},"status":{"type":"integer","description":"http response code","example":200}}},"PatchOrderRequest":{"title":"PatchOrderRequest","type":"object","description":"Represents a request to patch an order.","properties":{"qty":{"type":"string","example":"4","description":"number of shares to trade.\n\nYou can only patch full shares for now.\n\nQty of equity fractional/notional orders are not allowed to change."},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","example":"3.14","description":"Required if original order's `type` field was `limit` or `stop_limit`.\nIn case of `mleg`, the limit_price parameter is expressed with the following notation:\n- A positive value indicates a debit, representing a cost or payment to be made.\n- A negative value signifies a credit, reflecting an amount to be received."},"stop_price":{"type":"string","example":"3.14","description":"required if original order type is limit or stop_limit"},"trail":{"type":"string","example":"3.14","description":"the new value of the trail_price or trail_percent value (works only for type=“trailing_stop”)"},"client_order_id":{"type":"string","description":"A unique identifier for the new order. Automatically generated if not sent. (<= 128 characters)","maxLength":128},"advanced_instructions":{"$ref":"#/components/schemas/AdvancedInstructions"}}},"PositionClosedReponse":{"title":"PositionClosedReponse","type":"object","description":"Represents the result of asking the api to close a position. ","properties":{"symbol":{"type":"string","description":"Symbol name of the asset"},"status":{"type":"string","description":"Http status code for the attempt to close this position"},"body":{"$ref":"#/components/schemas/Order"}},"required":["symbol","status"],"x-examples":{"example-1":{"symbol":"AAPL","status":200,"body":{"id":"f7f25e89-939a-4587-aaf6-414a6b3c341d","client_order_id":"52f8574c-96d5-49b6-94c1-2570a268434e","created_at":"2022-02-04T16:53:29.53427917Z","updated_at":"2022-02-04T16:53:29.53427917Z","submitted_at":"2022-02-04T16:53:29.533738219Z","filled_at":null,"expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","symbol":"AAPL","asset_class":"us_equity","notional":null,"qty":"2","filled_qty":"0","filled_avg_price":null,"order_class":"","order_type":"market","type":"market","side":"sell","time_in_force":"day","limit_price":null,"stop_price":null,"status":"accepted","extended_hours":false,"legs":null,"trail_percent":null,"trail_price":null,"hwm":null}}}},"UpdateWatchlistRequest":{"title":"PostWatchlistRequest","type":"object","description":"Request format used for creating a new watchlist or updating an existing watchlist with a set of assets and name.","properties":{"name":{"type":"string"},"symbols":{"type":"array","items":{"type":"string","nullable":true}}},"required":["name"]},"AddAssetToWatchlistRequest":{"title":"AddAssetToWatchlistRequest","type":"object","description":"Append an asset for the symbol to the end of watchlist asset list","properties":{"symbol":{"type":"string","example":"AAPL","description":"symbol name to append to watchlist"}}},"CryptoWallet":{"type":"object","properties":{"chain":{"type":"string"},"address":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"Timestamp (RFC3339) of account creation."}}},"CryptoTransfer":{"type":"object","description":"Transfers allow you to transfer assets into your end customer's account (deposits) or out (withdrawal).","properties":{"id":{"type":"string","format":"uuid","description":"The crypto transfer ID"},"tx_hash":{"type":"string","description":"On-chain transaction hash (e.g. 0xabc...xyz)"},"direction":{"$ref":"#/components/schemas/TransferDirection"},"status":{"$ref":"#/components/schemas/CryptoTransferStatus"},"amount":{"type":"string","description":"Amount of transfer denominated in the underlying crypto asset"},"usd_value":{"type":"string","description":"Equivalent USD value at time of transfer"},"network_fee":{"type":"string"},"fees":{"type":"string"},"chain":{"type":"string","description":"Underlying network for given transfer"},"asset":{"type":"string","description":"Symbol of crypto asset for given transfer (e.g. BTC )"},"from_address":{"type":"string","description":"Originating address of the transfer"},"to_address":{"type":"string","description":"Destination address of the transfer"},"created_at":{"type":"string","format":"date-time","description":"Timedate when transfer was created"}},"x-stoplight":{"id":"f986mttnx5c4n"}},"CryptoTransferStatus":{"type":"string","example":"PROCESSING","enum":["PROCESSING","FAILED","COMPLETE"]},"WhitelistedAddress":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID for whitelisted address"},"chain":{"type":"string","description":"Underlying network this address represents"},"asset":{"type":"string","description":"Symbol of underlying asset for the whitelisted address"},"address":{"type":"string","description":"The whitelisted address"},"status":{"type":"string","description":"Status of whitelisted address which is either ACTIVE or PENDING. Whitelisted addresses will be subjected to a 24 waiting period. After the waiting period is over the status will become ACTIVE.","enum":["APPROVED","PENDING"]},"created_at":{"type":"string","format":"date-time","description":"Timestamp (RFC3339) of account creation."}}},"CreateCryptoTransferRequest":{"title":"CreateCryptoTransferRequest","type":"object","properties":{"amount":{"type":"string","description":"The amount, denoted in the specified asset, to be withdrawn from the user’s wallet"},"address":{"type":"string","description":"The destination wallet address"},"asset":{"type":"string"}},"required":["amount","address","asset"]},"TransferDirection":{"type":"string","example":"INCOMING","enum":["INCOMING","OUTGOING"]},"Error":{"title":"Error","type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"}},"required":["code","message"]},"NextPageToken":{"type":"string","description":"Use this token in your next API call to paginate through the dataset and retrieve the next page of results. A null token indicates there are no more data to fetch.\n","nullable":true,"example":"MTAwMA=="},"treasury_subtype":{"type":"string","description":"The subtype of the treasury.","enum":["bond","bill","note","strips","tips","floating"]},"bond_status":{"description":"Status of the bond","type":"string","enum":["outstanding","matured","pre_issuance"]},"coupon_type":{"description":"The type of the coupon rate","type":"string","enum":["fixed","floating","zero"]},"coupon_frequency":{"description":"How often the coupon is paid","type":"string","enum":["annual","semi_annual","quarterly","monthly","zero"]},"us_treasury":{"description":"A US treasury","type":"object","properties":{"cusip":{"description":"CUSIP is a nine-character alphanumeric code that uniquely identifies the security","type":"string","minLength":12,"maxLength":12,"pattern":"^[A-Z0-9]{9}$"},"isin":{"description":"International Securities Identification Number","type":"string","minLength":12,"maxLength":12,"pattern":"^[A-Z]{2}[A-Z0-9]{9}[0-9]$"},"bond_status":{"$ref":"#/components/schemas/bond_status"},"tradable":{"description":"Whether the treasury is tradable","type":"boolean"},"subtype":{"$ref":"#/components/schemas/treasury_subtype"},"issue_date":{"description":"The date on which the bond was issued","type":"string","format":"date"},"maturity_date":{"description":"The date on which the bond matures","type":"string","format":"date"},"description":{"description":"Description of the treasury","type":"string"},"description_short":{"description":"Short description of the treasury","type":"string"},"close_price":{"description":"The price of the last transaction of a security before the market closes for normal trading, shown as a percentage of par value","type":"number","format":"double"},"close_price_date":{"description":"The date of the close price","type":"string","format":"date"},"close_yield_to_maturity":{"description":"Yield to maturity of the treasury after the last close","type":"number","format":"double"},"close_yield_to_worst":{"description":"Yield to worst of the treasury after the last close","type":"number","format":"double"},"coupon":{"description":"The annual interest rate paid on the bond as a percentage of par value","type":"number","format":"double"},"coupon_type":{"$ref":"#/components/schemas/coupon_type"},"coupon_frequency":{"$ref":"#/components/schemas/coupon_frequency"},"first_coupon_date":{"description":"The date of the first coupon payment","type":"string","format":"date"},"next_coupon_date":{"description":"The date of the next coupon payment","type":"string","format":"date"},"last_coupon_date":{"description":"The date of the last coupon payment","type":"string","format":"date"}},"required":["cusip","isin","bond_status","tradable","subtype","issue_date","maturity_date","description","description_short","coupon","coupon_type","coupon_frequency"]},"us_treasuries_resp":{"type":"object","properties":{"us_treasuries":{"type":"array","items":{"$ref":"#/components/schemas/us_treasury"}}},"required":["us_treasuries"]}},"headers":{"ratelimit_limit":{"schema":{"type":"integer"},"example":100,"description":"Request limit per minute."},"ratelimit_remaining":{"schema":{"type":"integer"},"example":90,"description":"Request limit per minute remaining."},"ratelimit_reset":{"schema":{"type":"integer"},"example":1674044551,"description":"The UNIX epoch when the remaining quota changes."}},"responses":{"400":{"description":"One of the request parameters is invalid. See the returned message for details.\n","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"403":{"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key.\n"},"429":{"description":"Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit.\n","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"500":{"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum.\n"}},"examples":{"EquityOrderResponse":{"value":{"id":"7b08df51-c1ac-453c-99f9-323a5f075f0d","client_order_id":"5680c4bc-9ac1-4a12-a44c-df427ba53032","created_at":"2023-12-12T22:31:24.668464435Z","updated_at":"2023-12-12T22:31:24.668464435Z","submitted_at":"2023-12-12T22:31:24.577215743Z","filled_at":null,"expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","symbol":"AAPL","asset_class":"us_equity","notional":null,"qty":"2","filled_qty":"0","filled_avg_price":null,"order_class":"","order_type":"limit","type":"limit","side":"buy","time_in_force":"gtc","limit_price":"150","stop_price":null,"status":"accepted","extended_hours":false,"legs":null,"trail_percent":null,"trail_price":null,"hwm":null,"subtag":null,"source":null}},"OptionOrderResponse":{"value":{"id":"30a077fa-96f6-4f20-a052-4b921ee2f243","client_order_id":"58cd43a7-029e-457e-b77f-cd4f61f00f2a","created_at":"2023-12-12T21:35:49.102449524Z","updated_at":"2023-12-12T21:35:49.102504673Z","submitted_at":"2023-12-12T21:35:49.056332248Z","filled_at":null,"expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"98359ef7-5124-49f3-85ea-5cf02df6defa","symbol":"AAPL250620C00100000","asset_class":"us_option","notional":null,"qty":"2","filled_qty":"0","filled_avg_price":null,"order_class":"simple","order_type":"limit","type":"limit","side":"buy","time_in_force":"day","limit_price":"10","stop_price":null,"status":"pending_new","extended_hours":false,"legs":null,"trail_percent":null,"trail_price":null,"hwm":null,"subtag":null,"source":null}},"CryptoOrderResponse":{"value":{"id":"38e482f3-79a8-4f75-a057-f07a1ec6a397","client_order_id":"5b5d3d67-06ad-4ffa-af65-a117d0fc5a59","created_at":"2023-12-12T22:36:51.337711497Z","updated_at":"2023-12-12T22:36:51.337754768Z","submitted_at":"2023-12-12T22:36:51.313261061Z","filled_at":null,"expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"a1733398-6acc-4e92-af24-0d0667f78713","symbol":"ETH/USD","asset_class":"crypto","notional":null,"qty":"0.02","filled_qty":"0","filled_avg_price":null,"order_class":"","order_type":"limit","type":"limit","side":"buy","time_in_force":"gtc","limit_price":"2100","stop_price":null,"status":"pending_new","extended_hours":false,"legs":null,"trail_percent":null,"trail_price":null,"hwm":null,"subtag":null,"source":null}},"MultilegOptionsOrderResponse":{"value":{"id":"83f37e9f-6b1f-49ed-8fc6-3e6af716323f","client_order_id":"646b1fe6-b212-4f54-94c6-429e7bcdee04","created_at":"2024-12-10T16:15:53.677230742Z","updated_at":"2024-12-10T16:15:53.725139688Z","submitted_at":"2024-12-10T16:15:53.684952901Z","filled_at":"2024-12-10T16:15:53.694Z","expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"","symbol":"","asset_class":"","notional":null,"qty":"1","filled_qty":"1","filled_avg_price":"1.28","order_class":"mleg","order_type":"limit","type":"limit","side":"","time_in_force":"day","limit_price":"10","stop_price":null,"status":"filled","extended_hours":false,"legs":[{"id":"df4ff24a-c58a-4e37-8b9f-ef32b83a11f2","client_order_id":"cc8cc104-fe43-476c-b25c-f62650fb73f9","created_at":"2024-12-10T16:15:53.677230742Z","updated_at":"2024-12-10T16:15:53.725091158Z","submitted_at":"2024-12-10T16:15:53.684952901Z","filled_at":"2024-12-10T16:15:53.694Z","expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"f0ea14b2-8a49-4e9b-89d1-894c6e518a76","symbol":"AAPL241213C00250000","asset_class":"us_option","notional":null,"qty":"3","filled_qty":"3","filled_avg_price":"0.43","order_class":"mleg","order_type":"","type":"","side":"buy","position_intent":"buy_to_open","time_in_force":"day","limit_price":null,"stop_price":null,"status":"filled","extended_hours":false,"legs":null,"trail_percent":null,"trail_price":null,"hwm":null,"subtag":null,"source":null,"expires_at":"2024-12-10T21:00:00Z","ratio_qty":"3"},{"id":"ecd91110-c34d-4e9d-a7bf-a9c27c40f8b5","client_order_id":"0bd2d36d-4af2-4dfb-8418-333a5d5026fa","created_at":"2024-12-10T16:15:53.677230742Z","updated_at":"2024-12-10T16:15:53.708983759Z","submitted_at":"2024-12-10T16:15:53.684952901Z","filled_at":"2024-12-10T16:15:53.694Z","expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"f89940db-eeb1-46e6-8f9b-bb1f27a0b395","symbol":"AAPL241213C00260000","asset_class":"us_option","notional":null,"qty":"1","filled_qty":"1","filled_avg_price":"0.01","order_class":"mleg","order_type":"","type":"","side":"sell","position_intent":"sell_to_open","time_in_force":"day","limit_price":null,"stop_price":null,"status":"filled","extended_hours":false,"legs":null,"trail_percent":null,"trail_price":null,"hwm":null,"subtag":null,"source":null,"expires_at":"2024-12-10T21:00:00Z","ratio_qty":"1"}],"trail_percent":null,"trail_price":null,"hwm":null,"subtag":null,"source":null}}}},"security":[{"API_Key":[],"API_Secret":[]}],"x-readme":{"explorer-enabled":true,"proxy-enabled":false}}