{"openapi":"3.0.0","x-stoplight":{"id":"y5xqkgq9w6jde"},"info":{"title":"Broker API","description":"Open brokerage accounts, enable stock, options and crypto trading. Manage the ongoing user experience and brokerage customer lifecycle with the Alpaca Broker API","version":"1.1.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://broker-api.sandbox.alpaca.markets","description":"Sandbox endpoint"},{"url":"https://broker-api.alpaca.markets","description":"Production endpoint"}],"tags":[{"name":"Accounts"},{"name":"Documents"},{"name":"Trading"},{"name":"Portfolio History"},{"name":"Assets"},{"name":"Calendar"},{"name":"Events"},{"name":"Funding"},{"name":"Funding Wallets"},{"name":"Instant Funding"},{"name":"OAuth"},{"name":"Clock"},{"name":"Journals"},{"name":"Corporate Actions"},{"name":"Watchlist"},{"name":"KYC"},{"name":"Rebalancing"},{"name":"Logos"},{"name":"Reporting"},{"name":"Country Info"},{"name":"Crypto Funding"},{"name":"IRA"},{"name":"Cash Interest"}],"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"parameters":{"ActivityType":{"in":"path","name":"activity_type","required":true,"schema":{"type":"string","enum":["FILL","ACATC","ACATS","CIL","CSD","CSW","DIV","DIVCGL","DIVCGS","DIVNRA","DIVROC","DIVTXEX","FEE","INT","MEM","JNLC","JNLS","MA","OPASN","OPCA","OPCSH","OPEXC","OPEXP","OPTRD","PTC","REORG","SPIN","SPLIT"]},"description":"see ActivityType model for details about what the different types mean"},"Status":{"name":"status","in":"query","description":"Status of the orders to list.","schema":{"type":"string","enum":["open","closed","all"]}},"After":{"name":"after","in":"query","description":"The response will include only ones submitted after this timestamp (exclusive)","schema":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z"}},"AssetClass":{"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"]}}},"Until":{"name":"until","in":"query","description":"The response will include only ones submitted until this timestamp (exclusive)","schema":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z"}},"Direction":{"name":"direction","in":"query","description":"The chronological order of response based on the submission time. asc or desc. Defaults to desc.","schema":{"type":"string","enum":["asc","desc"],"example":"desc"}},"Sort":{"name":"sort","in":"query","description":"The chronological order of response based on the submission time. asc or desc. Defaults to desc.","schema":{"type":"string","enum":["asc","desc"],"example":"desc"}},"Nested":{"name":"nested","in":"query","description":"If true, the result will roll up multi-leg orders under the legs field of primary order.","schema":{"type":"boolean","example":false}},"Symbols":{"name":"symbols","in":"query","description":"A comma-separated list of symbols to filter by.","schema":{"type":"string","example":"AAPL,TSLA,MSFT"}},"AccountID":{"name":"account_id","in":"path","required":true,"description":"Account identifier.","schema":{"type":"string","format":"uuid"}},"OrderID":{"name":"order_id","in":"path","required":true,"description":"Order identifier.","schema":{"type":"string"}},"DocumentID":{"name":"document_id","in":"path","required":true,"description":"Document identifier.","schema":{"type":"string","format":"uuid"}},"AccountDocumentType":{"name":"type","in":"query","required":false,"description":"The type of the account document","schema":{"example":"account_statement","type":"string","enum":["account_application","account_statement","crypto_account_statement","options_application","tax_statement","trade_confirmation_json","trade_confirmation"]}},"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":{"type":"object","description":"Represents high level account info. Used when returning entire account information would not be useful like the getAllAccounts operation","x-examples":{"example-1":{"id":"0d18ae51-3c94-4511-b209-101e1666416b","account_number":"9034005019","status":"APPROVED","currency":"USD","created_at":"2019-09-30T23:55:31.185998Z","last_equity":"1500.65"}},"x-stoplight":{"id":"mg5a9g65p0k72"},"properties":{"id":{"type":"string","format":"uuid","description":"UUID that identifies the account for later reference"},"account_number":{"type":"string","description":"A human-readable account number that can be shown to the end user","nullable":true},"account_type":{"$ref":"#/components/schemas/AccountType"},"status":{"$ref":"#/components/schemas/AccountStatus"},"crypto_status":{"$ref":"#/components/schemas/AccountStatus"},"currency":{"$ref":"#/components/schemas/Currency"},"created_at":{"type":"string","format":"date-time","description":"Timestamp (RFC3339) of account creation."},"last_equity":{"type":"string","format":"decimal","description":"EOD equity calculation (cash + long market value + short market value)"},"enabled_assets":{"x-stoplight":{"id":"44f1cfyta748h"},"type":"array","description":"Assets the user has enabled and is able to trade once status and/or crypto_status are ACTIVE","items":{"$ref":"#/components/schemas/AssetClass"}},"contact":{"$ref":"#/components/schemas/Contact"},"identity":{"$ref":"#/components/schemas/Identity"},"disclosures":{"$ref":"#/components/schemas/Disclosures"},"documents":{"description":"The documents associated with the primary owner of the account","type":"array","x-stoplight":{"id":"w22zyoy6wxhbd"},"items":{"$ref":"#/components/schemas/OwnerDocument"}},"agreements":{"type":"array","x-stoplight":{"id":"6igg6t87mkteb"},"items":{"$ref":"#/components/schemas/Agreement"}},"trusted_contact":{"$ref":"#/components/schemas/TrustedContact"},"cash_interest":{"$ref":"#/components/schemas/AccountCashInterestResponse"},"fpsl":{"$ref":"#/components/schemas/AccountFPSLResponse"}},"required":["id","account_number","status","currency","created_at","last_equity"]},"TradeAccount":{"type":"object","x-examples":{"example-1":{"id":"c8f1ef5d-edc0-4f23-9ee4-378f19cb92a4","account_number":"927584925","status":"ACTIVE","currency":"USD","buying_power":"103556.8572572922","regt_buying_power":"52921.2982330664","daytrading_buying_power":"103556.8572572922","options_buying_power":"26460.65","cash":"24861.91","cash_withdrawable":"17861.91","cash_transferable":"24861.91","accrued_fees":"0","pending_transfer_out":"0","portfolio_value":"28059.3882330664","pattern_day_trader":true,"trading_blocked":false,"transfers_blocked":false,"account_blocked":false,"created_at":"2021-03-01T13:28:49.270232Z","trade_suspended_by_user":false,"multiplier":"2","shorting_enabled":true,"equity":"28059.3882330664","last_equity":"26977.323677655","long_market_value":"3197.4782330664","short_market_value":"0","initial_margin":"1598.7391165332","maintenance_margin":"959.24346991992","last_maintenance_margin":"934.6241032965","sma":"26758.0590204615","daytrade_count":0,"balance_asof":"2021-04-01","previous_close":"2021-04-01T19:00:00-04:00","last_long_market_value":"3115.413677655","last_short_market_value":"0","last_cash":"23861.91","last_initial_margin":"1557.7068388275","last_regt_buying_power":"50839.233677655","last_daytrading_buying_power":"104433.9158860662","last_options_buying_power":"25419.62","last_buying_power":"104433.9158860662","last_daytrade_count":0,"clearing_broker":"VELOX","options_approved_level":0,"options_trading_level":0,"intraday_adjustments":"0","pending_reg_taf_fees":"0"},"example-2":{"id":"56712986-9ff7-4d8f-8e52-077e099e533e","account_number":"601612064","status":"ACTIVE","crypto_status":"PAPER_ONLY","currency":"USD","buying_power":"83567.42","regt_buying_power":"83567.42","daytrading_buying_power":"0","options_buying_power":"83567.42","non_marginable_buying_power":"41783.71","cash":"83567.42","cash_withdrawable":"0","cash_transferable":"41783.71","accrued_fees":"0","pending_transfer_out":"0","pending_transfer_in":"0","portfolio_value":"83567.42","pattern_day_trader":false,"trading_blocked":false,"transfers_blocked":false,"account_blocked":false,"created_at":"2022-01-21T21:25:26.713802Z","trade_suspended_by_user":false,"multiplier":"1","shorting_enabled":false,"equity":"83567.42","last_equity":"41783.71","long_market_value":"0","short_market_value":"0","initial_margin":"0","maintenance_margin":"0","last_maintenance_margin":"0","sma":"0","daytrade_count":0,"balance_asof":"2022-02-08","previous_close":"2022-02-08T19:00:00-05:00","last_long_market_value":"0","last_short_market_value":"0","last_cash":"41783.71","last_initial_margin":"0","last_regt_buying_power":"41783.71","last_daytrading_buying_power":"0","last_options_buying_power":"41783.71","last_buying_power":"41783.71","last_daytrade_count":0,"clearing_broker":"VELOX","options_approved_level":2,"options_trading_level":1,"intraday_adjustments":"0","pending_reg_taf_fees":"0.01"}},"description":"This is an extended version of the Account model found [in the trading api](https://alpaca.markets/docs/api-references/trading-api/account/#account-entity).\n\nExtra data has been added that would be useful for brokers.","properties":{"id":{"type":"string","example":"c8f1ef5d-edc0-4f23-9ee4-378f19cb92a4","format":"uuid","description":"The account ID"},"admin_configurations":{"$ref":"#/components/schemas/AdminConfigurations"},"user_configurations":{"$ref":"#/components/schemas/AccountConfigurations"},"account_number":{"type":"string","example":"927584925","description":"The account number","nullable":true},"status":{"$ref":"#/components/schemas/AccountStatus"},"crypto_status":{"$ref":"#/components/schemas/AccountStatus"},"currency":{"type":"string","example":"USD","description":"Always USD"},"buying_power":{"type":"string","example":"12345.6789","format":"decimal","description":"Current available cash buying power. If multiplier = 2 then buying_power = max(equity-initial_margin(0) * 2). If multiplier = 1 then buying_power = cash."},"regt_buying_power":{"type":"string","example":"12345.6789","format":"decimal","description":"User’s buying power under Regulation T (excess equity - (equity - margin value) - * margin multiplier)"},"daytrading_buying_power":{"type":"string","example":"12345.6789","format":"decimal","description":"Your buying power for day trades (continuously updated value)"},"effective_buying_power":{"type":"string","example":"12345.6789","format":"decimal","description":"Effective buying power (duplicate of buying power)"},"non_marginable_buying_power":{"type":"string","example":"12345.6789","format":"decimal","description":"Non-marginable buying power (currently used for only crypto trading)"},"options_buying_power":{"type":"string","example":"12345.6789","format":"decimal","description":"Your buying power for options trading"},"bod_dtbp":{"type":"string","example":"12345.6789","format":"decimal","description":"bod_dtbp"},"accrued_fees":{"type":"string","example":"12345.6789","format":"decimal","description":"Accrued fees"},"cash":{"type":"string","example":"12345.6789","format":"decimal","description":"Cash balance"},"cash_withdrawable":{"type":"string","example":"12345.6789","format":"decimal","description":"Cash available for withdrawl"},"cash_transferable":{"type":"string","example":"12345.6789","description":"Cash available for transfer (JNLC)"},"pending_transfer_out":{"type":"string","example":"12345.6789","description":"Cash pending transfer out"},"portfolio_value":{"type":"string","example":"12345.6789","format":"decimal","description":"Total value of cash + holding positions. (This field is deprecated. It is equivalent to the equity field.)"},"pattern_day_trader":{"type":"boolean","example":false,"description":"Whether account is flagged as pattern day trader or not"},"trading_blocked":{"type":"boolean","example":false,"description":"If true, the account is not allowed to place orders."},"transfers_blocked":{"type":"boolean","example":false,"description":"If true, the account is not allowed to request money transfers."},"account_blocked":{"type":"boolean","example":false,"description":"If true, the account activity by user is prohibited."},"created_at":{"type":"string","example":"2021-03-01T13:28:49.270232Z","description":"Timestamp this account was created at"},"trade_suspended_by_user":{"type":"boolean","example":false,"description":"If true, the account is not allowed to place orders."},"multiplier":{"type":"string","format":"decimal","example":"2","description":"“1”, “2”, \"3\", or \"4\""},"shorting_enabled":{"type":"boolean","example":false,"description":"Flag to denote whether or not the account is permitted to short"},"equity":{"type":"string","example":"12345.6789","format":"decimal","description":"cash + long_market_value + short_market_value"},"last_equity":{"type":"string","example":"12345.6789","format":"decimal","description":"Equity as of previous trading day at 16:00:00 ET"},"long_market_value":{"type":"string","example":"12345.6789","format":"decimal","description":"Real-time MtM value of all long positions held in the account"},"short_market_value":{"type":"string","example":"0","format":"decimal","description":"Real-time MtM value of all short positions held in the account"},"position_market_value":{"type":"string","example":"0","format":"decimal","description":"Real-time MtM value of all the positions held in the account"},"initial_margin":{"type":"string","example":"12345.6789","format":"decimal","description":"Reg T initial margin requirement (continuously updated value)"},"maintenance_margin":{"type":"string","example":"12345.6789","format":"decimal","description":"Maintenance margin requirement (continuously updated value)"},"last_maintenance_margin":{"type":"string","example":"12345.6789","format":"decimal","description":"Maintenance margin requirement on the previous trading day"},"sma":{"type":"string","example":"12345.6789","format":"decimal","description":"Value of Special Memorandum Account (will be used at a later date to provide additional buying_power)"},"daytrade_count":{"type":"integer","example":0,"description":"The current number of daytrades that have been made in the last 5 trading days (inclusive of today)"},"balance_asof":{"description":"The date of the snapshot for `last_*` fields","type":"string","example":"2021-04-01"},"previous_close":{"type":"string","example":"2021-04-01T19:00:00-04:00","description":"Previous sessions close time"},"last_long_market_value":{"type":"string","example":"12345.6789","description":"Value of all long positions as of previous trading day at 16:00:00 ET"},"last_short_market_value":{"type":"string","example":"0","description":"Value of all short positions as of previous trading day at 16:00:00 ET"},"last_cash":{"type":"string","example":"12345.6789","description":"Value of all cash as of previous trading day at 16:00:00 ET"},"last_initial_margin":{"type":"string","example":"12345.6789","description":"Value of Reg T margin as of previous trading day at 16:00:00 ET"},"last_regt_buying_power":{"type":"string","example":"12345.6789","description":"Value of Reg T buying power as of previous trading day at 16:00:00 ET"},"last_daytrading_buying_power":{"type":"string","example":"12345.6789","description":"Value of daytrading buying power as of previous trading day at 16:00:00 ET"},"last_options_buying_power":{"type":"string","example":"12345.6789","description":"Value of option buying power as of previous trading day at 16:00:00 ET"},"last_buying_power":{"type":"string","example":"12345.6789","description":"Value of buying_power as of previous trading day at 16:00:00 ET"},"last_daytrade_count":{"type":"integer","example":0,"description":"Value of daytrade count as of previous trading day at 16:00:00 ET"},"clearing_broker":{"type":"string","example":"Velox","description":"Clearing broker"},"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","example":"0.01","description":"Pending regulatory fees for the account."},"memoposts":{"type":"string","example":"100","description":"Outstanding memopost value"}},"required":["id","admin_configurations","user_configurations","account_number","status","crypto_status","currency","buying_power","regt_buying_power","daytrading_buying_power","effective_buying_power","non_marginable_buying_power","bod_dtbp","accrued_fees","portfolio_value","pattern_day_trader","trading_blocked","transfers_blocked","account_blocked","created_at","trade_suspended_by_user","multiplier","shorting_enabled","equity","last_equity","long_market_value","short_market_value","position_market_value","initial_margin","maintenance_margin","last_maintenance_margin","sma","daytrade_count","balance_asof","cash"],"x-stoplight":{"id":"fib073ib25xrv"}},"AccountStatus":{"type":"string","example":"ACTIVE","enum":["INACTIVE","ONBOARDING","SUBMITTED","SUBMISSION_FAILED","ACTION_REQUIRED","ACCOUNT_UPDATED","APPROVAL_PENDING","APPROVED","REJECTED","ACTIVE","ACCOUNT_CLOSED"],"description":"Designates the current status of this account\n\nPossible Values:\n- **INACTIVE**\nAccount not set to trade given asset.\n- **ONBOARDING**\nAn application is expected for this user, but has not been submitted yet.\n- **SUBMITTED**\nThe application has been submitted and in process.\n- **SUBMISSION_FAILED**\nUsed to display if failure on submission\n- **ACTION_REQUIRED**\nThe application requires manual action.\n- **ACCOUNT_UPDATED**\nUsed to display when Account has been modified by user\n- **APPROVAL_PENDING**\nInitial value. The application approval process is in process.\n- **APPROVED**\nThe account application has been approved, and waiting to be ACTIVE\n- **REJECTED**\nThe account application is rejected for some reason\n- **ACTIVE**\nThe account is fully active. Trading and funding are processed under this status.\n- **ACCOUNT_CLOSED**\nThe account is closed.\n","x-stoplight":{"id":"zxsbg55ojatc8"}},"AccountType":{"type":"string","title":"AccountType","description":"Possible values are:\n\n- trading\n- custodial\n- donor_advised\n- ira","enum":["trading","custodial","donor_advised","ira"],"example":"trading"},"AccountSubType":{"type":"string","title":"AccountSubType","description":"IRA Account only\n\nPossible values are:\n\n- traditional\n- roth","enum":["traditional","roth"],"example":"traditional"},"AccountExtended":{"type":"object","description":"Represents an account with all data available. If your api response is missing some of these fields, there is a good chance you are using a route that returns `Account` instances instead of these.","x-examples":{"example-1":{"id":"3dcb795c-3ccc-402a-abb9-07e26a1b1326","account_number":"601842165","status":"ACTIVE","crypto_status":"INACTIVE","currency":"USD","last_equity":"40645.13","created_at":"2022-01-21T21:25:26.583576Z","contact":{"email_address":"strange_elbakyan_97324509@example.com","phone_number":"614-555-0697","street_address":["20 N San Mateo Dr"],"city":"San Mateo","state":"CA","country":"USA","postal_code":"94401"},"identity":{"given_name":"Strange","family_name":"Elbakyan","date_of_birth":"1970-01-01","tax_id_type":"USA_SNN","country_of_citizenship":"USA","country_of_birth":"USA","country_of_tax_residence":"USA","funding_source":["employment_income"],"visa_type":null,"visa_expiration_date":null,"date_of_departure_from_usa":null,"permanent_resident":null},"disclosures":{"is_control_person":false,"is_affiliated_exchange_or_finra":false,"is_politically_exposed":false,"immediate_family_exposed":false,"is_discretionary":false},"agreements":[{"agreement":"margin_agreement","signed_at":"2022-01-21T21:25:26.579487214Z","ip_address":"127.0.0.1","revision":"16.2021.05"},{"agreement":"customer_agreement","signed_at":"2022-01-21T21:25:26.579487214Z","ip_address":"127.0.0.1","revision":"22.2024.08"}],"documents":[{"document_type":"identity_verification","document_sub_type":"passport","id":"d5af1585-6c60-494d-9ea5-c5df62704229","content":"https://s3.amazonaws.com/stg.alpaca.markets/documents/accounts/3dcb795c-3ccc-402a-abb9-07e26a1b1326/2490f5d9-8988-4405-a3e0-d76e65de13c2.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJLDF4SCWSL6HUQKA%2F20220210%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220210T162205Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=bc6cc0f541d569623f3973fb83734d7960a69886e8b175a9d472f666b87419f1","created_at":"2022-01-21T21:25:28.184231Z"}],"trusted_contact":{"given_name":"Jane","family_name":"Doe","email_address":"strange_elbakyan_97324509@example.com"},"account_type":"trading","account_sub_type":null,"trading_configurations":null,"beneficiaries":[{"given_name":"John","middle_name":"P","family_name":"Smith","date_of_birth":"1970-01-01","tax_id":"xxx-xx-xxxx","tax_id_type":"USA_SSN","relationship":"spouse","type":"primary","share_pct":"100"}]}},"x-stoplight":{"id":"oqrvgmjlw9nuj"},"properties":{"id":{"type":"string","format":"uuid"},"account_number":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/AccountStatus"},"crypto_status":{"$ref":"#/components/schemas/AccountStatus"},"kyc_results":{"$ref":"#/components/schemas/KYCResults"},"currency":{"$ref":"#/components/schemas/Currency"},"last_equity":{"type":"string","format":"decimal"},"created_at":{"type":"string","format":"date-time"},"contact":{"$ref":"#/components/schemas/Contact"},"identity":{"$ref":"#/components/schemas/Identity"},"disclosures":{"$ref":"#/components/schemas/Disclosures"},"agreements":{"type":"array","items":{"$ref":"#/components/schemas/Agreement"}},"documents":{"description":"The documents associated with the primary owner of the account","type":"array","items":{"$ref":"#/components/schemas/OwnerDocument"}},"trusted_contact":{"$ref":"#/components/schemas/TrustedContact"},"account_name":{"type":"string"},"account_type":{"$ref":"#/components/schemas/AccountType"},"account_sub_type":{"$ref":"#/components/schemas/AccountSubType"},"custodial_account_type":{"$ref":"#/components/schemas/CustodialAccountType"},"minor_identity":{"$ref":"#/components/schemas/CustodialAccountMinorIdentity"},"trading_configurations":{"$ref":"#/components/schemas/AccountConfigurations"},"usd":{"description":"values in USD. This is returned for LCT (non-USD) accounts only.","type":"object","properties":{"last_equity":{"type":"string","format":"decimal","example":"123.45"}}},"enabled_assets":{"type":"array","items":{"$ref":"#/components/schemas/AssetClass"}},"beneficiaries":{"type":"array","items":{"$ref":"#/components/schemas/Beneficiary"}},"cash_interest":{"$ref":"#/components/schemas/AccountCashInterestResponse"},"fpsl":{"$ref":"#/components/schemas/AccountFPSLResponse"},"risk_tolerance":{"type":"string","description":"The user's investment risk tolerance. This field should be used instead of the deprecated `risk_tolerance` under identity.\n","enum":["conservative","moderate","significant_risk"]},"investment_objective":{"type":"string","description":"The user's investment objective. This field should be used instead of the deprecated `investment_objective` under identity.\n","enum":["generate_income","preserve_wealth","market_speculation","growth","balance_preserve_wealth_with_growth"]},"investment_time_horizon":{"type":"string","description":"The expected period of time the user plan to invest to achieve his/her financial goal(s). This field should be used instead of the deprecated `investment_time_horizon` under identity.\n","enum":["less_than_1_year","1_to_2_years","3_to_5_years","6_to_10_years","more_than_10_years"]},"liquidity_needs":{"type":"string","description":"The user's ability to quickly and easily convert to cash all or a portion of the investments in this account without experiencing significant loss in value. This field should be used instead of the deprecated `liquidity_needs` under identity.\n","enum":["very_important","important","somewhat_important","does_not_matter"]}},"required":["id","account_number","status","currency","last_equity","created_at","account_type"]},"AccountUpdateRequest":{"type":"object","x-examples":{"example-1":{"contact":{"email_address":"john.doe@example.com","phone_number":"+15556667788","street_address":["20 N San Mateo Dr"],"city":"San Mateo","state":"CA","country":"USA","postal_code":"94401"},"identity":{"given_name":"John","family_name":"Doe","date_of_birth":"1990-01-01","tax_id":"666-55-4321","tax_id_type":"USA_SSN","country_of_citizenship":"AUS","country_of_birth":"AUS","country_of_tax_residence":"USA","funding_source":["employment_income"]},"disclosures":{"is_control_person":false,"is_affiliated_exchange_or_finra":false,"is_politically_exposed":false,"immediate_family_exposed":false},"trusted_contact":{"given_name":"Jane","family_name":"Doe","email_address":"jane.doe@example.com"},"beneficiaries":[{"given_name":"John","middle_name":"P","family_name":"Smith","date_of_birth":"1970-01-01","tax_id":"xxx-xx-xxxx","tax_id_type":"USA_SSN","relationship":"spouse","type":"primary","share_pct":"100"}]}},"properties":{"contact":{"$ref":"#/components/schemas/Contact"},"identity":{"$ref":"#/components/schemas/Identity"},"disclosures":{"$ref":"#/components/schemas/Disclosures"},"agreements":{"type":"array","description":"Additional agreements, or new revisions of existing agreements, read and signed by the account holder.","items":{"$ref":"#/components/schemas/Agreement"}},"trusted_contact":{"$ref":"#/components/schemas/TrustedContact"},"beneficiaries":{"type":"array","items":{"$ref":"#/components/schemas/Beneficiary"}},"cash_interest":{"$ref":"#/components/schemas/AccountCashInterestPatch"},"fpsl":{"$ref":"#/components/schemas/AccountFPSLPatch"}}},"AccountDocument":{"type":"object","description":"A document associated with an account","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountDocumentType"},"sub_type":{"description":"The sub-type of the document. This is a free-form property.","type":"string"},"date":{"type":"string","format":"date"}},"required":["id","type","date"],"example":{"id":"0d18ae51-3c94-4511-b209-101e1666416b","type":"account_statement","sub_type":"1099-Comp","date":"2019-09-30"}},"OwnerDocument":{"type":"object","description":"A document associated with an owner of the account","properties":{"id":{"type":"string","format":"uuid"},"document_type":{"$ref":"#/components/schemas/OwnerDocumentType"},"document_sub_type":{"description":"The sub-type of the document. This is a free-form property.","type":"string"},"mime_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","document_type","created_at"],"example":{"id":"0d18ae51-3c94-4511-b209-101e1666416b","document_type":"identity_verification","document_sub_type":"passport","mime_type":"image/jpeg","created_at":"2019-09-30T23:55:31.185998Z"},"x-stoplight":{"id":"6jkqogvv3l151"}},"CustodialAccountMinorIdentity":{"description":"Represents Identity information for a minor that an account of type \"custodial\" is for","type":"object","x-examples":{},"properties":{"given_name":{"type":"string"},"family_name":{"type":"string"},"date_of_birth":{"type":"string","format":"date"},"tax_id":{"type":"string"},"tax_id_type":{"$ref":"#/components/schemas/TaxIdType"},"country_of_citizenship":{"type":"string"},"country_of_birth":{"type":"string"},"country_of_tax_residence":{"type":"string"},"state":{"type":"string"},"email":{"type":"string","format":"email"}},"required":["given_name","family_name","date_of_birth","country_of_tax_residence","state","email"],"x-stoplight":{"id":"0kzlygfs1ac1c"}},"AccountConfigurations":{"title":"AccountConfigurations","type":"object","description":"Represents additional configuration settings for an account","x-stoplight":{"id":"rs80h7z1vg3or"},"properties":{"dtbp_check":{"type":"string","description":"both, entry, or exit. Controls Day Trading Margin Call (DTMC) checks.","example":"both","enum":["both","entry","exit"]},"trade_confirm_email":{"type":"string","description":"all or none. If none, emails for order fills are not sent.","enum":["all","none"]},"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\" or \"2\""},"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"},"ptp_no_exception_entry":{"type":"string","x-stoplight":{"id":"b2q93748qni2e"},"description":"If set to true then Alpaca will accept orders for PTP symbols with no exception. Default is false."}},"required":["dtbp_check","trade_confirm_email","suspend_trade","no_shorting","fractional_trading","max_margin_multiplier","pdt_check","ptp_no_exception_entry"]},"AccountCreationRequest":{"type":"object","title":"AccountCreationRequest","description":"Represents the fields required to create a new account","properties":{"account_type":{"$ref":"#/components/schemas/AccountType"},"account_sub_type":{"$ref":"#/components/schemas/AccountSubType"},"contact":{"$ref":"#/components/schemas/Contact"},"identity":{"$ref":"#/components/schemas/Identity"},"disclosures":{"$ref":"#/components/schemas/Disclosures"},"agreements":{"type":"array","description":"The client must present the Alpaca Account and Margin Agreements to the end user, and confirm they have read and agreed to the agreement.","items":{"$ref":"#/components/schemas/Agreement"}},"documents":{"type":"array","items":{"$ref":"#/components/schemas/OwnerDocumentUploadRequest"}},"trusted_contact":{"$ref":"#/components/schemas/TrustedContact"},"enabled_assets":{"type":"array","description":"Will default to `us_equity`. Alpaca has the ability to update the default value upon request.","items":{"$ref":"#/components/schemas/AssetClass"}},"beneficiaries":{"type":"array","description":"IRA Account only. A user can submit max 6 beneficiaries.","items":{"$ref":"#/components/schemas/Beneficiary"}},"cash_interest":{"$ref":"#/components/schemas/AccountCashInterestPost"},"fpsl":{"$ref":"#/components/schemas/AccountFPSLPost"},"risk_tolerance":{"type":"string","description":"The user's investment risk tolerance. This field should be used instead of the deprecated `risk_tolerance` under identity.\n","enum":["conservative","moderate","significant_risk"]},"investment_objective":{"type":"string","description":"The user's investment objective. This field should be used instead of the deprecated `investment_objective` under identity.\n","enum":["generate_income","preserve_wealth","market_speculation","growth","balance_preserve_wealth_with_growth"]},"investment_time_horizon":{"type":"string","description":"The expected period of time the user plan to invest to achieve his/her financial goal(s). This field should be used instead of the deprecated `investment_time_horizon` under identity.\n","enum":["less_than_1_year","1_to_2_years","3_to_5_years","6_to_10_years","more_than_10_years"]},"liquidity_needs":{"type":"string","description":"The user's ability to quickly and easily convert to cash all or a portion of the investments in this account without experiencing significant loss in value. This field should be used instead of the deprecated `liquidity_needs` under identity.\n","enum":["very_important","important","somewhat_important","does_not_matter"]}},"required":["contact","identity","disclosures","agreements"]},"TaxIdType":{"type":"string","title":"TaxIdType","enum":["USA_SSN","ARG_AG_CUIT","AUS_TFN","AUS_ABN","BOL_NIT","BRA_CPF","CHL_RUT","COL_NIT","CRI_NITE","DEU_TAX_ID","DOM_RNC","ECU_RUC","FRA_SPI","GBR_UTR","GBR_NINO","GTM_NIT","HND_RTN","HUN_TIN","IDN_KTP","IND_PAN","ISR_TAX_ID","ITA_TAX_ID","JPN_TAX_ID","MEX_RFC","NIC_RUC","NLD_TIN","PAN_RUC","PER_RUC","PRY_RUC","SGP_NRIC","SGP_FIN","SGP_ASGD","SGP_ITR","SLV_NIT","SWE_TAX_ID","URY_RUT","VEN_RIF","NATIONAL_ID","PASSPORT","PERMANENT_RESIDENT","DRIVER_LICENSE","OTHER_GOV_ID","NOT_SPECIFIED"],"description":"Required if `tax_id` is set.\n\nAn Enum of the various kinds of Tax ID formats Alpaca supports.\n\nPossible Values are:\n\n\n- **USA_SSN**\nUSA Social Security Number\n\n- **ARG_AR_CUIT**\nArgentina CUIT\n\n- **AUS_TFN**\nAustralian Tax File Number\n\n- **AUS_ABN**\nAustralian Business Number\n\n- **BOL_NIT**\nBolivia NIT\n\n- **BRA_CPF**\nBrazil CPF\n\n- **CHL_RUT**\nChile RUT\n\n- **COL_NIT**\nColombia NIT\n\n- **CRI_NITE**\nCosta Rica NITE\n\n- **DEU_TAX_ID**\nGermany Tax ID (Identifikationsnummer)\n\n- **DOM_RNC**\nDominican Republic RNC\n\n- **ECU_RUC**\nEcuador RUC\n\n- **FRA_SPI**\nFrance SPI (Reference Tax Number)\n\n- **GBR_UTR**\nUK UTR (Unique Taxpayer Reference)\n\n- **GBR_NINO**\nUK NINO (National Insurance Number)\n\n- **GTM_NIT**\nGuatemala NIT\n\n- **HND_RTN**\nHonduras RTN\n\n- **HUN_TIN**\nHungary TIN Number\n\n- **IDN_KTP**\nIndonesia KTP\n\n- **IND_PAN**\nIndia PAN Number\n\n- **ISR_TAX_ID**\nIsrael Tax ID (Teudat Zehut)\n\n- **ITA_TAX_ID**\nItaly Tax ID (Codice Fiscale)\n\n- **JPN_TAX_ID**\nJapan Tax ID (Koijin Bango)\n\n- **MEX_RFC**\nMexico RFC\n\n- **NIC_RUC**\nNicaragua RUC\n\n- **NLD_TIN**\nNetherlands TIN Number\n\n- **PAN_RUC**\nPanama RUC\n\n- **PER_RUC**\nPeru RUC\n\n- **PRY_RUC**\nParaguay RUC\n\n- **SGP_NRIC**\nSingapore NRIC\n\n- **SGP_FIN**\nSingapore FIN\n\n- **SGP_ASGD**\nSingapore ASGD\n\n- **SGP_ITR**\nSingapore ITR\n\n- **SLV_NIT**\nEl Salvador NIT\n\n- **SWE_TAX_ID**\nSweden Tax ID (Personnummer)\n\n- **URY_RUT**\nUruguay RUT\n\n- **VEN_RIF**\nVenezuela RIF\n\n- **NATIONAL_ID**\nNational ID number, if a tax ID number is not available\n\n- **PASSPORT**\nPassport number, if a tax ID number is not available\n\n- **PERMANENT_RESIDENT**\nPermanent resident number, if a tax ID number is not available\n\n- **DRIVER_LICENSE**\nDrivers license number, if a tax ID number is not available\n\n- **OTHER_GOV_ID**\nOther government issued identifier, if a tax ID number is not available\n\n- **NOT_SPECIFIED**\nOther Tax IDs","example":"USA_SSN","x-stoplight":{"id":"ulm45kpr2peox"}},"Activity":{"title":"Activity","description":"Base for activity types","allOf":[{"type":"object","properties":{"id":{"type":"string","example":"20220208125959696::88b5f678-fef5-447b-af15-f21e367e6d8c"},"account_id":{"type":"string","format":"uuid","example":"c8f1ef5d-edc0-4f23-9ee4-378f19cb92a4"},"activity_type":{"$ref":"#/components/schemas/ActivityType"}}},{"oneOf":[{"$ref":"#/components/schemas/TradeActivity"},{"$ref":"#/components/schemas/NonTradeActivity"}]}],"required":["id","activity_type"],"x-stoplight":{"id":"1cd58vzvymj1a"}},"ActivityType":{"title":"ActivityType","type":"string","enum":["FILL","ACATC","ACATS","CIL","CSD","CSW","DIV","DIVCGL","DIVCGS","DIVNRA","DIVROC","DIVTXEX","FEE","INT","JNLC","JNLS","MA","OPASN","OPCA","OPCSH","OPEXC","OPEXP","OPTRD","PTC","REORG","SPIN","SPLIT"],"description":"Represents the various kinds of activity.\n\nTradeActivity's will always have the type `FILL`\n\n- **FILL**\n  Order Fills (Partial/Full)\n- **ACATC**\n  ACATS IN/OUT (Cash)\n- **ACATS**\n  ACATS IN/OUT (Securities)\n- **CIL**\n  Cash in Lieu of Stock\n- **CSD**\n  Cash Disbursement (+)\n- **CSW**\n  Cash Withdrawable\n- **DIV**\n  Dividend\n- **DIVCGL**\n  Dividend (Capital Gain Long Term)\n- **DIVCGS**\n  Dividend (Capital Gain Short Term)\n- **DIVNRA**\n  Dividend Adjusted (NRA Withheld)\n- **DIVROC**\n  Dividend Return of Capital\n- **DIVTXEX**\n  Dividend (Tax Exempt)\n- **FEE**\n  REG and TAF Fees\n- **INT**\n  Interest (Credit/Margin)\n- **JNLC**\n  Journal Entry (Cash)\n- **JNLS**\n  Journal Entry (Stock)\n- **OPASN**\n   Option Assignment\n- **OPCA**\n  Option Corporate Action\n- **OPCSH**\n   Option cash deliverable for non-standard contracts\n- **OPEXC**\n  Option Exercise\n- **OPEXP**\n  Option Expiration\n- **OPTRD**\n  Option Trade\n- **MA**\n  Merger/Acquisition\n- **PTC**\n  Pass Thru Change\n- **REORG**\n  Reorg CA\n- **SPIN**\n  Stock Spinoff\n- **SPLIT**\n  Stock Split","x-stoplight":{"id":"y6utewjrnwcgk"}},"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"},"TradeActivity":{"title":"TradeActivity","type":"object","properties":{"transaction_time":{"type":"string","format":"date-time","example":"2021-05-10T14:01:04.650275Z","description":"Valid only for trading activity types. Null for non-trading activites."},"type":{"type":"string","enum":["fill","partial_fill"],"example":"fill","description":"Valid only for trading activity types. Null for non-trading activites."},"price":{"type":"string","format":"decimal","example":"3.1415","description":"Valid only for trading activity types. Null for non-trading activites."},"qty":{"type":"string","format":"decimal","example":"0.38921","description":"Valid only for trading activity types. Null for non-trading activites."},"side":{"$ref":"#/components/schemas/OrderSide"},"symbol":{"type":"string","example":"AAPL","description":"Valid only for trading activity types. Null for non-trading activites."},"leaves_qty":{"type":"string","format":"decimal","example":"0.5123","description":"Valid only for trading activity types. Null for non-trading activites."},"order_id":{"type":"string","format":"uuid","example":"fe060a1b-5b45-4eba-ba46-c3a3345d8255","description":"Valid only for trading activity types. Null for non-trading activites."},"cum_qty":{"type":"string","format":"decimal","example":"0.9723","description":"Valid only for trading activity types. Null for non-trading activites."},"order_status":{"$ref":"#/components/schemas/OrderStatus"}},"x-stoplight":{"id":"q0bbbxhqaumis"}},"NonTradeActivity":{"title":"NonTradeActivity","type":"object","properties":{"activity_sub_type":{"$ref":"#/components/schemas/ActivitySubType"},"date":{"type":"string","format":"date","example":"2021-05-21","description":"Valid only for non-trading activity types. Null for trading activites."},"net_amount":{"type":"string","format":"decimal","example":"1234","description":"Valid only for non-trading activity types. Null for trading activites."},"description":{"type":"string","example":"Example description","description":"Valid only for non-trading activity types. Null for trading activites."},"status":{"type":"string","enum":["executed","correct","canceled"],"example":"executed","description":"Valid only for non-trading activity types. Null for trading activites."},"symbol":{"type":"string","example":"AAPL","description":"Valid only for non-trading activity types. Null for trading activites."},"cusip":{"type":"string","example":"037833100","description":"Valid only for non-trading activity types. Null for trading activites."},"qty":{"type":"string","format":"decimal","example":"0.38921","description":"Valid only for non-trading activity types. Null for trading activites."},"per_share_amount":{"type":"string","format":"decimal","example":"0.38921","description":"Valid only for non-trading activity types. Null for trading activites."},"group_id":{"type":"string","format":"uuid","example":"13d96cf3-1cbe-4632-b2f2-86a9df5a3b9d","description":"ID used to link activities who share a sibling relationship"},"created_at":{"type":"string","format":"date-time","example":"2021-05-10T14:01:04.650275Z","description":"Valid only for non-trading activity types. Null for trading activites."}},"x-stoplight":{"id":"iycf52rzeqwkt"}},"ActivityItem":{"title":"ActivityItem","anyOf":[{"$ref":"#/components/schemas/TradeActivity"},{"$ref":"#/components/schemas/NonTradeActivity"}],"x-stoplight":{"id":"y003g9p5i9t0n"}},"AccountDocumentType":{"description":"The type of the account document\n","type":"string","enum":["account_application","account_statement","crypto_account_statement","options_application","tax_statement","trade_confirmation_json","trade_confirmation"],"example":"account_application"},"OwnerDocumentType":{"description":"The type of the owner document","type":"string","enum":["account_approval_letter","address_verification","cip_result","company_formation","date_of_birth_verification","entity_operating_document","entity_registration","hio_declaration_form","identity_verification","limited_trading_authorization","pep_declaration_form","tax_id_verification","w8ben","w9"],"example":"identity_verification","x-stoplight":{"id":"8u8j8gn6uuzk8"}},"OwnerDocumentUploadRequest":{"type":"object","description":"The request to upload a document for an owner of the account","example":{"document_type":"identity_verification","document_sub_type":"passport","content":"/9j/Cg==","mime_type":"image/jpeg"},"title":"OwnerDocumentUploadRequest","x-examples":{"example-1":{"document_type":"identity_verification","document_sub_type":"passport","content":"/9j/Cg==","mime_type":"image/jpeg"}},"x-stoplight":{"id":"s4kbyizjyxroo"},"properties":{"document_type":{"$ref":"#/components/schemas/OwnerDocumentType"},"document_sub_type":{"type":"string","example":"passport","description":"The specific type of document, e.g. passport. This is a free-form property."},"content":{"type":"string","format":"base64","example":"/9j/Cg==","description":"The base64 string encoding of the document contents. This property is required unless content_data is provided."},"content_data":{"$ref":"#/components/schemas/W8benDocument"},"mime_type":{"type":"string","example":"image/jpeg","description":"This field is required if content is specified. ENUM: application/pdf, image/png, or image/jpeg. If document_type is w8ben then application/json is also accepted"}},"required":["document_type","content"]},"KYCResults":{"type":"object","description":"Hold information about the result of KYC. Please see the documentation [here](https://alpaca.markets/docs/api-references/broker-api/events/#kyc-results) for more indepth details","x-stoplight":{"id":"m6so9tt7secvm"},"properties":{"reject":{"$ref":"#/components/schemas/KYCResultType"},"accept":{"$ref":"#/components/schemas/KYCResultType"},"indeterminate":{"$ref":"#/components/schemas/KYCResultType"},"additional_information":{"type":"string","description":"Used to display a custom message."},"summary":{"type":"string","x-stoplight":{"id":"dfz7vejxhvxyk"},"description":"Either `pass` or `fail`. Used to indicate if KYC has completed and passed or not. This field is used for internal purposes only."}}},"StreetAddress":{"type":"string","example":"20 N San Mateo Dr","x-stoplight":{"id":"10wajx98hc79a"}},"Contact":{"type":"object","description":"Contact is the model for the account owner contact information.\n","x-stoplight":{"id":"qcig9irpj9334"},"properties":{"email_address":{"type":"string","format":"email","example":"john.doe@example.com"},"phone_number":{"type":"string","example":"+15556667788","description":"Phone number should include the country code, format: “+15555555555”"},"street_address":{"type":"array","description":"The user's street address. If multiple lines in address, pass in as additional array elements. Maximum of 3 objects in array","items":{"$ref":"#/components/schemas/StreetAddress"}},"unit":{"type":"string","x-stoplight":{"id":"yybrq2o2nb5gy"},"description":"The specific apartment number if applicable"},"city":{"type":"string","example":"San Mateo"},"state":{"type":"string","example":"CA","description":"Required if the country or country_of_tax_residence (in the identity model below) is 'USA'."},"country":{"type":"string","example":"USA","description":"country code in ISO 3166-1 alpha-3 format, representing the country the person/entity resides in."},"postal_code":{"type":"string","example":"94401"}},"required":["email_address","phone_number","street_address","city"]},"Identity":{"type":"object","description":"Identity is the model to provide account owner’s identity information.\n","example":{"given_name":"John","family_name":"Doe","date_of_birth":"1990-01-01","tax_id":"666-55-4321","tax_id_type":"USA_SSN","country_of_citizenship":"AUS","country_of_birth":"AUS","country_of_tax_residence":"USA","funding_source":["employment_income"]},"x-stoplight":{"id":"oi43k8rpw570e"},"properties":{"given_name":{"type":"string","example":"John","description":"The first/given name of the user."},"family_name":{"type":"string","example":"Doe","description":"The last name (surname) of the user."},"middle_name":{"type":"string","x-stoplight":{"id":"p03brcsyyjbcq"},"description":"The middle name of the user."},"date_of_birth":{"type":"string","format":"date","example":"1990-01-01","description":"The date of birth in \"YYYY-MM-DD\" format."},"tax_id":{"type":"string","example":"666-55-4321","description":"Required if tax_id_type is set."},"tax_id_type":{"$ref":"#/components/schemas/TaxIdType"},"country_of_citizenship":{"type":"string","description":"[ISO 3166-1 alpha-3](https://www.iso.org/iso-3166-country-codes.html).\n","example":"USA"},"country_of_birth":{"type":"string","description":"[ISO 3166-1 alpha-3](https://www.iso.org/iso-3166-country-codes.html).\n","example":"USA"},"country_of_tax_residence":{"type":"string","description":"[ISO 3166-1 alpha-3](https://www.iso.org/iso-3166-country-codes.html).\n","example":"USA"},"funding_source":{"type":"array","description":"Can be one or more of the following: `employment_income`, `investments`, `inheritance`, `business_income`, `savings`, `family`.","items":{"type":"string","enum":["employment_income","investments","inheritance","business_income","savings","family"]}},"liquidity_needs":{"type":"string","description":"The user's ability to quickly and easily convert all or part of their investments in this account to cash without significant loss in value. This field is deprecated. Please use the top level `liquidity_needs` field.\n","enum":["very_important","important","somewhat_important","does_not_matter"],"deprecated":true},"investment_experience_with_stocks":{"type":"string","description":"The user's level of expertise and familiarity with investing in US Equities.\n","enum":["none","1_to_5_years","over_5_years"]},"investment_experience_with_options":{"type":"string","description":"The user's level of expertise and familiarity with investing in Options.\n","enum":["none","1_to_5_years","over_5_years"]},"risk_tolerance":{"type":"string","description":"The user's investment risk tolerance. This field is deprecated. Please use the top level `risk_tolerance` field.\n","enum":["conservative","moderate","significant_risk"],"deprecated":true},"investment_objective":{"type":"string","description":"The user's investment objective. This field is deprecated. Please use the top level `investment_objective` field.\n","enum":["generate_income","preserve_wealth","market_speculation","growth","balance_preserve_wealth_with_growth"],"deprecated":true},"investment_time_horizon":{"type":"string","description":"The expected period of time the user plan to invest to achieve his/her financial goal(s). This field is deprecated. Please use the top level `investment_time_horizon` field.\n","enum":["less_than_1_year","1_to_2_years","3_to_5_years","6_to_10_years","more_than_10_years"],"deprecated":true},"annual_income_min":{"type":"number","description":"The lower bound of the user's annual income."},"annual_income_max":{"type":"number","description":"The upper bound of the user's annual income."},"liquid_net_worth_min":{"type":"number","description":"The lower bound of the user's liquid net worth."},"liquid_net_worth_max":{"type":"number","description":"The upper bound of the user's liquid net worth."},"total_net_worth_min":{"type":"number","description":"The lower bound of the user's total net worth."},"total_net_worth_max":{"type":"number","description":"The upper bound of the user's total net worth."},"visa_type":{"type":"string","x-stoplight":{"id":"y5a5r7inu02w8"},"description":"Only used to collect visa types for users residing in the USA."},"visa_expiration_date":{"type":"string","x-stoplight":{"id":"q7b33k53b5alk"},"description":"Required if `visa_type` is set.","format":"date"},"date_of_departure_from_usa":{"type":"string","x-stoplight":{"id":"yasik2wcmshea"},"format":"date","description":"Required if `visa_type` = B1 or B2"},"permanent_resident":{"type":"boolean","x-stoplight":{"id":"jlvzbu3cevmju"},"description":"Only used to collect permanent residence status in the USA."},"marital_status":{"type":"string","description":"The marital status of the user.\n","enum":["SINGLE","MARRIED","DIVORCED","WIDOWED"]},"number_of_dependents":{"type":"integer","description":"The number of dependents the user has.\n"}},"required":["given_name","family_name","date_of_birth","tax_id_type","country_of_tax_residence","funding_source"]},"Disclosures":{"type":"object","description":"Disclosures fields denote if the account owner falls under\neach category defined by FINRA rule. The client has to ask\nquestions for the end user and the values should reflect\ntheir answers.\nIf one of the answers is true (yes), the account goes into\nACTION_REQUIRED status.\n","example":{"is_control_person":false,"is_affiliated_exchange_or_finra":false,"is_politically_exposed":false,"immediate_family_exposed":false},"x-stoplight":{"id":"h3ui3575tdh6q"},"properties":{"employment_status":{"type":"string","enum":["unemployed","employed","student","retired"],"description":"One of the following: `employed`, `unemployed`, `retired`, or `student`."},"employer_name":{"type":"string","description":"The name of the employer if the user is employed."},"employer_address":{"type":"string","description":"The employer's address if the user is employed."},"employment_position":{"type":"string","description":"The user's position if they are employed."},"employment_sector":{"type":"string","description":"The industry sector of employment.\nIf the `employment_status` is `unemployed` or `student`, set this property to `not_employed`.\nIf the `employment_status` is `retired`, set this to `self_employed`.\n","enum":["agriculture","business_management","computers_and_it","construction","education","finance","government","healthcare","hospitality","manufacturing","marketing","media","other","science","self_employed","transportation","not_employed"]},"is_control_person":{"type":"boolean","description":"Whether user holds a controlling position in a publicly traded company, member of the board of directors or has policy making abilities in a publicly traded company."},"is_affiliated_exchange_or_finra":{"type":"boolean","description":"Whether user is affiliated with any exchanges or FINRA."},"is_politically_exposed":{"type":"boolean","description":"Whether the user is politically exposed."},"immediate_family_exposed":{"type":"boolean","description":"If your user’s immediate family member (sibling, husband/wife, child, parent) is either politically exposed or holds a control position."},"context":{"type":"array","description":"Array of annotations describing the rational for marking `is_control_person`, `is_affiliated_exchange_or_finra`, and/or `immediate_family_exposed` as true","nullable":true,"items":{"$ref":"#/components/schemas/DisclosureContextAnnotation"}}},"required":["is_control_person","is_affiliated_exchange_or_finra","is_politically_exposed","immediate_family_exposed"]},"Agreement":{"type":"object","x-stoplight":{"id":"ucn8nh8ei4mag"},"properties":{"agreement":{"$ref":"#/components/schemas/AgreementType"},"signed_at":{"type":"string","example":"2019-09-11T18:09:33Z","format":"date-time","description":"The timestamp the agreement was signed."},"ip_address":{"type":"string","format":"ipv4","example":"185.13.21.99","description":"The ip_address the signed agreements were sent from by the user."},"revision":{"type":"string","description":"The agreement revision.\nThe format is XX.YYYY.MM where XX is an incrementing revision number, YYYY is the year and MM is the month.\nIf the revision is not specified in a POST or PATCH request, the active revision will be used, which will align with the [Alpaca Documents Library](https://alpaca.markets/disclosures).\n"}},"required":["agreement","signed_at","ip_address"]},"AgreementType":{"type":"string","title":"AgreementType","description":"- margin_agreement: Alpaca Margin Agreement\n- account_agreement: Alpaca Account Agreement\n- customer_agreement: Alpaca Customer Agreement\n- crypto_agreement: Alpaca Crypto agreement\n- options_agreement: Alpaca Option agreement\n- custodial_customer_agreement: Alpaca Custodial Customer agreement\n","enum":["margin_agreement","account_agreement","customer_agreement","crypto_agreement","options_agreement"],"example":"customer_agreement","x-stoplight":{"id":"pw9nog92a1hgz"}},"Agreements":{"type":"array","description":"An array of agreements that the end user has viewed and signed.","items":{"$ref":"#/components/schemas/Agreement"},"x-stoplight":{"id":"rgkowddv2zn4r"}},"OptionsApprovalRequest":{"type":"object","properties":{"level":{"type":"integer","description":"The desired option trading level. 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.","enum":[1,2,3],"example":3}}},"OptionsApprovalStatus":{"type":"string","description":"The request status.\n- PENDING: The request is under review.\n- APPROVED: The request has been successfully approved, the account is now able to trade options.\n- LOWER_LEVEL_APPROVED: The request has been approved for a level lower than the requested one.\n- REJECTED: The request has been rejected.\n","enum":["PENDING","APPROVED","LOWER_LEVEL_APPROVED","REJECTED"],"example":"PENDING"},"OptionsApprovalResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The request ID.","example":"88b5f678-fef5-447b-af15-f21e367e6d8c"},"account_id":{"type":"string","format":"uuid","description":"The account ID.","example":"c8f1ef5d-edc0-4f23-9ee4-378f19cb92a4"},"created_at":{"type":"string","format":"date-time","description":"The time when the request was submitted.","example":"2021-03-16T18:38:01.942282Z"},"updated_at":{"type":"string","format":"date-time","description":"The time when the request was last updated.","example":"2021-03-16T18:38:01.942282Z"},"requested_level":{"type":"integer","description":"The request option trading level. 0=Disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.","enum":[0,1,2,3],"example":3},"approved_level":{"type":"integer","description":"The option trading level approved for this request. Only present once the request has completed processiing.\nNote that a subsequent request may be approved for a different level.\n0=Disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\"\n","enum":[0,1,2,3],"example":3},"status":{"$ref":"#/components/schemas/OptionsApprovalStatus"},"requester":{"type":"string","description":"The requester of the options approval request.","enum":["CORRESPONDENT","ALPACA_ADMIN"],"example":"CORRESPONDENT"}}},"OptionsApprovalsList":{"type":"object","description":"A list of options approval requests.","properties":{"options_approvals":{"type":"array","description":"An array of options approval requests.","items":{"$ref":"#/components/schemas/OptionsApprovalResponse"}},"next_page_token":{"$ref":"#/components/schemas/NextPageToken"}}},"OptionsApprovalEvent":{"type":"object","description":"This property is included when the account's approved options level changes.\n","properties":{"approved_level_from":{"type":"integer","description":"The approved options level before the change"},"approved_level_to":{"type":"integer","description":"The approved options level after the change"}}},"TrustedContact":{"type":"object","description":"This model input is optional. However, the client should\nmake reasonable effort to obtain the trusted contact information.\nSee more details in [FINRA Notice 17-11](https://www.finra.org/sites/default/files/Regulatory-Notice-17-11.pdf)\n\nOnly one of the following is required:\n\n* email_address\t\n* phone_number\t\n* street_address\t\n","properties":{"given_name":{"type":"string","example":"Jane"},"family_name":{"type":"string","example":"Doe"},"email_address":{"type":"string","format":"email","description":"at least one of `email_address`, `phone_number` or\n`street_address` is required\n","example":"jane.doe@example.com"},"phone_number":{"type":"string","description":"at least one of `email_address`, `phone_number` or\n`street_address` is required\n"},"street_address":{"type":"array","items":{"type":"string"},"description":"at least one of `email_address`, `phone_number` or\n`street_address` is required\n"},"city":{"type":"string","description":"required if `street_address` is set\n"},"state":{"type":"string","description":"required if `street_address` is set\n"},"postal_code":{"type":"string","description":"required if `street_address` is set\n"},"country":{"type":"string","description":"[ISO 3166-1 alpha-3](https://www.iso.org/iso-3166-country-codes.html).\nrequired if `street_address` is set\n"}},"required":["given_name","family_name"],"example":{"given_name":"Jane","family_name":"Doe","email_address":"jane.doe@example.com"},"x-stoplight":{"id":"fyme2rvoeickd"}},"Beneficiary":{"type":"object","description":"Beneficiary of an account","properties":{"given_name":{"type":"string","example":"Jane"},"middle_name":{"type":"string","example":"P"},"family_name":{"type":"string","example":"Doe"},"date_of_birth":{"type":"string","example":"1970-01-01"},"tax_id":{"type":"string","example":"xxx-xx-xxxx"},"tax_id_type":{"type":"string","example":"USA_SSN"},"relationship":{"type":"string","example":"spouse"},"type":{"type":"string","example":"primary"},"share_pct":{"type":"string","example":"100"}},"required":["given_name","middle_name","family_name","date_of_birth","tax_id","tax_id_type","relationship","type","share_pct"],"example":{"given_name":"Jane","middle_name":"P","family_name":"Doe","date_of_birth":"1970-01-01","tax_id":"xxx-xx-xxxx","tax_id_type":"USA_SSN","relationship":"spouse","type":"primary","share_pct":"100"}},"AccountCashInterestPost":{"type":"object","description":"The configuration of the account's USD cash interest program when creating an account.\nIf cash_interest is not provided and there is a default APR tier defined, that tier will be used.\nTo enroll the account in a non-default APR tier, provide the cash_interest object with the desired apr_tier_name. The status should not be specified on enrollment.\nThe response will contain a status of PENDING_CHANGE. An event showing the status change to ACTIVE will be generated when the enrollment is complete.\n","properties":{"USD":{"$ref":"#/components/schemas/AccountCashInterestProgram"}}},"AccountCashInterestPatch":{"type":"object","description":"Use this property to change the account's configuration for the USD cash interest program.\nTo enroll the account, specify the apr_tier_name. The status should not be specified on enrollment.\nTo change the APR tier, specify the new apr_tier_name. The status should not be specified on tier changes.\nThe unenroll, set the status to INACTIVE.\nAfter any change, the response will contain a status of PENDING_CHANGE.\nAn event showing the status change to ACTIVE (for enrollment or tier changes) or INACTIVE (for unenrollment) will be generated when the change is complete.\n","properties":{"USD":{"$ref":"#/components/schemas/AccountCashInterestProgram"}}},"AccountCashInterestResponse":{"type":"object","description":"The configuration and status of the account's USD cash interest program\n","properties":{"USD":{"$ref":"#/components/schemas/AccountCashInterestProgram"}}},"AccountCashInterestProgram":{"type":"object","properties":{"apr_tier_name":{"type":"string","description":"The unique name of the APR tier for a specific program","example":"gold"},"status":{"type":"string","description":"The status of the account within a cash interest program. One of:\n- **ACTIVE**\nThe account is enrolled and eligible for idle cash to be swept at the end of day (EOD).\n- **INACTIVE**\nThe account is not enrolled due to it either not being eligible (e.g. the updated Alpaca Customer Agreement has not been signed), an APR tier needs to be assigned, or they have been unenrolled.\n- **PENDING_CHANGE**\nAn enrollment, APR Tier change, or unenrollment is in progress\n","example":"ACTIVE"}}},"AccountCashInterestEvent":{"type":"object","description":"This property is included when the account's cash interest program had changed due to an enrollment, APR tier change, or unenrollment.\nThe from and to status or APR tier name will be included in the event, depending on the change.\n","properties":{"currency":{"type":"string","description":"The currency of the cash interest program that changed.","example":"USD"},"apr_tier_name_from":{"type":"string","description":"The APR tier name before the change"},"apr_tier_name_to":{"type":"string","description":"The APR tier name after the change"},"status_from":{"type":"string","description":"The cash_interest program status of the account before the change"},"status_to":{"type":"string","description":"The cash_interest program status of the account after the change"}}},"AccountFPSLPost":{"type":"object","description":"The account's Fully Paid Securities Lending (FPSL) configuration.\nTo enroll the account for a market, specify the tier_id. The status should not be specified on enrollment.\nCurrently only the US market is supported.\n","properties":{"US":{"$ref":"#/components/schemas/AccountFPSLItemPost"}}},"AccountFPSLPatch":{"type":"object","description":"The account's Fully Paid Securities Lending (FPSL) configuration.\nUse this property to change the account's configuration for the FPSL program.\nTo enroll the account for a market, specify the tier_id. The status should not be specified on enrollment.\nTo change the tier, specify the new tier_id. The status should not be specified on tier changes.\nTo unenroll, set the status to INACTIVE.\nTo re-enroll the account, set the status to ACTIVE. You can also specify the tier_id in case you want to change it.\nCurrently only US market is supported.\n","properties":{"US":{"$ref":"#/components/schemas/AccountFPSLItem"}}},"AccountFPSLResponse":{"type":"object","description":"The account's Fully Paid Securities Lending (FPSL) configuration.\nThis is only returned for accounts that have FPSL enabled.\n","properties":{"US":{"$ref":"#/components/schemas/AccountFPSLItem"}}},"AccountFPSLItem":{"type":"object","properties":{"tier_id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The id of the FPSL tier for this market"},"status":{"type":"string","description":"The status of the account for this FPSL market. One of:\n- **ACTIVE**\nThe account is successfully enrolled for FPSL for this market.\n- **INACTIVE**\nThe account is not enrolled for FPSL for this market due to it either not being eligible, an FPSL tier has not been assigned, or it has been unenrolled.\n","example":"ACTIVE"}}},"AccountFPSLItemPost":{"type":"object","properties":{"tier_id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The id of the FPSL tier for this market"}}},"AccountFPSLEvent":{"type":"object","description":"This property is included when the account's FPSL information had changed due to an enrollment, tier change, or unenrollment.\nThe from and to status or tier id will be included in the event, depending on the change.\n","properties":{"US":{"type":"object","properties":{"tier_from":{"type":"string","description":"The tier id before the change"},"tier_to":{"type":"string","description":"The tier id after the change"},"status_from":{"type":"string","description":"The FPSL program status of the account before the change"},"status_to":{"type":"string","description":"The FPSL program status of the account after the change"}}}}},"CreateOrderRequest":{"type":"object","x-stoplight":{"id":"d27prln6qqj0i"},"properties":{"symbol":{"type":"string","example":"AAPL","description":"Symbol or asset ID to identify the asset to trade. Required for all order classes except for `mleg`."},"qty":{"type":"string","format":"decimal","example":"4.124","description":"- For equities, the number of shares to trade. Can be fractionable for only market and day order types.\n- Required for `mleg` order class, represents the number of units to trade of this strategy.\n- For Fixed Income securities, qty represents the order size in par value (face value).\nFor example, to place an order for 1 bond with a face value of $1,000, provide a qty of 1000.\n"},"notional":{"type":"string","format":"decimal","example":"3","description":"Dollar amount to trade. Cannot work with qty. Only market and limit orders supported with time_in_force = day; Only limit orders for extended hours."},"side":{"$ref":"#/components/schemas/OrderSide"},"type":{"$ref":"#/components/schemas/OrderType"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","format":"decimal","example":"3.14","description":"Required if type is `limit` or `stop_limit`.\n- In 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.\n- In case of Fied Income, the price is expressed in percentage of par value (face value).\nPrice is always clean price, meaning it does not include accrued interest."},"stop_price":{"type":"string","format":"decimal","example":"3.14","description":"Required if type is stop or stop_limit"},"trail_price":{"type":"string","format":"decimal","example":"3.14","description":"If type is trailing_stop, then one of trail_price or trail_percent is required"},"trail_percent":{"type":"string","format":"decimal","example":"5.0","description":"If type is trailing_stop, then one of trail_price or trail_percent is required"},"extended_hours":{"type":"boolean","example":false,"description":"Defaults to 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","example":"eb9e2aaa-f71a-4f51-b5b4-52a6c565dad4","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 a 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"}}},"commission":{"type":"string","format":"decimal","example":"1.0","description":"The commission you want to collect from the user."},"commission_bps":{"type":"string","format":"decimal","example":"10","deprecated":true,"description":"**deprecated**: Please use the commission_type = bps instead and set the desired bps value in the `commission` field.\nThe percent commission you want to charge the end user on the order (expressed in bps). Alpaca will convert the order to a notional amount for purposes of calculating commission.\n"},"commission_type":{"$ref":"#/components/schemas/CommissionType"},"source":{"type":"string","x-stoplight":{"id":"6lusmwaj5fmzf"}},"instructions":{"type":"string","x-stoplight":{"id":"8jlb3tz44l3tl"}},"subtag":{"type":"string","x-stoplight":{"id":"zajfuuduk4uss"}},"swap_fee_bps":{"type":"string","x-stoplight":{"id":"hs4bv5gu00jjh"},"format":"decimal"},"position_intent":{"$ref":"#/components/schemas/PositionIntent"}},"required":["type","time_in_force"]},"AssetClass":{"type":"string","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.","enum":["us_equity","us_option","crypto"],"x-stoplight":{"id":"0stvwzkbv2e0u"}},"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 - Options Multileg trading: market, limit.\n - Crypto trading: market, limit, stop_limit.","title":"OrderType"},"OrderSide":{"type":"string","enum":["buy","sell","buy_minus","sell_plus","sell_short","sell_short_exempt","undisclosed","cross","cross_short"],"example":"buy","description":"Represents what side of the transaction an order was on. Required for all order classes except for `mleg`.","x-stoplight":{"id":"zrdcas15ugcl7"}},"OrderClass":{"type":"string","enum":["simple","bracket","oco","oto","mleg"],"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 \"\").","example":"bracket","x-stoplight":{"id":"5lrkevtge17ap"}},"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":"gtc"},"OrderStatus":{"type":"string","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":"filled","x-stoplight":{"id":"742rdkivas7us"}},"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."},"CommissionType":{"type":"string","enum":["notional","qty","bps"],"default":"notional","example":"qty","title":"CommissionType","description":"An enum to select how to interpret the value provided in the commission field.\n\n- notional:\nCharge commission on a per order basis. (When the `commission_type` field is omitted from the order request, this is used as the default).\n\n- qty:\nCharge commission on a per qty/contract basis, pro rated.\n\n- bps:\nThe percent commission you want to charge the end user on the order (expressed in bps). Alpaca will convert the order to a notional amount for purposes of calculating commission.\nCommission value in bps can have up to two decimal places."},"Order":{"type":"object","x-stoplight":{"id":"aygszffe87j44"},"properties":{"id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"Order ID generated by Alpaca"},"client_order_id":{"type":"string","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"Client unique order ID","maxLength":128},"created_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time when order was entered"},"updated_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time of most recent change to the order"},"submitted_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time the order was submitted for execution or, if not yet submitted the created_at time. Because orders are submitted for execution asynchronous to database updates, at times this may be before the created_at time."},"filled_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time the order was filled. Can be null if not filled","nullable":true},"cancel_requested_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time when cancellation or bust was requested (if applicable)","nullable":true},"expired_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"canceled_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"failed_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"replaced_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"replaced_by":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The order ID that this order was replaced by. (Can be null)","nullable":true},"replaces":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The order ID that this order replaces. (Can be null)","nullable":true},"asset_id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The asset ID (For options this represents the option contract ID)"},"symbol":{"type":"string","example":"AALP","description":"The asset symbol"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"notional":{"type":"string","format":"decimal","example":"4.2","description":"Ordered notional amount. If entered, qty will be null. Can take up to 2 decimal points.","nullable":true},"qty":{"type":"string","format":"decimal","example":"4.2","description":"Ordered quantity. If entered, notional will be null. Can take up to 2 decimal points.","nullable":true},"filled_qty":{"type":"string","format":"decimal","example":"4.2","description":"Filled quantity"},"filled_avg_price":{"type":"string","format":"decimal","example":"4.2","description":"Filled average price. Can be 0 until order is processed in case order is passed outside of market hours","nullable":true},"order_class":{"$ref":"#/components/schemas/OrderClass"},"order_type":{"$ref":"#/components/schemas/OrderType"},"type":{"$ref":"#/components/schemas/OrderType"},"side":{"$ref":"#/components/schemas/OrderSide"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","format":"decimal","example":"3.14","description":"Limit price","nullable":true},"stop_price":{"type":"string","format":"decimal","example":"3.14","description":"Stop price","nullable":true},"status":{"$ref":"#/components/schemas/OrderStatus"},"extended_hours":{"type":"boolean","example":true},"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,"items":{"$ref":"#/components/schemas/OrderLeg"}},"trail_price":{"type":"string","format":"decimal","example":"3.14","description":"The dollar value away from the high water mark for trailing stop orders.","nullable":true},"trail_percent":{"type":"string","format":"decimal","example":"5.0","description":"The percent value away from the high water mark for trailing stop orders.","nullable":true},"hwm":{"type":"string","format":"decimal","example":"3.14","description":"The highest (lowest) market price seen since the trailing stop order was submitted.","nullable":true},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"commission":{"type":"string","format":"decimal","example":"3.14","description":"The dollar value commission you want to charge the end user."},"commission_bps":{"type":"string","format":"decimal","example":"10","deprecated":true,"description":"**deprecated**: Please use the commission_type = bps instead and set the desired bps value in the `commission` field.\nThe percent commission you want to charge the end user on the order (expressed in bps). Alpaca will convert the order to a notional amount for purposes of calculating commission.\n"},"commission_type":{"$ref":"#/components/schemas/CommissionType"},"swap_rate":{"type":"string","x-stoplight":{"id":"n291a2g9jl9xe"},"description":"Swap rate is the exchange rate (without mark-up) used to convert the price into local currency or crypto asset"},"swap_fee_bps":{"type":"string","x-stoplight":{"id":"89yg6cj3l3g2h"},"description":"Fee in basis points on top swap rate charged by the correspondent on every order"},"usd":{"type":"object","x-stoplight":{"id":"h8eckru1banfe"},"description":"Nested object to encompass the USD equivalent fields for the local currency fields"}},"required":["id","symbol"]},"OrderLeg":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"Order ID generated by Alpaca"},"client_order_id":{"type":"string","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"Client unique order ID","maxLength":128},"created_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time when order was entered"},"updated_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time of most recent change to the order"},"submitted_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time the order was submitted for execution or, if not yet submitted the created_at time. Because orders are submitted for execution asynchronous to database updates, at times this may be before the created_at time."},"filled_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Time the order was filled. Can be null if not filled","nullable":true},"expired_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"canceled_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"failed_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"replaced_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Can be null","nullable":true},"replaced_by":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The order ID that this order was replaced by. (Can be null)","nullable":true},"replaces":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The order ID that this order replaces. (Can be null)","nullable":true},"asset_id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"The asset ID (For options this represents the option contract ID)"},"symbol":{"type":"string","example":"AALP","description":"The asset symbol"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"notional":{"type":"string","format":"decimal","example":"4.2","description":"Ordered notional amount. If entered, qty will be null. Can take up to 2 decimal points.","nullable":true},"qty":{"type":"string","format":"decimal","example":"4.2","description":"Ordered quantity. If entered, notional will be null. Can take up to 2 decimal points.","nullable":true},"filled_qty":{"type":"string","format":"decimal","example":"4.2","description":"Filled quantity"},"filled_avg_price":{"type":"string","format":"decimal","example":"4.2","description":"Filled average price. Can be 0 until order is processed in case order is passed outside of market hours","nullable":true},"order_class":{"$ref":"#/components/schemas/OrderClass"},"order_type":{"$ref":"#/components/schemas/OrderType"},"type":{"$ref":"#/components/schemas/OrderType"},"side":{"$ref":"#/components/schemas/OrderSide"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","format":"decimal","example":"3.14","description":"Limit price","nullable":true},"stop_price":{"type":"string","format":"decimal","example":"3.14","description":"Stop price","nullable":true},"status":{"$ref":"#/components/schemas/OrderStatus"},"extended_hours":{"type":"boolean","example":true},"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_price":{"type":"string","format":"decimal","example":"3.14","description":"The dollar value away from the high water mark for trailing stop orders.","nullable":true},"trail_percent":{"type":"string","format":"decimal","example":"5.0","description":"The percent value away from the high water mark for trailing stop orders.","nullable":true},"hwm":{"type":"string","format":"decimal","example":"3.14","description":"The highest (lowest) market price seen since the trailing stop order was submitted.","nullable":true},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"commission":{"type":"string","format":"decimal","example":"3.14","description":"The dollar value commission you want to charge the end user."},"commission_bps":{"type":"string","format":"decimal","example":"10","deprecated":true,"description":"**deprecated**: Please use the commission_type = bps instead and set the desired bps value in the `commission` field.\nThe percent commission you want to charge the end user on the order (expressed in bps). Alpaca will convert the order to a notional amount for purposes of calculating commission.\n"},"commission_type":{"$ref":"#/components/schemas/CommissionType"},"swap_rate":{"type":"string","description":"Swap rate is the exchange rate (without mark-up) used to convert the price into local currency or crypto asset"},"swap_fee_bps":{"type":"string","description":"Fee in basis points on top swap rate charged by the correspondent on every order"},"usd":{"type":"object","description":"Nested object to encompass the USD equivalent fields for the local currency fields"}},"required":["id","symbol"]},"MLegOrderLeg":{"description":"Represents an individual leg of a multileg 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","example":"1","description":"proportional quantity of this leg in relation to the overall multileg order qty"}},"required":["symbol","ratio_qty"]},"UpdateOrderRequest":{"type":"object","title":"OrderUpdateRequest","description":"Represents the fields that are editable in an order replace/update call.\n\nNote: client_order_id is currently not editable on its own, one of the other fields must be changed at the same time to effectively replace the order","properties":{"qty":{"type":"string","format":"decimal","example":"4","description":"You can only patch full shares for now.\n\nQty of equity fractional/notional orders are not allowed to change.\nIn case of multi-leg orders represents the number of units to trade of this strategy."},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"limit_price":{"type":"string","format":"decimal","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","format":"decimal","example":"3.14","description":"Required if original order's `type` field was stop or stop_limit"},"trail":{"type":"string","format":"decimal","example":"3.14","description":"The new value of the trail_price or trail_percent"},"client_order_id":{"type":"string","example":"61e69015-8549-4bfd-b9c3-01e75843f47d","description":"A unique identifier for the new order. Automatically generated if not sent. (<= 128 characters)","maxLength":128}},"x-stoplight":{"id":"iip4vylvgdefq"}},"Bank":{"type":"object","x-examples":{"example-1":{"id":"8475c676-68e3-4cfc-a683-9ca2f47a6172","account_id":"56712986-9ff7-4d8f-8e52-077e099e533e","name":"Bank XYZ","status":"QUEUED","country":"","state_province":"","postal_code":"","city":"","street_address":"","account_number":"123456789abc","bank_code":"123456789","bank_code_type":"ABA","created_at":"2022-02-11T21:35:19.268681613Z","updated_at":"2022-02-11T21:35:19.268681613Z"}},"properties":{"id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d"},"created_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Format: 2020-01-01T01:01:01Z"},"updated_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Format: 2020-01-01T01:01:01Z"},"account_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","SENT_TO_CLEARING","APPROVED","REJECTED","CANCELED"],"description":"QUEUED, SENT_TO_CLEARING, APPROVED, REJECTED, CANCELED"},"name":{"type":"string","description":"Name of recipient bank"},"bank_code":{"type":"string","description":"9-Digit ABA RTN (Routing Number) or BIC"},"bank_code_type":{"type":"string","enum":["ABA","BIC"],"description":"ABA (Domestic) or BIC (International)"},"country":{"type":"string","description":"Only for international banks"},"state_province":{"type":"string","description":"Only for international banks"},"postal_code":{"type":"string","description":"Only for international banks"},"city":{"type":"string","description":"Only for international banks"},"street_address":{"type":"string","description":"Only for international banks"},"account_number":{"type":"string"}},"required":["id","created_at","updated_at","name","bank_code","bank_code_type","account_number"],"x-stoplight":{"id":"zb27jqls868ez"}},"CreateBankRequest":{"title":"CreateBankRequest","type":"object","description":"Represents the possible fields to send when creating a new associated Bank resource for an account","x-stoplight":{"id":"dqsm6v1t25vuq"},"properties":{"name":{"type":"string","description":"Name of recipient bank"},"bank_code":{"type":"string","description":"9-Digit ABA RTN (Routing Number) or BIC"},"bank_code_type":{"type":"string","enum":["ABA","BIC"],"description":"ABA (Domestic) or BIC (International)"},"account_number":{"type":"string"},"country":{"type":"string","description":"Only for international banks, ie if bank_code_type = BIC"},"state_province":{"type":"string","description":"Only for international banks, ie if bank_code_type = BIC"},"postal_code":{"type":"string","description":"Only for international banks, ie if bank_code_type = BIC. Minimum of 3 characters"},"city":{"type":"string","description":"Only for international banks, ie if bank_code_type = BIC"},"street_address":{"type":"string","description":"Only for international banks, ie if bank_code_type = BIC"}},"required":["name","bank_code","bank_code_type","account_number"]},"IdentifiedResource":{"title":"IdentifiedResource","type":"object","x-examples":{"example-1":{"id":"61e69015-8549-4bfd-b9c3-01e75843f47d","created_at":"2021-03-16T18:38:01.942282Z","updated_at":"2021-03-16T18:38:01.942282Z"}},"properties":{"id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d"},"created_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Format: 2020-01-01T01:01:01Z"},"updated_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Format: 2020-01-01T01:01:01Z"}},"required":["id","created_at","updated_at"],"description":"TODO: Remove this model","x-internal":true,"x-stoplight":{"id":"np9d1l0a80v2h"}},"ACHRelationship":{"title":"ACHRelationship","type":"object","properties":{"id":{"type":"string","format":"uuid","example":"61e69015-8549-4bfd-b9c3-01e75843f47d"},"created_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Format: 2020-01-01T01:01:01Z"},"updated_at":{"type":"string","format":"date-time","example":"2021-03-16T18:38:01.942282Z","description":"Format: 2020-01-01T01:01:01Z"},"account_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","APPROVED","REJECTED","PENDING","CANCEL_REQUESTED"]},"account_owner_name":{"type":"string","minLength":1,"description":"Name of the account owner"},"bank_account_type":{"type":"string","minLength":1,"enum":["CHECKING","SAVINGS"],"description":"Must be CHECKING or SAVINGS"},"bank_account_number":{"type":"string","minLength":1},"bank_routing_number":{"type":"string","minLength":1},"nickname":{"type":"string","minLength":1}},"required":["id","created_at","updated_at","account_id","status","account_owner_name"],"x-stoplight":{"id":"013jdl3wk8c87"}},"CreateACHRelationshipRequest":{"description":"Represents the fields used in creation of a new ACHRelationship.\n\nYou can create an ACHRelationship by passing the required fields here or if you have an account with Plaid you can use our integration with Plaid to create a relationship.\n\nPlease see the documentation [here](https://alpaca.markets/docs/api-references/broker-api/funding/ach/#plaid-integration-for-bank-transfers) for more info on using Plaid with Alpaca","type":"object","title":"CreateACHRelationshipRequest","x-stoplight":{"id":"2vv9f2s2sc8om"},"properties":{"account_owner_name":{"type":"string","minLength":1},"bank_account_type":{"type":"string","minLength":1,"enum":["CHECKING","SAVINGS"],"description":"Must be `CHECKING` or `SAVINGS`"},"bank_account_number":{"type":"string","minLength":1,"description":"In sandbox, this still must be a valid format"},"bank_routing_number":{"type":"string","minLength":1,"description":"In sandbox, this still must be a valid format"},"nickname":{"type":"string","minLength":1},"processor_token":{"type":"string","description":"If using Plaid, you can specify a Plaid processor token here "},"instant":{"type":"boolean","x-stoplight":{"id":"zs4ueaei5ins9"}}},"required":["account_owner_name","bank_account_type","bank_account_number","bank_routing_number"]},"UntypedACHTransferData":{"title":"UntypedACHTransferData","allOf":[{"$ref":"#/components/schemas/UntypedTransferData"},{"type":"object","properties":{"relationship_id":{"type":"string","format":"uuid"}},"required":["relationship_id"]}],"x-stoplight":{"id":"i9vaag8nhps1u"}},"TransferResource":{"title":"TransferResource","allOf":[{"$ref":"#/components/schemas/IdentifiedResource"},{"type":"object","properties":{"type":{"type":"string","enum":["ach","wire"]},"status":{"type":"string","enum":["QUEUED","APPROVAL_PENDING","PENDING","SENT_TO_CLEARING","REJECTED","CANCELED","APPROVED","COMPLETE","RETURNED"]},"account_id":{"type":"string","format":"uuid"},"reason":{"type":"string","nullable":true},"expires_at":{"type":"string","format":"date-time"}},"required":["type","status","account_id","expires_at"]},{"oneOf":[{"$ref":"#/components/schemas/UntypedACHTransferData"},{"$ref":"#/components/schemas/UntypedWireTransferData"}],"discriminator":{"propertyName":"type","mapping":{"ach":"#/components/schemas/UntypedACHTransferData","wire":"#/components/schemas/UntypedWireTransferData"}}}],"x-stoplight":{"id":"yti97z3bu9rn8"}},"TransferData":{"title":"TransferData","allOf":[{"type":"object","properties":{"transfer_type":{"type":"string","enum":["ach","wire"]},"timing":{"type":"string","enum":["immediate"]}},"required":["transfer_type"]},{"oneOf":[{"$ref":"#/components/schemas/UntypedACHTransferData"},{"$ref":"#/components/schemas/UntypedWireTransferData"}],"discriminator":{"propertyName":"transfer_type","mapping":{"ach":"#/components/schemas/UntypedACHTransferData","wire":"#/components/schemas/UntypedWireTransferData"}}}],"x-stoplight":{"id":"slca0hcxw7fft"}},"UntypedWireTransferData":{"allOf":[{"$ref":"#/components/schemas/UntypedTransferData"},{"type":"object","properties":{"additional_information":{"type":"string"},"bank_id":{"type":"string","format":"uuid"}},"required":["bank_id"]}],"title":"UntypedWireTransferData","x-stoplight":{"id":"nvbjf7idwk0ck"}},"UntypedTransferData":{"title":"UntypedTransferData","type":"object","properties":{"amount":{"type":"string","format":"decimal"},"direction":{"type":"string","enum":["INCOMING","OUTGOING"]}},"required":["amount","direction"],"x-stoplight":{"id":"tjar7yvz35ydv"}},"CreateTransferRequest":{"title":"CreateTransferRequest","type":"object","description":"[See main docs here](https://alpaca.markets/docs/api-references/broker-api/funding/transfers/#creating-a-transfer-entity)","x-stoplight":{"id":"p5r8jvdp1gmvw"},"properties":{"transfer_type":{"$ref":"#/components/schemas/TransferType"},"relationship_id":{"type":"string","format":"uuid","description":"Required if type = `ach`\n\nThe ach_relationship created for the account_id [here](https://alpaca.markets/docs/api-references/broker-api/funding/ach/#creating-an-ach-relationship)"},"bank_id":{"type":"string","format":"uuid","description":"Required if type = `wire`\n\nThe bank_relationship created for the account_id [here](https://alpaca.markets/docs/api-references/broker-api/funding/bank/#creating-a-new-bank-relationship)"},"amount":{"type":"string","format":"decimal","description":"Must be > 0.00"},"direction":{"$ref":"#/components/schemas/TransferDirection"},"timing":{"$ref":"#/components/schemas/TransferTiming"},"additional_information":{"type":"string","description":"Additional details for when type = `wire`","nullable":true},"fee_payment_method":{"$ref":"#/components/schemas/FeePaymentMethod"},"ira":{"$ref":"#/components/schemas/TransferIRA"}},"required":["transfer_type","amount","direction","timing"]},"Transfer":{"title":"Transfer","type":"object","x-examples":{"example-1":{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","relationship_id":"81412018-ffa2-43f9-a3eb-d39f1c5e0f87","bank_id":"f1ae96de-94c1-468e-93a3-6b7213930ca8","account_id":"449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65","type":"ach","status":"QUEUED","reason":"string","amount":"string","direction":"INCOMING","created_at":"2019-08-24T14:15:22Z","updated_at":"2019-08-24T14:15:22Z","expires_at":"2019-08-24T14:15:22Z","additional_information":"string","ira":{"tax_year":"2024","fed_withholding_pct":"10.25","fed_withholding_amount":"102.5","state_withholding_pct":"9.75","state_withholding_amount":"97.5","distribution_reason":"normal"}}},"description":"Transfers allow you to transfer money/balance into your end customers' account (deposits) or out (withdrawal).\n\n[Main docs here](https://alpaca.markets/docs/api-references/broker-api/funding/transfers/#the-transfer-object)","properties":{"id":{"type":"string","format":"uuid","description":"The transfer ID"},"relationship_id":{"type":"string","format":"uuid","description":"The ACH relationship ID only present if type = \"ach\""},"bank_id":{"type":"string","format":"uuid","description":"The ID of the Bank, only present if type = \"wire\""},"account_id":{"type":"string","format":"uuid","description":"The account ID"},"type":{"$ref":"#/components/schemas/TransferType"},"status":{"$ref":"#/components/schemas/TransferStatus"},"reason":{"type":"string","description":"Cause of the status","nullable":true},"amount":{"type":"string","description":"Must be > 0.00","format":"decimal"},"direction":{"$ref":"#/components/schemas/TransferDirection"},"created_at":{"type":"string","format":"date-time","description":"Timedate when transfer was created"},"updated_at":{"type":"string","format":"date-time","description":"Timedate when transfer was updated"},"expires_at":{"type":"string","format":"date-time","description":"Timedate when transfer was expired"},"additional_information":{"type":"string","description":"Additional information. Only applies when type = \"wire\".","nullable":true},"hold_until":{"type":"string","format":"date-time"},"instant_amount":{"type":"string"},"requested_amount":{"type":"string","description":"Must be > 0.00. Only applies when type = \"wire\".","format":"decimal","nullable":true},"fee":{"type":"string","description":"Fee amount to be collected. Only applies when type = \"wire\".","format":"decimal","nullable":true},"fee_payment_method":{"type":"string","description":"Either \"user\" or \"invoice\". Only applies when type = \"wire\".","nullable":true},"ira":{"$ref":"#/components/schemas/TransferIRADetails"}},"required":["id","account_id","type","status","amount","direction","created_at"],"x-stoplight":{"id":"f986mttnx5c4n"}},"TransferType":{"type":"string","example":"ach","enum":["ach","instant_ach","wire"],"description":"**NOTE:** The Sandbox environment currently only supports `ach`\n\n- **ach**\nTransfer via ACH (US Only).\n- **wire**\nTransfer via wire (international).\n","title":"TransferType","x-stoplight":{"id":"bn365jqublfc6"}},"TransferDirection":{"type":"string","example":"INCOMING","enum":["INCOMING","OUTGOING"],"description":"- **INCOMING**\nFunds incoming to user’s account (deposit).\n- **OUTGOING**\nFunds outgoing from user’s account (withdrawal).\n","x-stoplight":{"id":"mda3ylkcj1ceo"}},"TransferTiming":{"type":"string","example":"immediate","enum":["immediate"],"description":"Only `immediate` is currently supported.\n\nvalues:\n\n- **immediate**\n\n- **next_day**","x-stoplight":{"id":"v6623fj1j3umc"}},"TransferIRA":{"description":"This field is used for IRA Account only","type":"object","properties":{"tax_year":{"type":"string","example":"2024"},"distribution_reason":{"type":"string","example":"normal"},"tax_withholding":{"$ref":"#/components/schemas/TransferIRATaxWithholding"}}},"TransferIRATaxWithholding":{"type":"object","properties":{"fed_pct":{"type":"string","example":"10.25"},"state_pct":{"type":"string","example":"8.25"}}},"TransferIRADetails":{"type":"object","properties":{"tax_year":{"type":"string","example":"2024"},"fed_withholding_pct":{"type":"string","example":"10.25"},"fed_withholding_amount":{"type":"string","example":"102.5"},"state_withholding_pct":{"type":"string","example":"9.75"},"state_withholding_amount":{"type":"string","example":"97.5"},"distribution_reason":{"type":"string","example":"normal"}}},"TransferStatus":{"type":"string","example":"QUEUED","enum":["QUEUED","APPROVAL_PENDING","PENDING","SENT_TO_CLEARING","REJECTED","CANCELED","APPROVED","COMPLETE","RETURNED"],"description":"- **QUEUED**\nTransfer is in queue to be processed.\n- **APPROVAL_PENDING**\nTransfer is pending approval.\n- **PENDING**\nTransfer is pending processing.\n- **SENT_TO_CLEARING**\nTransfer is being processed by the clearing firm.\n- **REJECTED**\nTransfer is rejected.\n- **CANCELED**\nClient initiated transfer cancellation.\n- **APPROVED**\nTransfer is approved.\n- **COMPLETE**\nTransfer is completed.\n- **RETURNED**\nThe bank issued an ACH return for the transfer.\n","x-stoplight":{"id":"mqx0hpg6h25vt"}},"Journal":{"title":"Journal","example":{"id":"h7h5g33f-ef01-4458-9a4b-9598727a406f","entry_type":"JNLS","from_account":"8fjkjn-4483-4199-840f-6c5fe0b7ca24","to_account":"3gtt65jd-6f2a-433c-8c33-17b66b8941fa","status":"executed","symbol":"AAPL","qty":"2","settle_date":"2020-12-24","price":"128.23"},"x-examples":{"example":{"id":"h7h5g33f-ef01-4458-9a4b-9598727a406f","entry_type":"JNLS","from_account":"8fjkjn-4483-4199-840f-6c5fe0b7ca24","to_account":"3gtt65jd-6f2a-433c-8c33-17b66b8941fa","status":"executed","symbol":"AAPL","qty":"2","settle_date":"2020-12-24","price":"128.23"},"example-pending":{"id":"6d2cba43-cb57-4534-9603-a6e159167c0a","entry_type":"JNLC","from_account":"3dcb795c-3ccc-402a-abb9-07e26a1b1326","to_account":"2a87c088-ffb6-472b-a4a3-cd9305c8605c","symbol":null,"qty":null,"price":"0","status":"pending","settle_date":"2022-02-17","system_date":"2022-02-17","net_amount":"645","description":""},"example-queued":{"id":"6d2cba43-cb57-4534-9603-a6e159167c0a","entry_type":"JNLC","from_account":"3dcb795c-3ccc-402a-abb9-07e26a1b1326","to_account":"2a87c088-ffb6-472b-a4a3-cd9305c8605c","symbol":"","qty":null,"price":"0","status":"queued","settle_date":null,"system_date":null,"net_amount":"645","description":""}},"description":"Represents a cash or security transfer between accounts, as specified by the `entry_type` parameter.","allOf":[{"type":"object","required":["id","entry_type","from_account","to_account","settle_date"],"properties":{"id":{"type":"string","format":"uuid","description":"journal ID"},"entry_type":{"$ref":"#/components/schemas/JournalEntryType"},"from_account":{"type":"string","format":"uuid","description":"account ID the shares go from"},"to_account":{"type":"string","format":"uuid","description":"account ID the shares go to"},"settle_date":{"type":"string","format":"date"},"status":{"$ref":"#/components/schemas/JournalStatus"},"transmitter_info":{"$ref":"#/components/schemas/TransmitterInfo"},"created_at":{"type":"string","format":"date-time"}}},{"oneOf":[{"$ref":"#/components/schemas/JNLS"},{"$ref":"#/components/schemas/JNLC"}]}],"x-stoplight":{"id":"2isltcm8hzb23"}},"JournalStatus":{"type":"string","enum":["pending","canceled","executed","queued","rejected","deleted"],"description":"Represents the status that a Journal instance can be in.\n\n**Current Values**\n\nqueued\tJournal in queue to be processed. Journal is not processed yet.\n\nsent_to_clearing\tJournal sent to be processed by Alpaca’s booking system. The journal is not processed yet.\n\npending\t    Journal pending to be processed as it requires manual approval from Alpaca operations (for example due to hitting JNLC daily limits).\n\nexecuted\tJournal executed and balances updated for both sides of \nthe journal transaction. This is not a final status, journals can be reversed if there is an error.\n\nrejected\tJournal rejected. Please try again.\n\ncanceled\tJournal canceled. This is a **FINAL** status.\n\nrefused\tJournal refused. Please try again.\n\ndeleted\tJournal deleted. This is a **FINAL** status.\n\ncorrect\tJournal is corrected. Previously executed journal is cancelled and a new journal is corrected amount is created. This is a **FINAL** status.","x-stoplight":{"id":"ay4nu4z1j11cu"}},"JournalEntryType":{"type":"string","title":"","description":"This enum represents the various kinds of Journal alpaca supports.\n\nCurrent values are:\n\n- **JNLC**\n\n  Journal Cash between accounts\n\n- **JNLS**\n\n  Journal Securities between accounts","enum":["JNLC","JNLS"],"x-stoplight":{"id":"itme4epinxsnk"}},"JNLS":{"type":"object","x-examples":{"Example 1":{"id":"f45g67h8-d1fc-4136-aa4f-cf4460aecdfc","to_account":"g7h7rg66-6f2a-433c-8c33-17b66b8941fa","entry_type":"JNLS","symbol":"AAPL","qty":"0.5","price":"128.23","status":"executed","from_account":"8k4f3d-4483-4199-840f-6c5fe0b7ca24","settle_date":"2020-12-24","system_date":"2020-12-24","description":"this is a test journal"}},"properties":{"id":{"type":"string","description":"The journal ID"},"to_account":{"type":"string","description":"The account ID that received the journal - account_status must equal to ACTIVE"},"entry_type":{"type":"string","description":"JNLS"},"symbol":{"type":"string","description":"The symbol of the security journaled"},"qty":{"type":"string","description":"The quantity of the securities journaled"},"price":{"type":"string","description":"The price of the security journaled"},"status":{"$ref":"#/components/schemas/JournalStatus"},"from_account":{"type":"string","description":"The account ID that initiates the journal - account_status must equal to ACTIVE or CLOSE"},"settle_date":{"type":"string","description":"Date string in “%Y-%m-%d” format"},"system_date":{"type":"string","description":"Date string in “%Y-%m-%d” format"},"description":{"type":"string"},"currency":{"type":"string","x-stoplight":{"id":"29s5ect4watc4"},"description":"Currency denomination of the journal. USD by default."}}},"JNLC":{"example":{"id":"f45g67h8-d1fc-4136-aa4f-cf4460aecdfc","entry_type":"JNLC","from_account":"8fjkjn-4483-4199-840f-6c5fe0b7ca24","to_account":"3gtt65jd-6f2a-433c-8c33-17b66b8941fa","status":"pending","net_amount":"115.5"},"description":"Journal information specific to cash transfers. This field is required for `Journal`s with an `entry_type` of `jnlc` (cash transfers), but will be null for those with `jnls` (securities transfers).","type":"object","title":"JNLC","properties":{"description":{"type":"string","description":"ID the amount goes to. Only valid for JNLC journals. Null for JNLS."},"net_amount":{"type":"string","format":"decimal","description":"Only valid for JNLC journals. Null for JNLS."},"transmitter_name":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS. Max 255 characters."},"transmitter_account_number":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS.max 255 characters"},"transmitter_address":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS.max 255 characters"},"transmitter_financial_institution":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS.max 255 characters"},"transmitter_timestamp":{"type":"string","format":"date-time","description":"Only valid for JNLC journals. Null for JNLS."}},"required":["net_amount"],"x-examples":{},"x-stoplight":{"id":"qo2ttptb2frpx"}},"JournalData":{"title":"JournalData","type":"object","properties":{"entry_type":{"$ref":"#/components/schemas/JournalEntryType"},"from_account":{"type":"string","format":"uuid"},"to_account":{"type":"string","format":"uuid"},"amount":{"type":"string","format":"decimal","description":"Required for JNLC.\nThe dollar amount to move. It has to be\na positive value.\n"},"symbol":{"type":"string","description":"Required for JNLS.\n"},"qty":{"type":"string","format":"decimal","description":"Required for JNLS.\nThe number of shares to move. It has to be\na positive value.\n"}},"required":["entry_type","from_account","to_account"],"x-stoplight":{"id":"092vjqryjigtb"}},"JournalResource":{"title":"JournalResource","oneOf":[{"$ref":"#/components/schemas/JNLC"},{"$ref":"#/components/schemas/JNLS"}],"discriminator":{"propertyName":"entry_type","mapping":{"JNLC":"#/components/schemas/JNLC","JNLS":"#/components/schemas/JNLS"}},"x-stoplight":{"id":"p6woubhqxj3os"}},"CreateJournalRequest":{"description":"Journals API allows you to move cash or securities from one account to another.\n\nThis model represents the fields you can specify when creating a Journal\n\nFixture Rules\n\n- No Fixtures\n  - anything below limit is executed immediately\n  - anything above limit is pending until executed at EOD,\n- With Fixtures\n  - any status = rejected will be rejected EOD\n  - any status = pending will be pending forever","type":"object","x-examples":{"example-1":{"from_account":"c94bu7rn-4483-4199-840f-6c5fe0b7ca24","entry_type":"JNLC","to_account":"fn68sbrk-6f2a-433c-8c33-17b66b8941fa","amount":"51","description":"test text /fixtures/status=rejected/fixtures/"}},"x-stoplight":{"id":"u380o5uqf31kl"},"properties":{"to_account":{"type":"string","minLength":1,"format":"uuid","description":"The account_id you wish to journal to"},"from_account":{"type":"string","minLength":1,"format":"uuid","description":"The account_id you wish to journal from"},"entry_type":{"$ref":"#/components/schemas/JournalEntryType"},"amount":{"type":"string","description":"Required if `entry_type` = `JNLC`"},"symbol":{"type":"string","description":"Required if `entry_type` = `JNLS`"},"qty":{"type":"string","description":"Required if `entry_type` = `JNLS`"},"description":{"type":"string","description":"Max 1024 characters. Can include fixtures for amounts that are above the transaction limit","maxLength":1024},"transmitter_name":{"type":"string","maxLength":255,"description":"Max 255 characters. See more details about [Travel Rule](https://alpaca.markets/docs/broker/integration/funding/#travel-rule) in our main documentation."},"transmitter_account_number":{"type":"string","maxLength":255,"description":"Max 255 characters. See more details about [Travel Rule](https://alpaca.markets/docs/broker/integration/funding/#travel-rule) in our main documentation."},"transmitter_address":{"type":"string","maxLength":255,"description":"Max 255 characters. See more details about [Travel Rule](https://alpaca.markets/docs/broker/integration/funding/#travel-rule) in our main documentation."},"transmitter_financial_institution":{"type":"string","maxLength":255,"description":"Max 255 characters. See more details about [Travel Rule](https://alpaca.markets/docs/broker/integration/funding/#travel-rule) in our main documentation."},"transmitter_timestamp":{"type":"string","description":"RFC 3339 format. See more details about [Travel Rule](https://alpaca.markets/docs/broker/integration/funding/#travel-rule) in our main documentation.","format":"date-time"},"currency":{"type":"string","x-stoplight":{"id":"9ilfs11vxvcbi"}}},"required":["to_account","from_account","entry_type"]},"BatchJournalRequest":{"title":"BatchJournalRequest","type":"object","description":"Journals API allows you to move cash or securities from one account to another.\n\nThis model represents the fields you can specify when creating a request of many Journals out of one account to many others at once.","properties":{"entry_type":{"type":"string","enum":["JNLC"],"description":"Only supports `JNLC` for now"},"from_account":{"type":"string","format":"uuid","description":"The account id that is the originator of the funds being moved. Most likely is your Sweep Firm Account"},"description":{"type":"string","description":"Journal description, gets returned in the response"},"entries":{"type":"array","minItems":1,"description":"An array of objects describing to what accounts you want to move funds into and how much to move into for each account","items":{"type":"object","properties":{"to_account":{"type":"string","format":"uuid","description":"The ID of the account that you want to journal funds into"},"amount":{"type":"string","description":"Journal amount in USD"},"currency":{"type":"string","description":"Currency"},"transmitter_name":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS. Max 255 characters."},"transmitter_account_number":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS.max 255 characters"},"transmitter_address":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS.max 255 characters"},"transmitter_financial_institution":{"type":"string","description":"Only valid for JNLC journals. Null for JNLS.max 255 characters"},"transmitter_timestamp":{"type":"string","format":"date-time"},"description":{"type":"string","description":"Journal entry description, gets returned in the response"}},"required":["to_account","amount"]}}},"required":["entry_type","from_account","entries"],"x-stoplight":{"id":"cqujg5wj52fpz"}},"BatchJournalResponse":{"title":"BatchJournalResponse","description":"A Journal object with an extra attribute error_message in the case when a specific account fails to receive a journal.","allOf":[{"$ref":"#/components/schemas/Journal"},{"type":"object","properties":{"error_message":{"type":"string","description":"Description of why this journal transaction failed"}},"required":["error_message"]}],"x-examples":{"example-1":{"error_message":"","id":"56f106e5-25a4-4eee-96fa-25bb05dc86bc","entry_type":"JNLC","from_account":"8f8c8cee-2591-4f83-be12-82c659b5e748","to_account":"399f85f1-cbbd-4eaa-a934-70027fb5c1de","symbol":"","qty":null,"price":null,"status":"pending","settle_date":null,"system_date":null,"net_amount":"1000","description":""}},"x-stoplight":{"id":"ls0561ikjlnez"}},"ReverseBatchJournalRequest":{"type":"object","x-examples":{"Example 1":{"entry_type":"JNLC","to_account":"8f8c8cee-2591-4f83-be12-82c659b5e748","entries":[{"from_account":"8e00606a-c9ac-409a-ba45-f55e8f77984a","amount":"10"},{"from_account":"b9b19618-22dd-4e80-8432-fc9e1ba0b27d","amount":"100"},{"from_account":"c96a5e16-7fca-425a-b67b-0814d064bfc0","amount":"100"}]}},"properties":{"entry_type":{"type":"string","enum":["JNLC"],"description":"Only supports `JNLC` for now"},"to_account":{"type":"string","description":"The destination of funds. Most likely is your Sweep Firm Account"},"entries":{"type":"array","items":{"type":"object","properties":{"from_account":{"type":"string","description":"The ID of the from_account that you want to journal from"},"amount":{"type":"string","description":"Journal amount in USD"},"description":{"type":"string","x-stoplight":{"id":"xlfz4halme40h"},"description":"Journal description, gets returned in the response"}}}}}},"Asset":{"title":"Asset","type":"object","description":"Assets are sorted by asset class, exchange and symbol. Some assets are not tradable with Alpaca. These assets will be marked with the flag tradable=false","x-stoplight":{"id":"2bnou9t588bau"},"properties":{"id":{"type":"string","example":"904837e3-3b76-47ec-b432-046db621571b","format":"uuid","description":"Asset ID"},"class":{"$ref":"#/components/schemas/AssetClass"},"exchange":{"$ref":"#/components/schemas/Exchange"},"symbol":{"type":"string","example":"AAPL","description":"The symbol of the asset"},"name":{"type":"string","example":"Apple Inc. Common Stock","description":"The official name of the asset"},"status":{"type":"string","enum":["active","inactive"],"description":"active or inactive","example":"active"},"tradable":{"type":"boolean","example":true,"description":"Asset is tradable on Alpaca or not"},"marginable":{"type":"boolean","example":true,"description":"Asset is marginable or not"},"shortable":{"type":"boolean","example":true,"description":"Asset is shortable or not"},"easy_to_borrow":{"type":"boolean","example":true,"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","example":true,"description":"Asset is fractionable or not"},"min_order_size":{"type":"string","x-stoplight":{"id":"8oxfe2lh08pa5"},"description":"Minimum order size.  Field available for crypto only."},"min_trade_increment":{"type":"string","x-stoplight":{"id":"9x4innaekt0bo"},"description":"Amount a trade quantity can be incremented by. Field available for crypto only."},"price_increment":{"type":"string","x-stoplight":{"id":"y3hwtbjswugep"},"description":"Amount the price can be incremented by. Field available for crypto only."},"maintenance_margin_requirement":{"type":"number","x-stoplight":{"id":"w0vp53j3weqge"},"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":"o1v8vair7lg7a"},"description":"Supported values `ptp_no_exception`, `ptp_with_exception`, `ipo`, `has_options`, `options_late_close`, `fractional_eh_enabled`, `overnight_tradable`, `overnight_halted`.\nWe will include unique characteristics of the asset here.\nNote: `overnight_tradable` and `overnight_halted` are only available when overnight trading is enabled.","items":{"x-stoplight":{"id":"8q7bxjwl5evxu"},"type":"string","enum":["ptp_no_exception","ptp_with_exception","ipo","has_options","options_late_close","fractional_eh_enabled","overnight_tradable","overnight_halted"]},"example":["ptp_no_exception","ipo"]}},"required":["id","class","exchange","symbol","name","status","tradable","marginable","shortable","easy_to_borrow","fractionable","maintenance_margin_requirement","margin_requirement_long","margin_requirement_short"]},"AssetEntryRequirements":{"title":"AssetEntryRequirements","type":"object","description":"Defines the necessary conditions that must be met to initiate a position for a specific asset","required":["symbol"],"properties":{"symbol":{"type":"string","example":"AAPL","description":"The symbol (or asset id) of the requested asset"},"regt_long":{"type":"string","format":"decimal","description":"The percentage of the asset's market value required as Reg T (2x) buying power to open a long position","example":"0.5"},"regt_short":{"type":"string","format":"decimal","description":"The percentage of the asset's market value required as Reg T (2x) buying power to open a short position","example":"0.5"},"dtbp_long":{"type":"string","format":"decimal","description":"The percentage of the asset's market value required as Day Trading (4x) buying power to open a long position","example":"0.25"},"dtbp_short":{"type":"string","format":"decimal","description":"The percentage of the asset's market value required as Day Trading (4x) buying power to open a short position","example":"0.3"}}},"Exchange":{"type":"string","title":"Exchange","example":"NASDAQ","description":"Represents the exchange where an asset is traded.\n\nFor Stocks:\n- AMEX\n- ARCA\n- BATS\n- NYSE\n- NASDAQ\n- NYSEARCA\n- OTC\n\nFor Crypto:\n- CRYPTO","enum":["AMEX","ARCA","BATS","NYSE","NASDAQ","NYSEARCA","OTC"],"x-stoplight":{"id":"og9z1j3oimssn"}},"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":{"type":"object","x-examples":{"example-1":{"asset_id":"93f58d0b-6c53-432d-b8ce-2bad264dbd94","symbol":"AAPL","exchange":"NASDAQ","asset_class":"us_equity","asset_marginable":false,"qty":"4","qty_available":"4","avg_entry_price":"172.08","side":"long","market_value":"688.32","cost_basis":"688.32","unrealized_pl":"0","unrealized_plpc":"0","unrealized_intraday_pl":"0","unrealized_intraday_plpc":"0","current_price":"172.08","lastday_price":"168.88","change_today":"0.0189483657034581"}},"x-stoplight":{"id":"b2tmookzpqlzr"},"properties":{"asset_id":{"type":"string","example":"904837e3-3b76-47ec-b432-046db621571b","format":"uuid","description":"Asset ID (For options this represents the option contract ID)"},"symbol":{"type":"string","example":"AAPL","description":"Asset symbol"},"exchange":{"type":"string","example":"NASDAQ","description":"Exchange name of the asset"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"asset_marginable":{"type":"boolean","description":"Indicates if this asset is marginable"},"avg_entry_price":{"type":"string","example":"100.0","description":"Average entry price of the position"},"qty":{"type":"string","example":"5","description":"The number of shares"},"qty_available":{"type":"string","example":"5","description":"Total number of shares available minus open orders / locked for options covered call"},"side":{"type":"string","example":"long","enum":["long","short"]},"market_value":{"type":"string","format":"decimal","example":"600.0","description":"Total market value of the position"},"cost_basis":{"type":"string","format":"decimal","example":"500.0","description":"Total cost basis"},"unrealized_pl":{"type":"string","format":"decimal","example":"100.0","description":"Unrealized profit/loss"},"unrealized_plpc":{"type":"string","format":"decimal","example":"0.20","description":"Unrealized profit/loss percent (by a factor of 1)"},"unrealized_intraday_pl":{"type":"string","format":"decimal","example":"10.0","description":"Unrealized profit/loss for the day"},"unrealized_intraday_plpc":{"type":"string","format":"decimal","example":"0.0084","description":"Unrealized interday profit/loss percent (by a factor of 1)"},"current_price":{"type":"string","format":"decimal","example":"120.0","description":"Current asset price per share"},"lastday_price":{"type":"string","format":"decimal","example":"119.0","description":"Last day’s asset price per share based on the closing value of the last trading day"},"change_today":{"type":"string","format":"decimal","example":"0.0084","description":"Percent change from last day price (by a factor of 1)"},"swap_rate":{"type":"string","format":"decimal","description":"The latest swap rate. This is only returned for LCT accounts.","example":"1.50","x-stoplight":{"id":"t02dt3rtisrkx"}},"avg_entry_swap_rate":{"type":"string","format":"decimal","description":"The average swap rate of the position. This is only returned for LCT accounts.","example":"1.40","x-stoplight":{"id":"a0kh9eu3byvfp"}},"usd":{"$ref":"#/components/schemas/USDPosition"}},"required":["asset_id","symbol","exchange","asset_class","avg_entry_price","qty","qty_available","side","market_value","cost_basis","unrealized_pl","unrealized_plpc","unrealized_intraday_pl","unrealized_intraday_plpc","current_price","lastday_price","change_today"]},"PDTStatus":{"type":"object","properties":{"account_id":{"type":"string","example":"93f58d0b-6c53-432d-b8ce-2bad264dbd94","format":"uuid","description":"Account ID"},"pdt":{"type":"boolean","example":true,"description":"Account is currently flagged as Pattern Day Trader"},"pdt_removed":{"type":"boolean","example":true,"description":"The account has previously utilized its one-time PDT removal entitlement, and is not allowed to submit any further removal requests"},"pdt_removed_at":{"type":"string","format":"date-time","description":"Date and time when PDT was removed for the account. Null if PDT flag has never been lifted.","nullable":true}}},"PDTRemoval":{"type":"object","properties":{"id":{"type":"string","example":"52f8574c-96d5-49b6-94c1-2570a268434e","format":"uuid","description":"Unique ID"},"account_id":{"type":"string","example":"93f58d0b-6c53-432d-b8ce-2bad264dbd94","format":"uuid","description":"Account ID"},"status":{"type":"string","enum":["approved","rejected"],"example":"rejected","description":"The request status"},"created_at":{"type":"string","format":"date-time","description":"The request date and time"},"reason":{"type":"string","example":"account is already approved once","description":"Reason of rejection"}}},"OrderClosedResponse":{"title":"OrderClosedResponse","type":"object","description":"Represents the result of asking the api to cancel an Order.\n","x-examples":{},"properties":{"id":{"type":"string","description":"UUID of the order that was canceled","format":"uuid"},"status":{"type":"integer","description":"Http status code for the attempt to close this Order"},"body":{"$ref":"#/components/schemas/Order"}},"required":["id","status"],"x-stoplight":{"id":"gm6lf1ox4q0j2"}},"PositionClosedResponse":{"title":"PositionClosedResponse","type":"object","description":"Represents the result of asking the api to close a position.\n\n`body` is the Order used to close out the position.","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,"commision":"1.0"}}},"properties":{"symbol":{"type":"string","description":"Symbol name of the asset"},"status":{"type":"integer","description":"Http status code for the attempt to close this position"},"body":{"$ref":"#/components/schemas/Order"}},"required":["symbol","status"],"x-stoplight":{"id":"86zc8o19d0xih"}},"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"}},"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"}},"x-stoplight":{"id":"kjmp5ewl4g6k3"}},"Calendar":{"title":"Calendar","type":"object","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.","x-stoplight":{"id":"6w3glz9nvzann"},"properties":{"date":{"type":"string","example":"2021-04-06","format":"date","description":"Date string in YYYY-MM-DD format"},"open":{"type":"string","example":"09:30","description":"The time the market opens at on this date in HH:MM format"},"close":{"type":"string","example":"16:00","description":"The time the market closes at on this date in HH:MM format"},"session_open":{"type":"string","example":"0700","deprecated":true,"description":"this field has been deprecated please ignore"},"session_close":{"type":"string","example":"1900","deprecated":true,"description":"this field has been deprecated please ignore"},"settlement_date":{"type":"string","x-stoplight":{"id":"6lmmqwon4mjk0"},"description":"Date string in “%Y-%m-%d” format. representing the settlement date for the trade date"}},"required":["date","open","close"]},"Error":{"title":"Error","type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"}},"required":["code","message"],"x-stoplight":{"id":"xu9mkrgjdtotd"}},"Clock":{"description":"Represents the current market time and open/close events.","type":"object","x-examples":{"example":{"timestamp":"2018-04-01T12:00:00.000Z","is_open":true,"next_open":"2018-04-01T12:00:00.000Z","next_close":"2018-04-01T12:00:00.000Z"},"example-1":{"timestamp":"2022-02-16T13:06:05.210563128-05:00","is_open":true,"next_open":"2022-02-17T09:30:00-05:00","next_close":"2022-02-16T16:00:00-05:00"}},"title":"Clock","x-stoplight":{"id":"rfhpxij3x0o6m"},"properties":{"timestamp":{"type":"string","minLength":1,"format":"date-time","description":"Current timestamp","example":"2022-02-16T13:06:05.210563128-05:00"},"is_open":{"type":"boolean","description":"Whether the market is open or not"},"next_open":{"type":"string","minLength":1,"format":"date-time","description":"Next market open timestamp - inclusive of timestamp"},"next_close":{"type":"string","minLength":1,"format":"date-time","description":"Next market close timestamp - inclusive of timestamp"}},"required":["timestamp","is_open","next_open","next_close"]},"CountryInfos":{"description":"Represents the info for countries as a map where the keys are the ISO 3166 country codes.","type":"object","additionalProperties":{"$ref":"#/components/schemas/CountryInfo"},"title":"CountryInfos","x-stoplight":{"id":"5lnmrwon3mjk0"}},"CountryInfo":{"description":"Represents the info for a country.","type":"object","x-examples":{"example":"\"ZAF\": {\n    \"full_name\": \"South Africa\",\n    \"crypto_risk_rating\": \"high\",\n    \"securities_risk_rating\": \"high\"\n}\n","example-1":"\"USA\": {\n  \"full_name\": \"United States of America\",\n  \"crypto_risk_rating\": \"medium\",\n  \"securities_risk_rating\": \"medium\",\n  \"crypto_supported_states\": [\n      \"CA\",\n      \"CT\",\n      \"GA\",\n      \"IA\",\n      \"ID\",\n      \"IL\",\n      \"IN\",\n      \"KS\",\n      \"KY\",\n      \"MA\",\n      \"MD\",\n      \"ME\",\n      \"MI\",\n      \"MS\",\n      \"MO\",\n      \"MT\",\n      \"NC\",\n      \"ND\",\n      \"NE\",\n      \"OH\",\n      \"RI\",\n      \"SD\",\n      \"UT\",\n      \"VT\",\n      \"WA\"\n  ]\n}\n"},"title":"CountryInfo","x-stoplight":{"id":"k7nxrton4myk1"},"properties":{"full_name":{"type":"string","minLength":1,"description":"The full name of the country definded by ISO 3166-1","example":"Åland Islands"},"crypto_risk_rating":{"type":"string","enum":["low","medium","high","prohibited"],"description":"crypto risk rating of the country"},"securities_risk_rating":{"type":"string","enum":["low","medium","high","prohibited"],"description":"the securities risk rating of the country"},"crypto_supported_states":{"type":"array","description":"states where Alpaca supports crypto trading","items":{"type":"string","description":"the state code defined by ISO 3166-2"}}},"required":["full_name","securities_risk_rating","crypto_risk_rating"]},"AccountStatusEvent":{"description":"Represents a change to certain account properties, sent over the events streaming API.\n","type":"object","x-examples":{"example-1":{"account_id":"4db36989-6565-4011-9126-39fe6b3d9bf6","account_number":"","at":"2021-06-14T09:59:15.232782Z","event_id":122039,"event_ulid":"01F84ZC0H0Q1QN7XPNWX44HF5J","kyc_results":null,"status_from":"","status_to":"APPROVED"}},"title":"AccountStatusEvent","x-stoplight":{"id":"u28ukdg1k63c1"},"properties":{"account_id":{"type":"string","description":"The unique identifier of the account that was changed","minLength":1},"account_number":{"type":"string","description":"The account number of the account that was changed","minLength":1},"at":{"type":"string","minLength":1,"description":"timestamp of event"},"event_id":{"type":"integer","description":"monotonically increasing 64bit integer"},"event_ulid":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"},"account_blocked":{"type":"boolean","x-stoplight":{"id":"ubzoqqxv9p34z"},"description":"If true the account was blocked, if false, the account got unblocked"},"admin_configurations":{"$ref":"#/components/schemas/AdminConfigurations"},"cash_interest":{"$ref":"#/components/schemas/AccountCashInterestEvent"},"options":{"$ref":"#/components/schemas/OptionsApprovalEvent"},"fspl":{"$ref":"#/components/schemas/AccountFPSLEvent"},"crypto_status_from":{"type":"string","x-stoplight":{"id":"7fgoyvh2ttwzz"},"description":"account crypto_status changed from"},"crypto_status_to":{"type":"string","x-stoplight":{"id":"g15q2jn26klem"},"description":"account crypto_status changed to"},"kyc_results":{"$ref":"#/components/schemas/KYCResults"},"pattern_day_trader":{"type":"boolean","x-stoplight":{"id":"05mrhvc4aaeyy"},"description":"If true the pattern_day_trader flag was set for the account, if false, the flag was reset."},"reason":{"type":"string","minLength":1,"deprecated":true},"status_from":{"type":"string","description":"The account status before the change","example":"APPROVED"},"status_to":{"type":"string","description":"The account status after the change","example":"ACTIVE"},"trading_blocked":{"type":"boolean","x-stoplight":{"id":"tb42kskazg9zr"},"description":"If true the account cannot trade going forward, if false, the ban has been lifed"}},"required":["account_id","at","event_id","event_ulid"]},"JournalStatusEvent":{"description":"Represents a change in a Journal's status, sent over the events streaming api.\n","type":"object","x-examples":{"example-1":{"at":"2021-05-07T10:28:23.163857Z","entry_type":"JNLC","event_id":1406,"event_ulid":"01F535Y1FVY8WZHE763HCNS8SZ","journal_id":"2f144d2a-91e6-46ff-8e37-959a701cc58d","status_from":"","status_to":"queued"}},"title":"JournalStatusEvent","properties":{"at":{"type":"string","minLength":1,"description":"Timestamp of event","format":"date-time"},"entry_type":{"$ref":"#/components/schemas/JournalEntryType"},"event_id":{"type":"integer","description":"Monotonically increasing 64bit integer"},"event_ulid":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"},"journal_id":{"type":"string","description":"The UUID of the related Journal","format":"uuid"},"status_from":{"$ref":"#/components/schemas/JournalStatus"},"status_to":{"$ref":"#/components/schemas/JournalStatus"}},"required":["at","entry_type","event_id","event_ulid","journal_id","status_from","status_to"],"x-stoplight":{"id":"0pbdls2h4h8za"}},"JournalStatusEventV2":{"description":"Represents a change in a Journal's status, sent over the events streaming api.\n","type":"object","x-examples":{"example-1":{"at":"2021-05-07T10:28:23.163857Z","entry_type":"JNLC","event_id":"01F535Y1FVY8WZHE763HCNS8SZ","journal_id":"2f144d2a-91e6-46ff-8e37-959a701cc58d","status_from":"","status_to":"queued"}},"title":"JournalStatusEvent","properties":{"at":{"type":"string","minLength":1,"description":"Timestamp of event","format":"date-time"},"entry_type":{"$ref":"#/components/schemas/JournalEntryType"},"event_id":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"},"journal_id":{"type":"string","description":"The UUID of the related Journal","format":"uuid"},"status_from":{"$ref":"#/components/schemas/JournalStatus"},"status_to":{"$ref":"#/components/schemas/JournalStatus"}},"required":["at","entry_type","event_id","journal_id","status_from","status_to"],"x-stoplight":{"id":"0pbdls2h4h8zb"}},"TransferStatusEvent":{"description":"Represents a change in a Transfer's status, sent over the events streaming api.","type":"object","x-examples":{"example-1":{"account_id":"8e00606a-c9ac-409a-ba45-f55e8f77984a","at":"2021-06-10T19:52:24.066998Z","event_id":15961,"event_ulid":"01F7VQQ782DM57SJNWAYMD14J9","status_from":"QUEUED","status_to":"SENT_TO_CLEARING","transfer_id":"c4ed4206-697b-4859-ab71-b9de6649859d"},"example-2":{"account_id":"8e00606a-c9ac-409a-ba45-f55e8f77984a","at":"2021-06-10T20:02:24.280178Z","event_id":15962,"status_from":"SENT_TO_CLEARING","status_to":"COMPLETE","transfer_id":"c4ed4206-697b-4859-ab71-b9de6649859d"}},"title":"TransferStatusEvent","properties":{"account_id":{"type":"string","minLength":1,"description":"Account UUID","format":"uuid"},"at":{"type":"string","minLength":1,"description":"Timedate of when the transfer status changed","format":"date-time"},"event_id":{"type":"integer","description":"Monotonically increasing 64bit integer"},"event_ulid":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"},"status_from":{"$ref":"#/components/schemas/TransferStatus"},"status_to":{"$ref":"#/components/schemas/TransferStatus"},"transfer_id":{"type":"string","minLength":1,"description":"Transfer UUID","format":"uuid"}},"required":["account_id","at","event_id","event_ulid","status_from","status_to","transfer_id"],"x-stoplight":{"id":"ch42mh3ekwcmy"}},"StatusFundingEvent":{"description":"Represents a change in a Funding entity's status, sent over the events streaming api. Currently, the suppported entities are: bank relationships, bank wires and transfers.","type":"object","x-examples":{"example-1":{"event_id":"01F7VQQ782DM57SJNWAYMD14J9","at":"2025-04-11T19:52:24.066998Z","account_id":"8e00606a-c9ac-409a-ba45-f55e8f77984a","correspondent":"LPCA","entity_id":"c4ed4206-697b-4859-ab71-b9de6649859d","entity_type":"BankRelationship","status_from":null,"status_to":"QUEUED"},"example-2":{"event_id":"01F7VQQ782DM57SJNWAYMD14J9","at":"2025-04-11T19:52:24.066998Z","account_id":"8e00606a-c9ac-409a-ba45-f55e8f77984a","correspondent":"LPCA","entity_id":"c4ed4206-697b-4859-ab71-b9de6649859d","entity_type":"BankRelationship","status_from":"QUEUED","status_to":"REJECTED","reason":"bank account owner name does not match brokerage account name"}},"title":"StatusFundingEvent","properties":{"event_id":{"type":"string","format":"ulid","minLength":1,"description":"lexically sortable, monotonically increasing character array"},"at":{"type":"string","minLength":1,"description":"Timedate of when the transfer status changed"},"account_id":{"type":"string","minLength":1,"description":"Account UUID","format":"uuid"},"correspondent":{"type":"string","minLength":1,"maxLength":4,"description":"Correspondent's code","format":"ABCD"},"entity_id":{"type":"string","minLength":1,"description":"Entity's UUID","format":"uuid"},"entity_type":{"type":"string","minLength":1,"description":"Valid values are BankRelationship, WireBank and Transfer.","format":"uuid"},"status_from":{"type":"string","description":"Valid values are based on entity type:\n- BankRelationship:\n  - QUEUED\n  - CANCEL_REQUESTED\n  - CANCEL_SENT\n  - CANCEL_FAILED\n  - PENDING\n  - SENT_TO_CLEARING\n  - APPROVED\n  - CANCELED\n  - REJECTED\n- WireBank:\n  - QUEUED\n  - SENT_TO_CLEARING\n  - APPROVED\n  - CANCELED\n  - REJECTED\n- Transfer:\n  - QUEUED\n  - APPROVAL_PENDING\n  - CANCELED\n  - EXPIRED\n  - APPROVED\n  - REJECTED\n  - SENT_TO_CLEARING\n  - COMPLETE\n  - RETURNED\n"},"status_to":{"type":"string","minLength":1,"description":"Valid values are based on entity type:\n- BankRelationship:\n  - QUEUED\n  - CANCEL_REQUESTED\n  - CANCEL_SENT\n  - CANCEL_FAILED\n  - PENDING\n  - SENT_TO_CLEARING\n  - APPROVED\n  - CANCELED\n  - REJECTED\n- WireBank:\n  - QUEUED\n  - SENT_TO_CLEARING\n  - APPROVED\n  - CANCELED\n  - REJECTED\n- Transfer:\n  - QUEUED\n  - APPROVAL_PENDING\n  - CANCELED\n  - EXPIRED\n  - APPROVED\n  - REJECTED\n  - SENT_TO_CLEARING\n  - COMPLETE\n  - RETURNED\n"},"reason":{"type":"string","description":"Used when an a bank relationship is rejected, a wire bank is canceled, etc."}},"required":["event_id","at","account_id","correspondent","entity_id","entity_type","status_to"],"x-stoplight":{"id":"ch42mh3ekwcmy"}},"NonTradeActivityEvent":{"description":"Represents a non-trade activity SSE event","type":"object","x-examples":{"example-1":{"id":"afb78fa2-7e4c-4e0a-bca2-2e0d26a87f88","qty":0,"status":"executed","symbol":null,"entry_type":"JNLC","net_amount":10,"description":null,"settle_date":"2024-11-26","system_date":"2024-11-26","account_id":"8e00606a-c9ac-409a-ba45-f55e8f77984a","at":"2024-11-26T15:25:17.803914Z","event_ulid":"01JDMH7BKCCB4XY5F11HN63NZX"},"example-2":{"id":"d96cea8a-6a77-46cd-bb7b-df6d74442653","qty":0,"status":"executed","symbol":null,"entry_type":"FEE","net_amount":-0.01,"description":"TAF fee for proceed of 0.010052895 shares (1 trades) on 2024-11-11 by 613651765","settle_date":"2024-11-12","system_date":"2024-11-11","entry_sub_type":"TAF","account_id":"11629972-5fd6-4e14-ad9e-0f0cabd2777f","at":"2024-11-12T01:15:53.132425Z","event_ulid":"01JCEZ1ZDCE44GFX6WZ75N4199"}},"title":"NonTradeActivityEvent","properties":{"id":{"type":"string","description":"Record UUID","format":"uuid"},"qty":{"type":"number","description":"Quantity of the stock affected. 0 for cash events","format":"decimal"},"status":{"type":"string","enum":["executed","correct","canceled"],"example":"executed","description":"Status of the event"},"symbol":{"type":"string","example":"AAPL","description":"Symbol the event is associated with, empty string when no symbol is applicable"},"cusip":{"type":"string","example":"037833100","description":"CUSIP the event is associated with, not present when no CUSIP is applicable"},"entry_type":{"type":"string","example":"JNLC","description":"Type of entry for e.g JNLC, FEE, INT, DIVNRA etc"},"net_amount":{"type":"number","format":"decimal","example":1,"description":"Net amount if applicable, 0 otherwise"},"description":{"type":"string","example":"Example description","description":"Additional information about the event, empty string if not applicable"},"settle_date":{"type":"string","description":"Date of settlement if applicable","format":"date"},"system_date":{"type":"string","description":"Date of the event recorded in the system","format":"date"},"price":{"type":"string","format":"decimal","example":"0.38921","description":"Price if applicable."},"per_share_amount":{"type":"number","format":"decimal","example":0.3,"description":"Per share amount if applicable"},"account_id":{"type":"string","description":"Account UUID","format":"uuid"},"at":{"type":"string","description":"Timedate of when the event was emitted","format":"date-time"},"event_id":{"type":"integer","description":"Monotonically increasing 64bit integer"},"event_ulid":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"}},"required":["account_id","at","id","event_ulid","system_date","settle_date","net_amount","entry_type","description"],"x-stoplight":{"id":"ch42mh3ekwcmy"}},"TradeUpdateEventType":{"type":"string","description":"**Common events**\n\nThese are the events that are the expected results of actions you may have taken by sending API requests.\n\nThe meaning of the `timestamp` field changes for each type; the meanings have been specified here for which types the\ntimestamp field will be present.\n\n- `new`: Sent when an order has been routed to exchanges for execution.\n- `fill`: Sent when your order has been completely filled.\n  - `timestamp`: The time at which the order was filled.\n- `partial_fill`: Sent when a number of shares less than the total remaining quantity on your order has been filled.\n  - `timestamp`: The time at which the shares were filled.\n- `canceled`: Sent when your requested cancellation of an order is processed.\n  - `timestamp`: The time at which the order was canceled.\n- `expired`: Sent when an order has reached the end of its lifespan, as determined by the order’s time in force value.\n  - `timestamp`: The time at which the order expired.\n- `done_for_day`: Sent when the order is done executing for the day, and will not receive further updates until the next trading day.\n- `replaced`: Sent when your requested replacement of an order is processed.\n  - `timestamp`: The time at which the order was replaced.\n\n**Rarer events**\n\nThese are events that may rarely be sent due to unexpected circumstances on the exchanges. It is unlikely you will need to design your code around them, but you may still wish to account for the possibility that they will occur.\n\n- `rejected`: Sent when your order has been rejected.\n  - `timestamp`: The time at which the rejection occurred.\n- `pending_new`: Sent when the order has been received by Alpaca and routed to the exchanges, but has not yet been accepted for execution.\n- `stopped`: Sent when your order has been stopped, and a trade is guaranteed for the order, usually at a stated price or better, but has not yet occurred.\n- `pending_cancel`: Sent when the order is awaiting cancellation. Most cancellations will occur without the order entering this state.\n- `pending_replace`: Sent when the order is awaiting replacement.\n- `calculated`: Sent when the order has been completed for the day - it is either `filled` or `done_for_day` - but remaining settlement calculations are still pending.\n- `suspended`: Sent when the order has been suspended and is not eligible for trading.\n- `order_replace_rejected`: Sent when the order replace has been rejected.\n- `order_cancel_rejected`: Sent when the order cancel has been rejected.\n- `trade_bust`: Sent when a previously reported execution has been canceled (“busted”) by the upstream exchange.\n- `trade_correct`: Sent when a previously reported trade has been corrected. For example, the exchange may have updated the price, quantity, or another execution parameter after the trade was initially reported.\n- `restated`: Sent when the order is manually modified.\n","enum":["new","fill","partial_fill","canceled","expired","done_for_day","replaced","rejected","pending_new","stopped","pending_cancel","pending_replace","calculated","suspended","order_replace_rejected","order_cancel_rejected","trade_bust","trade_correct"],"x-stoplight":{"id":"hsatty9b5tgrf"}},"TradeUpdateEvent":{"description":"Represents an update to an order/trade, sent over the events streaming api.","type":"object","title":"TradeUpdateEvent","x-examples":{"example-1":{"account_id":"529248ad-c4cc-4a50-bea4-6bfd2953f83a","at":"2022-04-19T14:12:30.656741Z","event":"new","event_id":37782,"event_ulid":"01G112NTT0XAXKDZK3AABK68TH","execution_id":"7e544af3-3104-4e1a-8cbc-dab2624949ff","order":{"asset_class":"us_equity","asset_id":"a4778bc8-fad1-47b7-87fe-d5cde10d43f4","canceled_at":null,"client_order_id":"6d873193-dac6-4f72-8e13-c57853a9339d","commission":"1","created_at":"2022-04-19T10:12:30.57117938-04:00","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"edada91a-8b55-4916-a153-8c7a9817e708","legs":null,"limit_price":"700","notional":null,"order_class":"","order_type":"limit","qty":"4","replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","status":"new","stop_price":null,"submitted_at":"2022-04-19T10:12:30.403135025-04:00","symbol":"TSLA","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"limit","updated_at":"2022-04-19T10:12:30.609783218-04:00"},"timestamp":"2022-04-19T14:12:30.602193534Z"}},"properties":{"account_id":{"type":"string","minLength":1,"description":"Account UUID","format":"uuid"},"at":{"type":"string","minLength":1,"description":"Timestamp of event","format":"date-time"},"event":{"$ref":"#/components/schemas/TradeUpdateEventType"},"event_id":{"type":"integer","format":"int64","description":"Monotonically increasing 64bit integer"},"event_ulid":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"},"execution_id":{"type":"string","description":"Corresponding execution of an order. If an order gets filled over two executions (a partial_fill for example), you will receive two events with different IDs.","format":"uuid"},"previous_execution_id":{"type":"string","description":"ID of the original execution that was busted or corrected (present only in trade_bust and trade_correct events).","format":"uuid"},"order":{"$ref":"#/components/schemas/Order"},"timestamp":{"type":"string","description":"Has various different meanings depending on the value of `event`, please see the [Trading Events](https://alpaca.markets/docs/api-references/broker-api/events/#trade-events)\nEnum in the documentation or the TradeUpdateEventType model for more details on when it means different things.\n","format":"date-time"},"price":{"type":"string","x-stoplight":{"id":"7v2z4p5jcbe43"},"description":"Only present when event is either `fill` or `partial_fill`. The average price per share at which the order was filled."},"position_qty":{"type":"string","x-stoplight":{"id":"cfhfaf0iswtge"},"description":"Only present when event is either `fill` or `partial_fill`. The size of your total position, after this fill event, in shares. Positive for long positions, negative for short positions."},"qty":{"type":"string","x-stoplight":{"id":"1nwk8erh23zic"},"description":"Only present when event is either `fill` or `partial_fill`. The amount of shares this Trade order was for"}},"required":["account_id","at","event","event_id","event_ulid","execution_id","order","timestamp"]},"TradeUpdateEventV2":{"description":"Represents an update to an order/trade, sent over the events streaming api.","type":"object","title":"TradeUpdateEvent","properties":{"account_id":{"type":"string","minLength":1,"description":"Account UUID","format":"uuid"},"at":{"type":"string","minLength":1,"description":"Timestamp of event","format":"date-time"},"event":{"$ref":"#/components/schemas/TradeUpdateEventType"},"event_id":{"type":"string","format":"ulid","description":"lexically sortable, monotonically increasing character array"},"execution_id":{"type":"string","description":"Corresponding execution of an order. If an order gets filled over two executions (a partial_fill for example), you will receive two events with different IDs.\nNot present for `MultilegOptions`\n","format":"uui"},"previous_execution_id":{"type":"string","description":"ID of the original execution that was busted or corrected (present only in trade_bust and trade_correct events).","format":"uuid"},"order":{"$ref":"#/components/schemas/Order"},"timestamp":{"type":"string","description":"Has various different meanings depending on the value of `event`, please see the [Trading Events](https://alpaca.markets/docs/api-references/broker-api/events/#trade-events)\nEnum in the documentation or the TradeUpdateEventType model for more details on when it means different things.\n","format":"date-time"},"price":{"type":"string","description":"Only present when event is either `fill` or `partial_fill`. The average price per share at which the order was filled."},"swap_rate":{"type":"string","description":"Only present for `local currency trading account` or `crypto asset trade` when event is either `fill` or `partial_fill`. The swap rate at which the current trade was filled."},"position_qty":{"type":"string","description":"Only present when event is either `fill` or `partial_fill` other than `MultilegOptions`. The size of your total position, after this fill event, in shares. Positive for long positions, negative for short positions.\n"},"position_qtys":{"type":"string","description":"Only present when event is either `fill` or `partial_fill` for `MultilegOptions`. The size of your total position, after this fill event, in shares. Positive for long positions, negative for short positions.\n"},"qty":{"type":"string","description":"Only present when event is either `fill`, `partial_fill`, `trade_bust` and `trade_correct`. The amount of shares this Trade order was for. <br /> For `trade_bust` events, the qty field may be negative, representing a reversal of the original quantity."},"legs":{"type":"array","description":"Only present when event is for `MultilegOptions`. Represents filled qty/price of legs.\n","items":{"$ref":"#/components/schemas/TradeUpdateEventV2Leg"}}}},"TradeUpdateEventV2Leg":{"description":"Represents filled qty/price of legs.","type":"object","title":"TradeUpdateEventV2Leg","properties":{"qty":{"type":"string","description":"The amount of shares filled for this event"},"price":{"type":"string","description":"The average price per share for this event."},"symbol":{"type":"string","description":"Symbol of an asset"},"order_id":{"type":"string","minLength":1,"description":"Order UUID","format":"uuid"},"timestamp":{"type":"string","description":"Timestamp of this event leg\n","format":"date-time"},"execution_id":{"type":"string","description":"Corresponding execution of an order. If an order gets filled over two executions (a partial_fill for example), you will receive two events with different IDs.","format":"uuid"}}},"AdminActionEventGeneral":{"description":"Represents general fields for all AdminAction type","type":"object","title":"AdminActionEvent","properties":{"event_id":{"type":"string","format":"ulid","description":"Lexically sortable, monotonically increasing character array"},"replaces_event_id":{"type":"string","format":"ulid","description":"Id of the replaced event (optional)"},"at":{"type":"string","format":"date-time","description":"Timestamp of event"},"belongs_to":{"$ref":"#/components/schemas/AdminActionBelongsTo"},"created_by":{"$ref":"#/components/schemas/AdminActionCreatedBy"},"type":{"$ref":"#/components/schemas/AdminActionType"},"category":{"$ref":"#/components/schemas/AdminActionCategory"},"visibility":{"$ref":"#/components/schemas/AdminActionVisibility"},"note":{"type":"string","description":"Free text form description of the admin action"},"correspondent":{"type":"string","description":"Related correspondent"}},"required":["event_id","at","belongs_to","created_by","type","category","visibility","note","correspondent","context"]},"AdminActionLegacyNote":{"description":"Represents structure of a LegacyNote type AdminAction","x-examples":{"example-1":{"event_id":"01GTVS4FVS2KJDTPYH2WM6NAXF","at":"2023-03-06T16:38:01Z","belongs_to":{"kind":"account","value":"0bbf1dd7-4235-4eca-8b1a-0db63572c735"},"created_by":{"kind":"admin","value":"19455a3c-595f-457f-97b3-64a2b5aeae96"},"type":"legacy_note_admin_event","category":"other","visibility":"internal","note":"Performed action: Positions split AMZN (long): 1.011266402\n","correspondent":"LPCA","context":null}},"allOf":[{"$ref":"#/components/schemas/AdminActionEventGeneral"},{"type":"object","title":"AdminActionContextLegacyNote","properties":{"context":{"description":"Variable schema type which depends on the type","type":"object"}}}]},"AdminActionLiquidation":{"description":"Represents structure of a Liquidation type AdminAction","x-examples":{"example-1":{"event_id":"01GTVS4FVS2KJDTPYH2WM6NAXF","at":"2023-03-06T16:38:01Z","belongs_to":{"kind":"account","value":"0bbf1dd7-4235-4eca-8b1a-0db63572c735"},"created_by":{"kind":"admin","value":"19455a3c-595f-457f-97b3-64a2b5aeae96"},"type":"liquidation_admin_event","category":"accounts","visibility":"external","note":"Performed action: Position liquidated: Asset: TSLA, Quantity: 0.0001, Reason: Liquidation due to real time risk\n","correspondent":"LPCA","context":{"symbol":"TSLA","reason":"Liquidation due to real time risk","available_qty":"0.0001","requested_qty":"0.0001","error":""}}},"allOf":[{"$ref":"#/components/schemas/AdminActionEventGeneral"},{"type":"object","title":"AdminActionContextLiquidation","properties":{"context":{"description":"Variable schema type which depends on the type","type":"object","properties":{"symbol":{"type":"string"},"reason":{"type":"string"},"available_qty":{"type":"string","format":"decimal"},"requested_qty":{"type":"string","format":"decimal"},"error":{"type":"string"}}}}}]},"AdminActionTransactionCancel":{"description":"Represents structure of a TransactionCancel type AdminAction","x-examples":{"example-1":{"event_id":"01GTVS4FVS2KJDTPYH2WM6NAXF","at":"2023-03-06T16:38:01Z","belongs_to":{"kind":"account","value":"0bbf1dd7-4235-4eca-8b1a-0db63572c735"},"created_by":{"kind":"admin","value":"19455a3c-595f-457f-97b3-64a2b5aeae96"},"type":"transaction_cancel_admin_event","category":"accounts","visibility":"external","note":"\"Transaction fdf18af2-142b-409e-8aad-d1731e276af0 cancelled for LPCA-12345678\n","correspondent":"LPCA","context":{"transaction_id":"fdf18af2-142b-409e-8aad-d1731e276af0","entry_type":"JNLC","external_id":"d5eede2c-1c08-45df-9800-87ad5eefc11f"}}},"allOf":[{"$ref":"#/components/schemas/AdminActionEventGeneral"},{"type":"object","title":"AdminActionContextTransactionCancel","properties":{"context":{"description":"Variable schema type which depends on the type","type":"object","properties":{"transaction_id":{"type":"string","format":"uuid"},"entry_type":{"type":"string"},"external_id":{"type":"string"}}}}}]},"AdminActionBelongsTo":{"description":"Represents structure of an Identifier for all AdminAction type","type":"object","title":"AdminActionBelongsTo","properties":{"kind":{"$ref":"#/components/schemas/AdminActionBelongsToKind"},"id_reference":{"type":"string"}}},"AdminActionCreatedBy":{"description":"Represents structure of an Creator's Identifier for all AdminAction type\n","type":"object","title":"AdminActionCreatedBy","properties":{"kind":{"$ref":"#/components/schemas/AdminActionCreatedByKind"},"id_reference":{"type":"string"}}},"AdminActionBelongsToKind":{"enum":["account","owner","correspondent"]},"AdminActionCreatedByKind":{"enum":["admin"]},"AdminActionType":{"description":"Type of the Admin Action","enum":["liquidation_admin_event","legacy_note_admin_event","transaction_cancel_admin_event"]},"AdminActionCategory":{"description":"Category of the Admin Action","enum":["order","other"]},"AdminActionVisibility":{"description":"Visibility of the Admin Action","enum":["internal","external","correspondent_only"]},"Watchlist":{"title":"Watchlist","type":"object","description":"Represents a set of securities observed by a user.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the watchlist itself.\n"},"account_id":{"type":"string","format":"uuid","description":"Unique identifier of the account that owns this watchlist.\n"},"created_at":{"type":"string","format":"date-time","description":"When watchlist was created"},"updated_at":{"type":"string","format":"date-time","description":"When watchlist was last updated"},"name":{"type":"string","pattern":"^[a-zA-Z0-9]+$","description":"User friendly Name of watchlist"},"assets":{"type":"array","description":"The contents of the watchlist, in the order as registered","items":{"$ref":"#/components/schemas/Asset"}}},"required":["id","account_id","created_at","updated_at","name"]},"WatchlistWithoutAsset":{"title":"Watchlist","type":"object","description":"Represents a set of securities observed by a user.","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the watchlist itself.\n"},"account_id":{"type":"string","format":"uuid","description":"Unique identifier of the account that owns this watchlist.\n"},"created_at":{"type":"string","format":"date-time","description":"When watchlist was created"},"updated_at":{"type":"string","format":"date-time","description":"When watchlist was last updated"},"name":{"type":"string","pattern":"^[a-zA-Z0-9]+$","description":"User friendly Name of watchlist"}},"required":["id","account_id","created_at","updated_at","name"]},"Announcement":{"description":"The announcements endpoint contains public information on previous and upcoming dividends, mergers, spinoffs, and stock splits.\n\nAnnouncement data is made available through the API as soon as it is ingested by Alpaca, which is typically the following trading day after the declaration date. This provides insight into future account stock position and cash balance changes that will take effect on an announcement’s payable date. Additionally, viewing previous announcement details can improve bookkeeping and reconciling previous account cash and position changes.","type":"object","x-examples":{"example-1":{"id":"bebc5ece-34be-47e9-b944-687e69a102be","corporate_action_id":"78467X109_AA22","ca_type":"dividend","ca_sub_type":"cash","initiating_symbol":"DIA","initiating_original_cusip":"252787106","target_symbol":"DIA","target_original_cusip":"252787106","declaration_date":"2021-12-19","ex_date":"2022-01-21","record_date":"2022-01-24","payable_date":"2022-02-14","cash":"0","old_rate":"1","new_rate":"1"}},"title":"Announcement","properties":{"id":{"type":"string","minLength":1,"description":"ID that is specific to a single announcement."},"corporate_action_id":{"type":"string","minLength":1,"description":"ID that remains consistent across all announcements for the same corporate action. Unlike ‘id’, this can be used to connect multiple announcements to see how the terms have changed throughout the lifecycle of the corporate action event."},"ca_type":{"$ref":"#/components/schemas/AnnouncementCAType"},"ca_sub_type":{"$ref":"#/components/schemas/AnnouncementCASubType"},"initiating_symbol":{"type":"string","minLength":1,"description":"Symbol of the company initiating the announcement."},"initiating_original_cusip":{"type":"string","minLength":1,"description":"CUSIP of the company initiating the announcement."},"target_symbol":{"type":"string","minLength":1,"description":"Symbol of the child company involved in the announcement.","nullable":true},"target_original_cusip":{"type":"string","minLength":1,"description":"CUSIP of the child company involved in the announcement.","nullable":true},"declaration_date":{"type":"string","minLength":1,"description":"Date the corporate action or subsequent terms update was announced."},"ex_date":{"type":"string","minLength":1,"description":"The first date that purchasing a security will not result in a corporate action entitlement.","nullable":true},"record_date":{"type":"string","minLength":1,"description":"The date an account must hold a settled position in the security in order to receive the corporate action entitlement.","nullable":true},"payable_date":{"type":"string","minLength":1,"description":"The date the announcement will take effect. On this date, account stock and cash balances are expected to be processed accordingly."},"cash":{"type":"string","minLength":1,"description":"The amount of cash to be paid per share held by an account on the record date.","nullable":true},"old_rate":{"type":"string","minLength":1,"description":"The denominator to determine any quantity change ratios in positions.","nullable":true},"new_rate":{"type":"string","minLength":1,"description":"The numerator to determine any quantity change ratios in positions.","nullable":true}},"required":["id","corporate_action_id","ca_type","ca_sub_type","initiating_symbol","initiating_original_cusip","target_symbol","target_original_cusip","declaration_date","ex_date","record_date","payable_date","cash","old_rate","new_rate"],"x-stoplight":{"id":"6xtmj2bgzu4y4"}},"AnnouncementCAType":{"type":"string","description":"Announcements have both a type and a subtype to categorize them. This model represents the higher level abstract \"types\" of Announcement. Please see the AnnouncementCASubType model for finer grain descriptions of the subtypes\n\nPossible values are:\n- dividend\n  can have `cash` and `stock` subtypes\n- merger\n  has `merger_update` and `merger_completion` sub types\n- split\n  has `stock_split`, `until_split`, `reverse_split`, and `recapitalization` sub types\n- spinoff\n  currently has only the `spinoff` subtype and thus is just this higher level category for now. A disbursement of a newly tradable security when the intiating_symbol creates the target_symbol.","title":"","enum":["dividend","merger","split","spinoff"],"example":"dividend","x-stoplight":{"id":"9u6s2oez5fadz"}},"AnnouncementCASubType":{"type":"string","description":"Announcements have both a type and a subtype to categorize them. This model represents the lowever level abstract \"sub types\" of Announcement. Please see the AnnouncementCAType model for higher level descriptions of the possible types\n\nPossible values are:\n\n- from the `dividend` type:\n  - **cash**\n\n    A cash payment based on the number of shares the account holds on the record date.\n  - **stock**\n\n    A stock payment based on the number of shares the account holds on the record date.\n\n- from the `merger` type:\n  - **merger_update**\n\n    An update to the terms of an upcoming merger. This can happen any number of times before the merger is completed and can be tracked by using the id parameter.\n\n  - **merger_completion**\n\n    A final update in the terms of the merger in which the intiating_symbol will acquire the target_symbol. Any previous terms updates for this announcement will have the same id value.\n\n- from the `split` type:\n  - **stock_split**\n\n    An increase in the number of shares outstanding with a decrease in the dollar value of each share. The new_rate and old_rate parameters will be returned in order to derive the ratio of the split\n  - **until_split**\n\n    An increase in the number of shares outstanding with a decrease in the dollar value of each share. The new_rate and old_rate parameters will be returned in order to derive the ratio of the split.\n  - **reverse_split**\n\n    A decrease in the number of shares outstanding with an increase in the dollar value of each share. The new_rate and old_rate parameters will be returned in order to derive the ratio of the spli\n  - **recapitalization**\n\n    A stock recapitalization, typically used by a company to adjust debt and equity ratios.\n\n- from the `spinoff` type:\n  - **spinoff**\n\n    A disbursement of a newly tradable security when the intiating_symbol creates the target_symbol.","title":"","enum":["cash","stock","merger_update","merger_completion","stock_split","until_split","reverse_split","recapitalization","spinoff"],"x-stoplight":{"id":"r7r5e6m7z8zue"}},"OathClientResponse":{"title":"OathClientResponse","type":"object","example":{"client_id":"7a3c52a910e1dc2abbb14da2b6b8e711","name":"TradingApp","description":"Sample description","url":"http://test.com","terms_of_use":"","privacy_policy":"","status":"ACTIVE","redirect_uri":["http://localhost"],"live_trading_approved":true},"x-examples":{"example-1":{"client_id":"7a3c52a910e1dc2abbb14da2b6b8e711","name":"TradingApp","description":"Sample description","url":"http://test.com","terms_of_use":"","privacy_policy":"","status":"ACTIVE","redirect_uri":["http://localhost"],"live_trading_approved":true}},"properties":{"client_id":{"type":"string","description":"OAuth client id"},"name":{"type":"string","description":"Broker name (your name)"},"description":{"type":"string"},"url":{"type":"string"},"terms_of_use":{"type":"string","description":"URL of Terms of Use"},"privacy_policy":{"type":"string","description":"URL of Privacy Policy"},"status":{"type":"string","enum":["ACTIVE","DISABLED"],"description":"ACTIVE or DISABLED","example":"ACTIVE"},"redirect_uri":{"type":"array","items":{"type":"string"}},"live_trading_approved":{"type":"boolean","example":true}},"x-stoplight":{"id":"qlcf3oshsqct1"}},"OAuthTokenRequest":{"title":"OAuthTokenRequest","type":"object","example":{"client_id":"7a3c52a910e1dc2abbb14da2b6b8e711","client_secret":"bbb14da2b6b8e7117a3c52a910e1dc2a","redirect_uri":"http://localhost","scope":"general","account_id":"0d18ae51-3c94-4511-b209-101e1666416b"},"properties":{"client_id":{"type":"string","description":"OAuth client ID"},"client_secret":{"type":"string","description":"OAuth client secret"},"redirect_uri":{"type":"string","description":"redirect URI for the OAuth flow"},"scope":{"type":"string","description":"scopes requested by the OAuth flow"},"account_id":{"type":"string","format":"uuid","description":"end-user account ID"}},"required":["client_id","client_secret","redirect_uri","scope","account_id"],"description":"This model is used for both the Issue and Authorize OAuth token routes","x-stoplight":{"id":"a9yeydszevnuj"}},"IssueOAuthTokenResponse":{"description":"","type":"object","x-examples":{"example-1":{"access_token":"87586f14-c3f4-4912-b107-f75bc17ff87a","token_type":"Bearer","scope":"general"}},"properties":{"access_token":{"type":"string","description":"OAuth token"},"token_type":{"type":"string","description":"Always `Bearer`","enum":["Bearer"],"example":"Bearer"},"scope":{"type":"string","description":"Token’s scope"}},"required":["access_token","token_type","scope"],"x-stoplight":{"id":"7ljatwc79gihj"}},"AuthorizeOAuthTokenResponse":{"description":"","type":"object","x-examples":{"example-1":{"code":"912b5502-c983-40f7-a01d-6a66f13a754d","client_id":"7a3c52a910e1dc2abbb14da2b6b8e711","redirect_uri":"http://localhost","scope":""}},"properties":{"code":{"type":"string","minLength":1,"description":"OAuth code to exchange with token"},"client_id":{"type":"string","minLength":1,"description":"OAuth `client_id`"},"redirect_uri":{"type":"string","minLength":1,"description":"Redirect URI of OAuth flow"},"scope":{"type":"string","description":"Granted scopes"}},"required":["code","client_id","redirect_uri","scope"],"x-stoplight":{"id":"uz6o7d02lbaxp"}},"CreateWatchlistRequest":{"title":"CreateWatchlistRequest","type":"object","description":"This model represents the fields you can specify when Creating or Updating/Replacing a Watchlist","properties":{"name":{"type":"string","description":"The watchlist name"},"symbols":{"type":"array","description":"The new list of symbol names to watch","items":{"type":"string","example":"[\"AAPL\", \"TSLA\"]"}}},"required":["name","symbols"],"x-stoplight":{"id":"8vevle6of8odv"}},"DisclosureContextAnnotation":{"title":"DisclosureContextAnnotation","type":"object","properties":{"context_type":{"type":"string","enum":["CONTROLLED_FIRM","IMMEDIATE_FAMILY_EXPOSED","AFFILIATE_FIRM"],"description":"Specifies the type of disclosure annotation. Valid types are FINRA affiliations, for users affiliated with or employed by a FINRA member firm, a Stock Exchange Member, FINRA, Registered Investment Advisor, or a Municipal Securities Broker/Dealer; Company control relationships, for senior executives, and 10% or greater shareholders, of a publicly traded company; and immediate family members of politically exposed individuals."},"company_name":{"type":"string","description":"Required for FINRA affiliations and controlled firms."},"company_street_address":{"type":"string","description":"Required for FINRA affiliations and controlled firms."},"company_city":{"type":"string","description":"Required for FINRA affiliations and controlled firms."},"company_state":{"type":"string","description":"Required if and only if `company_country` is `USA`."},"company_country":{"type":"string","description":"Required for FINRA affiliations and controlled firms."},"company_compliance_email":{"type":"string","description":"Required for FINRA affiliations and controlled firms."},"given_name":{"type":"string","description":"Required for immediate family members of politically exposed persons."},"family_name":{"type":"string","description":"Required for immediate family members of politically exposed persons."}},"required":["context_type"],"x-stoplight":{"id":"rf62uwbtfdfpk"}},"W8benDocument":{"type":"object","x-examples":{"Example 1":{"additional_conditions":"None","country_citizen":"Australia","date":"2021-06-14","date_of_birth":"1970-01-01","foreign_tax_id":"123 456 789","ftin_not_required":false,"full_name":"John Doe","ip_address":"127.0.0.1","mailing_address_city_state":"Adelaide, South Australia","mailing_address_country":"Australia","mailing_address_street":"51 Main St","paragraph_number":"15","percent_rate_withholding":5,"permanent_address_city_state":"Adelaide, South Australia","permanent_address_country":"Australia","permanent_address_street":"20 Main St","reference_number":"abc123","residency":"Australia","revision":"10-2021","tax_id_ssn":"123-00-456","timestamp":"2021-06-14T09:31:05Z","income_type":"interest","signer_full_name":"Mr. Signing User"}},"description":"Use this property (instead of the content property) to upload W-8 BEN data in JSON format.","properties":{"additional_conditions":{"type":"string","description":"Any additional conditions to specify"},"country_citizen":{"type":"string","description":"The country that the applicant is a citizen of"},"date":{"type":"string","format":"date","description":"date signed"},"date_of_birth":{"type":"string","format":"date","description":"date of birth of applicant"},"foreign_tax_id":{"type":"string","description":"Applicant's tax id in their home country"},"ftin_not_required":{"type":"boolean","description":"Required if foreign_tax_id and tax_id_ssn are empty."},"full_name":{"type":"string","description":"Full name of applicant"},"ip_address":{"type":"string","description":"IP address of applicant when signed"},"mailing_address_city_state":{"type":"string","description":"Mailing city/state of applicant"},"mailing_address_country":{"type":"string","description":"Mailing country for applicant"},"mailing_address_street":{"type":"string","description":"Mailing street address for applicant"},"paragraph_number":{"type":"string"},"percent_rate_withholding":{"type":"integer"},"permanent_address_city_state":{"type":"string","description":"Permanent city/state of applicant"},"permanent_address_country":{"type":"string","description":"Permanent country of residence of applicant"},"permanent_address_street":{"type":"string","description":"Permanent street address of applicant"},"reference_number":{"type":"string"},"residency":{"type":"string","description":"Country of residency of applicant"},"revision":{"type":"string","description":"Revision of the W8BEN form"},"tax_id_ssn":{"type":"string","description":"TaxID/SSN of applicant"},"timestamp":{"type":"string","format":"time","description":"Timestamp when form data was gathered"},"income_type":{"type":"string","description":"Income type of applicant"},"signer_full_name":{"type":"string","description":"Full name of signing user"}},"required":["country_citizen","date","date_of_birth","full_name","ip_address","permanent_address_city_state","permanent_address_country","permanent_address_street","revision","timestamp","signer_full_name"],"x-stoplight":{"id":"8cjul4ni6pe66"}},"CustodialAccountType":{"title":"CustodialAccountType","x-stoplight":{"id":"jltxs43lpjolf"},"type":"string","description":"Represents the type of custodial account based on the state where the beneficiary resides.\nThis value is returned only when the `country_of_tax_residence` is `USA`. For other countries, this property is not included in the response.\n\n**Possible Return Values**\n\n`CustodianTypeUTMA` - Indicates that the custodial account is governed by the Uniform Transfers to Minors Act.\n`CustodianTypeUGMA` - Indicates that the custodial account is governed by the Uniform Gifts to Minors Act."},"USDBalances":{"title":"USDBalances","x-stoplight":{"id":"cqvonohea6r8x"},"type":"object","properties":{"buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"regt_buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"daytrading_buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"options_buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"cash":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"cash_withdrawable":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"cash_transferable":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"pending_transfer_out":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"portfolio_value":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"equity":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"long_market_value":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"short_market_value":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"initial_margin":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"maintenance_margin":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_maintenance_margin":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"sma":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_equity":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_long_market_value":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_short_market_value":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_cash":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_regt_buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"},"last_daytrading_buying_power":{"type":"string","x-stoplight":{"id":"f178oif7i5e4d"}},"last_options_buying_power":{"type":"string","x-stoplight":{"id":"06hyvz1658m2j"},"format":"decimal"}},"description":"Account balances in USD."},"USDPosition":{"title":"USDPosition","description":"Position values in USD. This is returned for LCT (non-USD) accounts only.","type":"object","properties":{"avg_entry_price":{"type":"string","format":"decimal","description":"Average entry price of the position in USD","example":"71.43"},"market_value":{"type":"string","format":"decimal","description":"Total market value of the position in USD","example":"400.00"},"cost_basis":{"type":"string","format":"decimal","description":"Total cost basis in USD","example":"333.33"},"unrealized_pl":{"type":"string","format":"decimal","description":"Unrealized profit/loss in USD","example":"66.67"},"unrealized_plpc":{"type":"string","format":"decimal","description":"Unrealized profit/loss percent (by a factor of 1)","example":"0.2"},"unrealized_intraday_pl":{"type":"string","format":"decimal","description":"Unrealized profit/loss in USD for the day","example":"6.67"},"unrealized_intraday_plpc":{"type":"string","format":"decimal","description":"Unrealized interday profit/loss percent (by a factor of 1)","example":"0.0084"},"current_price":{"type":"string","format":"decimal","description":"Current asset price per share in USD","example":"80.0"},"lastday_price":{"type":"string","format":"decimal","description":"Last day’s asset price per share based on the closing value of the last trading day in USD","example":"79.33"},"change_today":{"type":"string","format":"decimal","description":"Percent change from last day price (by a factor of 1)","example":"0.67"}}},"Currency":{"title":"Currency","x-stoplight":{"id":"go8dbrpz277wf"},"type":"string","description":"\"USD\" // US Dollar\n\"JPY\" // Japanese Yen\n\"EUR\" // Euro\n\"CAD\" // Canadian Dollar\n\"GBP\" // British Pound Sterling\n\"CHF\" // Swiss Franc\n\"TRY\" // Turkish Lira\n\"AUD\" // Australian Dollar\n\"CZK\" // Czech Koruna\n\"SEK\" // Swedish Krona\n\"DKK\" // Danish Krone\n\"SGD\" // Singapore Dollar\n\"HKD\" // Hong Kong Dollar\n\"HUF\" // Hungarian Forint\n\"NZD\" // New Zealand Dollar\n\"NOK\" // Norwegian Krone\n\"PLN\" // Poland Złoty"},"AccountBeneficiary":{"title":"AccountBeneficiary","x-stoplight":{"id":"jfa7t5m9a9zss"},"type":"object","properties":{"given_name":{"type":"string","x-stoplight":{"id":"eyvjdrp7kgx56"}},"family_name":{"type":"string","x-stoplight":{"id":"qzv63knp6b070"}},"date_of_birth":{"type":"string","x-stoplight":{"id":"n83rzcqjolua4"}},"tax_id":{"type":"string","x-stoplight":{"id":"y0leo7surlw4d"}},"tax_id_type":{"type":"string","x-stoplight":{"id":"42cg7cd7womlj"}},"country_of_citizenship":{"type":"string","x-stoplight":{"id":"30oumhfia7cqe"}},"country_of_birth":{"type":"string","x-stoplight":{"id":"om78cyhfkzm0j"}},"country_of_tax_residence":{"type":"string","x-stoplight":{"id":"h8uz2zrbz5whv"}},"state":{"type":"string","x-stoplight":{"id":"887z7m0ncyak7"}},"email":{"type":"string","x-stoplight":{"id":"c7jk1nxqlo1jw"}},"":{"type":"string","x-stoplight":{"id":"1zg5jnb6rzdoo"}}},"required":["given_name","date_of_birth","email"],"description":"The beneficiary of the account."},"CIPInfo":{"title":"CIPInfo","x-stoplight":{"id":"nmcb0qvan724h"},"type":"object","description":"Customer Identification Program (CIP) information for an account applicant.","properties":{"id":{"type":"string","description":"ID of this CIPInfo","format":"uuid"},"account_id":{"type":"string","x-stoplight":{"id":"nti69y3rr1e79"},"format":"uuid","description":"UUID of the Account instance this CIPInfo is for"},"provider_name":{"type":"array","x-stoplight":{"id":"1e8bkk1u4yiew"},"description":"List of KYC providers this information came from","items":{"$ref":"#/components/schemas/CIPProvider"}},"created_at":{"type":"string","x-stoplight":{"id":"64h0di2a6vyej"},"format":"date-time"},"updated_at":{"type":"string","x-stoplight":{"id":"suqeaf04rzb77"},"format":"date-time"},"kyc":{"$ref":"#/components/schemas/CIPKYC"},"document":{"$ref":"#/components/schemas/CIPDocument"},"photo":{"$ref":"#/components/schemas/CIPPhoto"},"identity":{"$ref":"#/components/schemas/CIPIdentity"},"watchlist":{"$ref":"#/components/schemas/CIPWatchlist"}}},"CIPProvider":{"title":"CIPProvider","x-stoplight":{"id":"1ladh13ciiv0e"},"type":"string","description":"\"alloy\"   - ALLOY\n\"trulioo\" - TRULIOO\n\"onfido\"  - ONFIDO\n\"veriff\"  - VERIFF\n\"jumio\"   - JUMIO\n\"getmati\" - GETMATI"},"CIPKYC":{"type":"object","x-examples":{"Example 1":{"id":"CBDAD1C4-1047-450E-BAE5-B6C406F509B4","risk_level":"LOW","applicant_name":"John Doe","email_address":"johndoe@example.com","nationality":"American","id_number":"jd0000123456789","date_of_birth":"1970-12-01","address":"42 Faux St","postal_code":"94401","country_of_residency":"USA","kyc_completed_at":"2021-06-10T15:37:03Z","ip_address":"127.0.0.1","check_initiated_at":"2021-06-10T15:37:03Z","check_completed_at":"2021-06-10T15:37:03Z","approval_status":"approved","approved_by":"Jane Doe","approved_at":"2021-06-10T15:38:03Z"}},"description":"Represents Know Your Customer (KYC) info for a CIPInfo","properties":{"id":{"type":"string","description":"Your internal ID of check","format":"uuid"},"risk_score":{"type":"integer","description":"Overall risk score returned by KYC provider or assessed","x-stoplight":{"id":"90qw403hvrt4y"}},"risk_level":{"type":"string","description":"Overall risk level returned by KYC provider or assessed","x-stoplight":{"id":"qlzreqji4lhci"}},"risk_categories":{"type":"array","description":"The list of risk categories returned by the KYC provider or assessed","x-stoplight":{"id":"qlzreqji4lhci"},"items":{"x-stoplight":{"id":"me5f66krhts26"},"type":"string"}},"applicant_name":{"type":"string","description":"Given and family name of applicant"},"email_address":{"type":"string","description":"email address of applicant"},"nationality":{"type":"string","description":"nationality of applicant"},"date_of_birth":{"type":"string","description":"DOB of applicant","format":"date"},"address":{"type":"string","description":"Concatenated street address, city, state and country of applicant"},"postal_code":{"type":"string","description":"postal code for `address` field"},"country_of_residency":{"type":"string","description":"country for `address` field"},"kyc_completed_at":{"type":"string","description":"Datetime that KYC check was completed at","format":"date-time"},"ip_address":{"type":"string","description":"IP address of applicant at time of KYC check"},"check_initiated_at":{"type":"string","description":"start datetime of KYC check","format":"date-time"},"check_completed_at":{"type":"string","description":"completion datetime of KYC check","format":"date-time"},"approval_status":{"type":"string","enum":["approved","rejected"],"description":"Approval status of KYC check","example":"approved"},"approved_by":{"type":"string","description":"Identifier of who approved KYC check"},"approved_at":{"type":"string","description":"Reason for approving this KYC check","format":"date-time"},"approved_reason":{"type":"string","x-stoplight":{"id":"rw7ke3e65x6xk"},"description":"Datetime that this KYC check was approved"}},"required":["id"],"title":"CIPKYCInfo","x-stoplight":{"id":"1ygvfp2y5nwev"}},"CIPDocument":{"type":"object","x-examples":{"Example 1":{"id":"55B9931A-3BE6-4BC0-9BDD-0B954E4A4632","result":"clear","status":"complete","created_at":"2021-06-10T15:37:03Z","image_integrity":"clear"}},"properties":{"id":{"type":"string","description":"Your internal ID of check"},"result":{"$ref":"#/components/schemas/CIPResult"},"status":{"$ref":"#/components/schemas/CIPStatus"},"created_at":{"type":"string","format":"date-time","description":"Datetime for when this check was done"},"date_of_birth":{"type":"string","format":"date","description":"Datetime for when this check was done","x-stoplight":{"id":"mldoed43bulx0"}},"date_of_expiry":{"type":"string","format":"date","description":"Datetime for when this check was done","x-stoplight":{"id":"zgpwb045porqt"}},"document_numbers":{"type":"array","x-stoplight":{"id":"ylxi39biyo436"},"description":"Number of the document that was checked","items":{"x-stoplight":{"id":"n986txzgf0lnx"},"type":"string"}},"document_type":{"type":"string","x-stoplight":{"id":"n8sxd8t9f3kzq"},"description":"Type of the document that was checked"},"first_name":{"type":"string","x-stoplight":{"id":"w2punywp6uw0v"},"description":"First name extracted from the document"},"last_name":{"type":"string","x-stoplight":{"id":"2nutmuuiwgyib"},"description":"Last name extracted from the document"},"gender":{"type":"string","x-stoplight":{"id":"23ze35btn7pgd"},"description":"Gender info extracted from the document"},"issuing_country":{"type":"string","x-stoplight":{"id":"0kb0a69x5g5m6"},"description":"Country for which issued the document"},"nationality":{"type":"string","x-stoplight":{"id":"l39n0f7u9rg3g"},"description":"Nationality extracted from the document"},"age_validation":{"$ref":"#/components/schemas/CIPResult"},"comprised_document":{"$ref":"#/components/schemas/CIPResult"},"police_record":{"$ref":"#/components/schemas/CIPStatus"},"data_comparison":{"$ref":"#/components/schemas/CIPResult"},"data_comparison_breakdown":{"type":"string","x-stoplight":{"id":"j5c0hr492lzlv"},"description":"json object representing the results of the various sub-checks\n          done when calculating the result on `data_comparison`. Example: {“date_of_birth”: “clear”,\n          “date_of_expiry”: “clear” “document_numbers”: “clear”, “document_type”: “clear”, “first_name”: “clear”,\n          “gender”: “clear”, “issuing_country”: “clear”, “last_name”: “clear”}"},"image_integrity":{"$ref":"#/components/schemas/CIPResult"},"image_integrity_breakdown":{"type":"string","x-stoplight":{"id":"gw6cht7g7zui2"},"description":"json object representing the results of the various sub-checks done\n          when calculating the result on `image_integrity`. Example: example: {“colour_picture”: “clear”,\n          “conclusive_document_quality”: “clear”, “image_quality”: “clear”, “supported_document”: “clear”}"},"visual_authenticity":{"type":"string","x-stoplight":{"id":"ccsft0oc0p7y7"},"description":"json object representing the the various sub-checks done when determening\n          whether visual (non-textual) elements are correct given the document type. Example: {\n          “digital_tampering”: “clear”, “face_detection”: “clear”, “fonts”: “clear”, “original_document_present”:\n          “clear”, “picture_face_integrity”: “clear”, “security_features”: “clear”, “template”: “clear”}"}},"required":["id"],"description":"Represents results of checking a document for CIPInfo\n","x-stoplight":{"id":"7pizeb1ps42ij"}},"CIPResult":{"title":"CIPResult","x-stoplight":{"id":"4mte2vkxwqcmd"},"type":"string","description":"The result of the check. Either `clear` or `consider`."},"CIPStatus":{"title":"CIPStatus","x-stoplight":{"id":"ejcunr8l8s0f2"},"type":"string","description":"An enum representing the status of the CIPInfo\n\n\"complete\"\n\n\"withdrawn\""},"CIPApprovalStatus":{"title":"CIPApprovalStatus","x-stoplight":{"id":"iqzwhz2gafp7w"},"type":"string","description":"The approval status of the CIP information. This is used to indicate whether the CIP information has been approved or rejected.","enum":["approved","rejected"]},"CIPPhoto":{"type":"object","x-examples":{"Example 1":{"id":"0DD13020-F0FD-4B5A-B58F-BC1885E90A6D","result":"clear","status":"complete","created_at":"2021-06-10T15:37:03Z","face_comparison":"clear"}},"properties":{"id":{"type":"string","description":"Your internal ID of the check"},"result":{"$ref":"#/components/schemas/CIPResult"},"status":{"type":"string","enum":["complete","withdrawn"],"description":"Overall status of the check. Either `complete` or `withdrawn`."},"created_at":{"type":"string","description":"datetime of when the check happened"},"face_comparison":{"$ref":"#/components/schemas/CIPResult"},"face_comparison_breakdown":{"type":"string","x-stoplight":{"id":"nva7tm8q3itop"},"description":"a json object representing the breakdown of sub-checks done in\n          `face_comparison`. Example: {“face_match”:{“result”: “clear”,“properties”:{“score”: “80”}}}"},"image_integrity":{"$ref":"#/components/schemas/CIPResult"},"image_integrity_breakdown":{"type":"string","x-stoplight":{"id":"lltcpsijc1bwo"},"description":"a json object representing the breakdown of sub-checks done in\n          `image_integrity`. Example  {“face_detected”:{“result”: “clear”},“source_integrity”: {“result”: “clear”}}"},"visual_authenticity":{"$ref":"#/components/schemas/CIPResult"},"visual_authenticity_breakdown":{"type":"string","x-stoplight":{"id":"0712bbbrw15oo"},"description":"a json object representing the breakdown of sub-checks don in\n          `visual_authenticity`. Example {“spoofing_detection”: {“result”: “clear”,“properties”: {“score”: “26”}}}}"}},"required":["id"],"description":"Represents the results of checking a Photo for CIPInfo","x-stoplight":{"id":"hqx4vrzqypp7h"}},"CIPIdentity":{"type":"object","x-examples":{"Example 1":{"id":"28E1CCE8-1B1A-4472-9AD4-C6C5B7C3A6AF","result":"clear","status":"complete","created_at":"2021-06-10T15:37:03Z","sources":"clear","address":"clear","date_of_birth":"clear"}},"properties":{"id":{"type":"string","description":"Your internal ID of check"},"result":{"$ref":"#/components/schemas/CIPResult"},"status":{"$ref":"#/components/schemas/CIPStatus"},"created_at":{"type":"string","description":"datetime when identity check happened"},"matched_address":{"$ref":"#/components/schemas/CIPResult"},"matched_addresses":{"type":"string","description":"datetime when identity check happened","x-stoplight":{"id":"1vqeq6vfihjs2"}},"sources":{"$ref":"#/components/schemas/CIPResult"},"sources_breakdown":{"type":"string","description":"a json object representing the breakdown of `sources` field. For example:\n          {“total_sources”: {“result”: “clear”,“properties”: {“total_number_of_sources”: “3”}}}","x-stoplight":{"id":"4aehkpo8da5mr"}},"address":{"$ref":"#/components/schemas/CIPResult"},"address_breakdown":{"type":"string","x-stoplight":{"id":"wcctczes53ivy"},"description":"a json object representing the breakdown of the `address` field. For example:\n          {“credit_agencies”: {“result”: “clear”,“properties”:{“number_of_matches”:“1”}}"},"date_of_birth":{"$ref":"#/components/schemas/CIPResult"},"date_of_birth_breakdown":{"type":"string","x-stoplight":{"id":"efhx1bwabsdty"},"description":"a json object representing the breakdown of the `date_of_birth` field.\n          For example: example: {“credit_agencies”:{“result”: “clear”,“properties”: {“number_of_matches”: “1”}}"},"tax_id":{"$ref":"#/components/schemas/CIPResult"},"tax_id_breakdown":{"type":"string","x-stoplight":{"id":"x5c64geol7p1s"},"description":"a json object representing the breakdown of the `tax_id` field"}},"required":["id"],"x-stoplight":{"id":"g8qjr3c8h1npx"}},"CIPWatchlist":{"type":"object","x-examples":{"Example 1":{"id":"7572B870-EB4C-46A2-8B88-509194CCEE7E","result":"clear","status":"complete","created_at":"2021-06-10T15:37:03Z","politically_exposed_person":"clear","sanction":"clear","adverse_media":"clear","monitored_lists":"clear"}},"description":"Represents the result of checking to see if the applicant is in any watchlists for a CIPInfo","properties":{"id":{"type":"string","description":"Your internal ID of check"},"result":{"$ref":"#/components/schemas/CIPResult"},"status":{"$ref":"#/components/schemas/CIPStatus"},"created_at":{"type":"string","description":"datetime when check happened"},"records":{"type":"string","x-stoplight":{"id":"0jk1ut5oct0ml"},"description":"a json object. Example [{“text”: “Record info”}]"},"politically_exposed_person":{"$ref":"#/components/schemas/CIPResult"},"adverse_media":{"$ref":"#/components/schemas/CIPResult"},"sanction":{"$ref":"#/components/schemas/CIPResult"},"monitored_lists":{"$ref":"#/components/schemas/CIPResult"}},"required":["id"],"x-stoplight":{"id":"b6tmg9qshk4f9"}},"OnfidoSDKOutcome":{"title":"OnfidoSDKOutcome","x-stoplight":{"id":"gasz29uxpmhoo"},"type":"string","description":"\"NOT_STARTED\"\tThe user has not started the SDK flow yet. outcome is set to this default value upon token generation\n\"USER_EXITED\"\tThe user exited the SDK flow\n\"SDK_ERROR\"\tAn error occurred in the SDK flow\n\"USER_COMPLETED\"\tThe user completed the SDK flow"},"AdminConfigurations":{"title":"AdminConfigurations","x-stoplight":{"id":"qsosbl2ojvpy5"},"type":"object","description":"These configurations show account properties that are overriden either by Alpaca Broker Operations or an automated process.\n\nThese values cannot be modified by the Broker Partners.\n\n\nFor the **events** interface we are only broadcasting changes to admin configurations. In case nothing changed for a flag that will not be included in unrelated update events.\n\nDepending on the type of the Admin Configurations the sent event will behave differently. For bool flags we are only sending the new value.\n\nFor example the following payload means, that the disable_shorting flag was set to true from false:\n\n```\n{\n  \"disable_shorting\": false\n}\n```\n\nFor other data types, we are embeding the old and new values into the payload. For example changing the max_margin_multiplier from 4 to 1 will yield this payload:\n\n```\n{\n  \"max_margin_multiplier\": {\n    \"old\": 4,\n    \"new\": 1,\n  }\n}\n```\n\nIntroducing an override value from the default will yield a null value as old. For example restricting the max_margin_multipler to 1 from default will yield the following payload:\n\n```\n{\n  \"max_margin_multiplier\": {\n    \"old\": null,\n    \"new\": 1,\n  }\n}\n```","properties":{"restrict_to_liquidation_reasons":{"$ref":"#/components/schemas/RestrictToLiquidationReasons"},"outgoing_transfers_blocked":{"type":"boolean","x-stoplight":{"id":"6asgwwc5og5vt"},"description":"Wire-out transfers blocked for the account if false"},"incoming_transfers_blocked":{"type":"boolean","x-stoplight":{"id":"9h6kxbeu7892i"},"description":"Deposits are blocked for the account if false"},"disable_shorting":{"type":"boolean","x-stoplight":{"id":"xpj079uvkjlln"},"description":"If true the account is not allowed to create short position orders"},"pdt_check_mode":{"type":"string","x-stoplight":{"id":"xpj079uvkjlln"},"description":"PDT check mode"},"disable_fractional":{"type":"boolean","x-stoplight":{"id":"67vm959kuferk"},"description":"If true, the account cannot create orders for fractional share positions"},"disable_crypto":{"type":"boolean","x-stoplight":{"id":"h027r16ybjq26"},"description":"If true, the account is not allowed to trade cryptos"},"disable_day_trading":{"type":"boolean","x-stoplight":{"id":"ypcv5e39wabjv"},"description":"If true, the account is not allowed to day trade (e.g. buy and sell the same security on the same day)"},"allow_instant_ach":{"type":"boolean","description":"If true, the account is allowed to perform instant ACH"},"disable_algodash_access":{"type":"boolean","description":"If true, the account is allowed to access algo dash"},"disable_api_key":{"type":"boolean","description":"If true, the account's API key will be disabled"},"max_margin_multiplier":{"type":"object","x-stoplight":{"id":"z5ufwctnvy3fy"},"description":"Max margin multipler is set by admin to this value","properties":{"to":{"type":"string","description":"New value of margin multiplier"},"from":{"type":"string","description":"Old value of margin multiplier"}}},"max_options_trading_level":{"type":"object","description":"Max options trading level is set by admin to this value. It can be 0, 1 or 2.","properties":{"to":{"type":"string","description":"New value of max options trading level"},"from":{"type":"string","description":"New value of max options trading level"}}},"acct_daily_transfer_limit":{"type":"string","x-stoplight":{"id":"7m2ved3asodk3"},"description":"Override the correspondent level daily transfer limits","format":"decimal"}}},"RestrictToLiquidationReasons":{"title":"RestrictToLiquidationReasons","x-stoplight":{"id":"8ve05o357xumy"},"type":"object","description":"Reasons why the liquidation only flag was set","properties":{"pattern_day_trading":{"type":"boolean","x-stoplight":{"id":"jie5waxje186p"},"description":"Set when the trading account is marked as a PDT, but its equity falls below the $25k treshold"},"ach_return":{"type":"boolean","x-stoplight":{"id":"rdalpird93yqd"},"description":"Set when an incoming ACH transfer gets rejected"},"position_to_equity_ratio":{"type":"boolean","x-stoplight":{"id":"w38ngiibz57ih"},"description":"Set when the position to equity ration exceeds the maximum limit"},"unspecified":{"type":"boolean","x-stoplight":{"id":"8t9456c8yt2u8"},"description":"Default value for unknown reason"}}},"KYCResultType":{"title":"KYCResultType","x-stoplight":{"id":"mkpd1y7i0tihh"},"type":"string","description":"IDENTITY_VERIFICATION\tIdentity needs to be verified\n\nTAX_IDENTIFICATION\tTax ID number needs to be verified\n\nADDRESS_VERIFICATION\tAddress needs to be verified\n\nDATE_OF_BIRTH\tDate of birth needs to be verified\n\nINVALID_IDENTITY_PASSPORT\tIdentity needs to be verified via a \ngovernment issued ID. This is commonly used in conjuction with OTHER to describe the exact document needed.\n\nSELFIE_VERIFICATION\tIdentity needs to be verified via a live selfie of the account owner\n\nPEP\tFurther information needs to be submitted if account owner is politically exposed person\n\nFAMILY_MEMBER_PEP\tFurther information needs to be submitted if family member is a politically exposed person\n\nCONTROL_PERSON\tFurther information needs to be submitted if account owner is a control person\n\nAFFILIATED\tFurther information needs to be submitted if account owner is affiliated to finra or an exchange\n\nVISA_TYPE_OTHER\tFurther information needs to be submitted about account owner’s visa\n\nW8BEN_CORRECTION\tIdenfitying information submitted by the user was incorrect so a new, corrected, W8BEN needs to be submitted\nCOUNTRY_NOT_SUPPORTED\tThe account owner’s country of tax residence is not supported by our KYC providers. In this case, we’ll manully perform KYC on the user\n\nWATCHLIST_HIT\tResults from the watchlist screening need further investigation before account opening. No action is needed from the user\n\nOTHER\tA custom message will be sent to describe exactly what is needed from the account owner. The message will be displayed in the additional_information attribute.\n\nOTHER_PARTNER\tA custom message will be sent to relay information relevant only to the partner. The message will be displayed in the additional_information attribute."},"FeePaymentMethod":{"title":"FeePaymentMethod","x-stoplight":{"id":"ycxjjvxcdifuc"},"type":"string","description":"Only outgoing wire fees are currently supported for automated processing.\n\n\n**user**\tThe end user will pay any applicable fees\n**invoice**\tAny applicable fees will be billed to the client in the following monthly invoice"},"RetrieveJITReportRequest":{"title":"RetrieveJITReportRequest","x-stoplight":{"id":"u9ujcu7towxv0"},"type":"object","properties":{"report_type":{"$ref":"#/components/schemas/ReportType"},"system_date":{"type":"string","x-stoplight":{"id":"lvqwksnjozoij"},"description":"Date of file generation"},"asset_class":{"type":"string","x-stoplight":{"id":"zttrrajefujf7"},"description":"The asset class to retrieve for."}},"required":["report_type","system_date"],"description":""},"ReportType":{"title":"ReportType","x-stoplight":{"id":"7oh9cpf7r8tcr"},"type":"string","description":"**detail**\tDetail report, content-type = application/csv\n**net_summary**\tNet Summary report, content-type = application/csv\n**net_payment**\tNet Payment report, content-type = application/pdf\n**net_payment_final**\tNet Payment Final report, content-type = application/pdf\n**gross_summary\tGross** Summary report, content-type = application/pdf\n**gross_payment\tGross** Payment report, content-type = application/pdf\n**gross_payment_final**\tGross Payment Final report, content-type = application/pdf\n**obligation**\tObligation report, content-type = application/csv"},"JITReport":{"title":"JITReport","x-stoplight":{"id":"ragg7o909954y"},"type":"object","description":"JIT Securities reports are made available through the API and can be accessed within the hour after 11:30 PM EST on the trade date (T+0). The reports communicate transaction-level details as well as overall settlement amounts, transfer direction, and payment timing.","properties":{"detail":{"type":"string","x-stoplight":{"id":"s4ezmhwn7oqxv"},"description":"Contains all activities that impact cash throughout the trading session including executed trades, trading fees, and corporate actions that involve cash allocations.\n\ncontent-type = application/csv"},"net_summary":{"type":"string","x-stoplight":{"id":"phtq9hmob3aux"},"description":"Consists of three columns and a single row, which lists the net money movement to or from Alpaca for T0, T1, and T2.\n\ncontent-type = application/csv"},"net_payment":{"type":"string","x-stoplight":{"id":"um5xd4us4djch"},"description":"Highlights the net amount due to Alpaca by settlement or to the partner on the date of settlement in a formalized invoice format.\n\ncontent-type = application/pdf"},"net_payment_final":{"type":"string","x-stoplight":{"id":"3q3ubyhwekvh4"},"description":"Includes additional information to account for T+0 and T+1 settling activity to clarify settlement journaling reconciliation. This report is generated after trading session close on T+1.\n\ncontent-type = application/pdf"},"obligation":{"type":"string","description":"Lists of all open obligations towards the partner that are to be settled.\n\ncontent-type = application/csv"}}},"DailyTradingLimit":{"title":"DailyTradingLimit","x-stoplight":{"id":"at5t8fzsrjz6s"},"type":"object","properties":{"daily_net_limit_in_use":{"type":"string","x-stoplight":{"id":"4159up5cilte2"},"description":"The real time net value of cash inflows (buy trades, etc.) with cash outflows (sell trades, dividends, etc). This will be dynamic throughout the day based on user activity, with executed orders being reset at the start of the next trading day.","format":"decimal"},"daily_net_limit":{"type":"string","x-stoplight":{"id":"s7lyx5zx2bxkq"},"format":"decimal","description":"The net buying limit that can be reached before further cash outflow trading activity is restricted. Please reach out to learn more about how this limit is determined."}}},"JITLedgerAccount":{"title":"JITLedgerAccount","x-stoplight":{"id":"8qgcugadp72ky"},"type":"object","properties":{"id":{"type":"string","description":"The ledger ID"},"ledger_name":{"type":"string","x-stoplight":{"id":"177un5yfjzo30"},"description":"The ledger name"},"status":{"type":"string","x-stoplight":{"id":"f1h0v5xllvutk"}},"created_at":{"type":"string","x-stoplight":{"id":"v28v0514mevfi"},"description":"Creation time in UNIX format"}},"x-examples":{"Example 1":{"id":"2896b9e2-3198-44cd-a08e-4cc4079aee33","ledger_name":"Securities JIT IN","status":"active","created_at":"1653532627"}}},"Transaction":{"type":"object","x-examples":{"Example 1":{"account_id":"06b9d76e-1733-460c-844e-48d1ae0f10c3","account_no":"JTRJITS00","account_name":"Just In Time Receivable - JITS","system_date":"2022-06-10","entry_type":"JNLC","description":"debit balance = 4185.36, base_rate = 0.0375, spread = 0.05","contra_account_name":"Just In Time Interest Income","amount":"1","balance":"4186.36"}},"properties":{"account_id":{"type":"string","description":"The ledger ID"},"account_no":{"type":"string","description":"The ledger account number"},"account_name":{"type":"string","description":"The ledger name"},"system_date":{"type":"string","description":"Date of transaction"},"entry_type":{"type":"string","description":"Type of transaction"},"description":{"type":"string","description":"Plain text overview of the transaction"},"contra_account_name":{"type":"string","description":"Contra account of transaction"},"amount":{"type":"string","description":"Total amount of the transaction"},"balance":{"type":"string","description":"Ending balance after thetransaction has been applied"}}},"AggregatePositionResponse":{"type":"object","x-examples":{"Example 1":{"symbol":"AAPL","cusip":"037833100","long_qty":"1","short_qty":"0","long_market_value":"148.4700","short_market_value":"0","num_accounts":"1","asset_type":"us_equity","closing_price":"148.4700"}},"properties":{"symbol":{"type":"string","description":"Symbol of asset"},"cusip":{"type":"string","description":"Cusip (9 digits, can start with 0’s)","format":"decimal"},"long_qty":{"type":"string","description":"Aggregate number of shares that the partner is long","format":"decimal"},"short_qty":{"type":"string","description":"Aggregate number of shares that the partner is short","format":"decimal"},"long_market_value":{"type":"string","description":"Aggregate notional dollar amount of the partner’s long positions","format":"decimal"},"short_market_value":{"type":"string","description":"Aggregate notional dollar amount of the partner’s short positions","format":"decimal"},"num_accounts":{"type":"integer","description":"Number of accounts that have a position in this asset (either long or short)","format":"decimal"},"asset_type":{"$ref":"#/components/schemas/AssetClass"},"closing_price":{"type":"string","description":"EOD asset price per share at session close","format":"decimal"}},"title":""},"Portfolio":{"title":"Portfolio","x-stoplight":{"id":"fmog87vwh0ufj"},"type":"object","properties":{"id":{"type":"string","description":"Portfolio ID"},"name":{"type":"string","x-stoplight":{"id":"js7w7q6882lci"},"description":"Name of portfolio"},"status":{"type":"string","enum":["active","inactive","needs_adjustment"],"x-stoplight":{"id":"n83qg43to8usu"},"description":"Current status of portfolio"},"description":{"type":"string","x-stoplight":{"id":"0kpa55c7vtowj"},"description":"Text to describe portfolio"},"weights":{"type":"array","x-stoplight":{"id":"tc4yqvolhyk6k"},"description":"Weight configuration to portfolio. Sum of “percent” values in the weights array must be 100.00","items":{"$ref":"#/components/schemas/PortfolioWeights"}},"cooldown_days":{"type":"integer","x-stoplight":{"id":"zdwrgssm6qy43"},"description":"Count of calendar days following a rebalance before a subscription is eligible to trigger another rebalance"},"rebalancing_conditions":{"type":"string","x-stoplight":{"id":"qb75cbb4u1i90"},"description":"Rebalancing conditions for portfolio"},"created_at":{"type":"string","x-stoplight":{"id":"aq79n954xgv8l"},"description":"Portfolio creation timestamp"},"updated_at":{"type":"string","x-stoplight":{"id":"tfmbwhsply5a2"},"description":"Portfolio updated timestamp"}},"required":["cooldown_days"]},"PortfolioWeights":{"title":"PortfolioWeights","x-stoplight":{"id":"alpltc9n7bi9j"},"type":"object","properties":{"type":{"type":"string","x-stoplight":{"id":"7xfg4b1oj2sbw"},"description":"Possible values of cash or asset"},"symbol":{"type":"string","x-stoplight":{"id":"wupeosw0tkf1x"},"description":"Must be fractionable asset. Only provided if type = “asset”"},"percent":{"type":"string","x-stoplight":{"id":"yxgkifes2yzr0"},"description":"Must be a positive value, up to two decimal places"}}},"RebalancingConditions":{"title":"RebalancingConditions","x-stoplight":{"id":"i4rbs4yru2m5b"},"type":"object","properties":{"type":{"type":"string","x-stoplight":{"id":"yw99dm6g7gy0a"},"description":"Possible values of drift_band or calendar"},"sub_type":{"type":"string","x-stoplight":{"id":"xrefv8k8riuqi"},"description":"For type = drift_band: absolute or relative. For type = calendar: weekly,monthly, quarterly or annually"},"percent":{"type":"string","x-stoplight":{"id":"n1iwthxr6ktka"},"description":"Must be a positive value, up to two decimal places. Only permitted and required for type = drift_band. This is the max allowable drift percent from any target weight (+/-)"},"day":{"type":"string","x-stoplight":{"id":"wr2y2qbyu15ty"},"description":"Used to specify the rebalancing day for conditions of type = calendar. Only permitted and required for type = calendar. In scenarios when the specified day aligns to a non-trading day, the rebalance will be triggered on the preceding trading day. For type= annually, the value must be passed in MM-DD format. If 02-29 is specified and the current year is not a leap year, the rebalance will occur on the trading day preceding 2/29. For type= quarterly and monthly the value must be an integer between 1 and 31 inclusive. This represents the day of month. For quarterly, rebalancing will trigger on this day in January, March, June, and December. If the specified day is non-existent for the month then the rebalancing will trigger on the preceding trading day. For type = weekly, permitted values are Monday, Tuesday, Wednesday, Thursday, Friday."}}},"PortfolioSubscription":{"title":"PortfolioSubscription","x-stoplight":{"id":"ldbnrrt7wnoke"},"type":"object","properties":{"id":{"type":"string","description":"Subscription ID"},"account_id":{"type":"string","x-stoplight":{"id":"phfwv1q9wabod"},"description":"Account ID subscribing to portfolio"},"portfolio_id":{"type":"string","x-stoplight":{"id":"07c4juxi9n3d6"},"description":"Portfolio ID for subscription"},"created_at":{"type":"string","x-stoplight":{"id":"0difpd7n53ewk"},"description":"Subscription creation timestamp","format":"date-time"},"last_rebalanced_at":{"type":"string","x-stoplight":{"id":"vda454kksiutp"},"description":"Last rebalancing event for this subscription. Can be null."}}},"PortfolioRun":{"title":"PortfolioRun","x-stoplight":{"id":"2fff3ngujfnlk"},"type":"object","properties":{"id":{"type":"string","description":"Run ID"},"account_id":{"type":"string","x-stoplight":{"id":"e5b9jxg40dm32"},"description":"Account ID for given run"},"portfolio_id":{"type":"string","x-stoplight":{"id":"xiiu41p3i2x1e"},"description":"Portfolio ID for given run"},"type":{"type":"string","enum":["full_rebalance","invest_cash"],"x-stoplight":{"id":"n0xkwdoznl4sb"},"description":"full_rebalance or invest_cash"},"initiated_from":{"type":"string","enum":["system","api"],"description":"system or api"},"updated_at":{"type":"string","x-stoplight":{"id":"gnkdvsd306tkh"},"description":"RFC3339 format"},"completed_at":{"type":"string","x-stoplight":{"id":"e9g3vqannt4l4"},"description":"RFC3339 format"},"canceled_at":{"type":"string","x-stoplight":{"id":"p0zhdmev1a419"},"description":"RFC3339 format"},"status":{"$ref":"#/components/schemas/PortfolioRunStatus"},"reason":{"type":"string","x-stoplight":{"id":"2cabm5kwcc7pk"},"description":"Explainer text in case of failed runs"},"weights":{"type":"array","x-stoplight":{"id":"qcw8voqow82n6"},"description":"Considered weighting for this run","items":{"$ref":"#/components/schemas/PortfolioWeights"}},"orders":{"type":"array","x-stoplight":{"id":"pkp3xm0hhluzx"},"description":"Array of executed orders for this run","items":{"$ref":"#/components/schemas/Order"}},"failed_orders":{"type":"array","x-stoplight":{"id":"diem5oexjqx3r"},"description":"Array of failed orders for this run","items":{"$ref":"#/components/schemas/Order"}},"skipped_orders":{"type":"array","x-stoplight":{"id":"rbbuqp48ji4xw"},"description":"Array of skipped order for this run","items":{"$ref":"#/components/schemas/SkippedOrder"}}}},"PortfolioRunStatus":{"title":"PortfolioRunStatus","type":"string","enum":["QUEUED","IN_PROGRESS","CANCELED","CANCELED_MID_RUN","ERROR","TIMEOUT","COMPLETED_ADJUSTED","COMPLETED_SUCCESS"],"description":"|       Status       | Final |                                 Represented State                                |                                                         Notes                                                        |\n|:------------------:|:-----:|:--------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------:|\n| QUEUED             | No    | The run has been queued, waiting for our system to process it.                   | Runs only executed when the US market is open and there’s at least 15 minutes before the market closes.              |\n| IN_PROGRESS        | No    | Portfolio adjustment is in progress.                                             |                                                                                                                      |\n| CANCELED           | Yes   | Portfolio run canceled, before being picked up by Alpaca’s background processing |                                                                                                                      |\n| CANCELED_MID_RUN   | Yes   | Portfolio run canceled while executing.                                          | The portfolio’s state is in between the pre-run and post-run state, manual remediation or job re-run is recommended. |\n| ERROR              | Yes   | There was an error while rebalancing the portfolio.                              | The portfolio’s state is in between the pre-run and post-run state, manual remediation or job re-run is recommended. |\n| TIMEOUT            | Yes   | A timeout occured while rebalancing the portfolio.                               | The portfolio’s state is in between the pre-run and post-run state, manual remediation or job re-run is recommended. |\n| COMPLETED_ADJUSTED | Yes   | The portfolio has been adjusted                                                  | The adjustments have been prepared, but the run details haven’t yet updated with the list of resulting orders        |\n| COMPLETED_SUCCESS  | Yes   | The portfolio has been adjusted, run status updated                              |                                                                                                                      |"},"SkippedOrder":{"title":"SkippedOrder","x-stoplight":{"id":"9azbr7fhzkkk7"},"type":"object","description":"Skipped orders model contains information for such orders that the rebalancing engine didn’t send to our order system due to some validation issues.","properties":{"symbol":{"type":"string","x-stoplight":{"id":"vcp7ffvaq2wsy"},"description":"Symbol for which the adjustment was skipped"},"side":{"type":"string","x-stoplight":{"id":"uofkwlhuzrj74"},"description":"Side of the order (buy, sell, sell_short)"},"notional":{"type":"string","x-stoplight":{"id":"th4w7c8w02q9s"},"description":"Notional value of the order"},"currency":{"type":"string","x-stoplight":{"id":"i99mj8cy90o7y"},"description":"Currency of the order"},"reason":{"type":"string","x-stoplight":{"id":"u316hj6bjcq73"},"description":"Reason for the order being skipped"},"reason_details":{"type":"string","x-stoplight":{"id":"1sltu2x6qfmtm"},"description":"Formatted error message with the cause of the skip"}},"required":["symbol","reason","reason_details"]},"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=="},"BatchCreateFundingWalletRequest":{"type":"object","properties":{"account_ids":{"type":"array","description":"list of UUID account ids which will have funding wallets created","items":{"type":"string"}}}},"BatchCreateFundingWalletResponse":{"type":"object","properties":{"funding_wallets":{"type":"array","items":{"$ref":"#/components/schemas/FundingWallet"}}}},"ListFundingDetails":{"type":"object","properties":{"funding_details":{"type":"array","items":{"$ref":"#/components/schemas/FundingDetail"}}}},"ListTransfersResponse":{"type":"object","properties":{"transfers":{"type":"array","items":{"$ref":"#/components/schemas/FundingWalletTransfer"}}}},"DemoFundingTransfer":{"type":"object","properties":{"receiver_account_number":{"type":"string"},"receiver_routing_code":{"type":"string"},"amount":{"type":"string","format":"decimal"},"currency":{"type":"string"}}},"FundingWallet":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/FundingWalletStatus"},"created_at":{"type":"string","format":"date-time"}},"required":["account_id","status","created_at"]},"FundingDetail":{"type":"object","description":"Gets funding details that can be used to settle and collect funds in each available currency.\n","properties":{"account_number":{"type":"string"},"account_holder_name":{"type":"string"},"account_number_type":{"type":"string"},"bank_name":{"type":"string"},"bank_address":{"type":"string"},"currency":{"type":"string"},"routing_code_type":{"$ref":"#/components/schemas/FundingDetailRoutingCodeType"},"routing_code":{"type":"string"},"payment_type":{"$ref":"#/components/schemas/FundingDetailPaymentType"},"bank_country":{"type":"string"}}},"Usd":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","nullable":false,"format":"decimal"}}},"FundingWalletTransfer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"fees":{"type":"array","items":{"$ref":"#/components/schemas/TransferFee"}},"requested_amount":{"type":"string","format":"decimal","description":"The amount sent as part of the withdrawal creation"},"original_amount":{"type":"string","format":"decimal","description":"The amount you should expect to receive, calculated as requested amount - fees"},"original_currency":{"type":"string","description":"The currency of the withdrawn amount, 3-letter ISO code"},"direction":{"$ref":"#/components/schemas/FundingWalletTransferDirection"},"status":{"$ref":"#/components/schemas/FundingWalletTransferStatus"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"usd":{"$ref":"#/components/schemas/Usd"},"payment_type":{"$ref":"#/components/schemas/FundingDetailPaymentType"}}},"FundingWalletRecipientBank":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company_name":{"type":"string"},"payment_types":{"type":"array","items":{"$ref":"#/components/schemas/FundingDetailPaymentType"}},"street_address":{"type":"string"},"country":{"type":"string","description":"Two-letter ISO country code."},"city":{"type":"string","description":"City"},"postal_code":{"type":"string","description":"Postal code"},"state_or_province":{"type":"string","description":"State or province."},"currency":{"type":"string","description":"Currency in which money is held in the beneficiary's bank account. Three-digit currency code."},"account_number":{"type":"string","description":"Bank account number."},"routing_code_type":{"type":"string","description":"Local payment routing system."},"routing_code":{"type":"string","description":"Value for \"routing_code_type\"."},"bic_swift":{"type":"string","description":"BIC/SWIFT code"},"iban":{"type":"string","description":"IBAN code"},"created_at":{"type":"string","description":"Date the beneficiary record was created.","format":"date-time"},"updated_at":{"type":"string","description":"Date the beneficiary record was last updated.","format":"date-time"}}},"TransferFee":{"type":"object","required":["type","amount","currency","payment_type"],"properties":{"type":{"$ref":"#/components/schemas/FeeType"},"amount":{"type":"string","nullable":false,"format":"decimal"},"currency":{"$ref":"#/components/schemas/Currency"},"payment_type":{"$ref":"#/components/schemas/FeePaymentType"}}},"CreateFundingWalletWithdrawalRequest":{"type":"object","properties":{"usd_amount":{"type":"string","format":"decimal"},"desired_currency":{"type":"string"},"payment_type":{"$ref":"#/components/schemas/FundingDetailPaymentType"}}},"FundingDetailPaymentType":{"type":"string","enum":["swift_wire","local_rails"],"description":"Status:\n * `swift_wire`: SWIFT wire\n * `local_rails`: Local scheme\n"},"FundingDetailRoutingCodeType":{"type":"string","enum":["BIC","ACH_ROUTING","ABA","ROUTING","SORT_CODE"],"description":"Status:\n * `BIC`: bic_swift\n * `ACH`: ach_routing_code\n * `ABA`: aba\n * `ROUTING`: routing_code\n * `SORT_CODE`: sort_code\n"},"FundingWalletTransferDirection":{"type":"string","enum":["incoming","outgoing"],"description":"Status:\n * `incoming`: incoming amount\n * `outgoing`: outgoing amount\n"},"FeeType":{"type":"string","enum":["withdrawal_fee","fx_fee","network_fee","deposit_fee","ach_return_fee","parnter_fee","alpaca_fee"],"description":"Status:\n  * `withdrawal_fee`: Withdrawal fee\n  * `fx_fee`: FX Fee\n  * `network_fee`\n  * `deposit_fee`\n  * `ach_return_fee`\n  * `parnter_fee`\n  * `alpaca_fee`\n"},"FeePaymentType":{"type":"string","enum":["invoice"],"description":"Status:\n * `invoice`\n"},"FundingWalletTransferStatus":{"type":"string","enum":["PENDING","CANCELED","EXECUTED","FAILED","COMPLETE"],"description":"Status:\n * `PENDING`: Created and waiting to be processed\n * `CANCELED`: Canceled\n * `FAILED`: Failed mostly due to technical reasons\n * `COMPLETE`: Transfer has settled\n"},"FundingWalletStatus":{"type":"string","enum":["active","pending","disabled"],"description":"Status:\n * `active`: The funding wallet is ready\n * `pending`: The funding wallet is being processed\n * `disabled`: The funding wallet is disabled\n"},"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"]},"USDAccountTradingLimit":{"title":"USDAccountTradingLimit","type":"object","properties":{"daily_net_limit":{"type":"string","description":"The net buying limit that can be reached before further trading activity is restricted. Please reach out to learn more about how this limit is determined.","format":"decimal"},"available":{"type":"string","description":"The remaining net buying limit that can be used for trading.","format":"decimal"},"used":{"type":"string","description":"The real time net value of cash inflows (buy trades, etc.) with cash outflows (sell trades, etc). This will be dynamic throughout the day based on user activity, with executed orders being reset at the start of the next trading day.","format":"decimal"},"held":{"type":"string","description":"The limit that is currently being held for open orders","format":"decimal"}}},"AccountTradingLimit":{"title":"AccountTradingLimit","type":"object","properties":{"daily_net_limit":{"type":"string","description":"The net buying limit that can be reached before further trading activity is restricted. Please reach out to learn more about how this limit is determined.","format":"decimal"},"available":{"type":"string","description":"The remaining net buying limit that can be used for trading.","format":"decimal"},"used":{"type":"string","description":"The real time net value of cash inflows (buy trades, etc.) with cash outflows (sell trades, etc). This will be dynamic throughout the day based on user activity, with executed orders being reset at the start of the next trading day.","format":"decimal"},"held":{"type":"string","description":"The limit that is currently being held for open orders","format":"decimal"},"swap_rate":{"type":"string","description":"The swap rate is applicable for Local Currency Trading (LCT) accounts","format":"decimal"},"usd":{"$ref":"#/components/schemas/USDAccountTradingLimit"}}},"ExerciseRequest":{"title":"ExerciseRequest","description":"Request to exercise an option contract for an account.\nThis can be omitted or left empty, but it also allows for optionally charging a commission for exercising or\nspecifying a specific quantity of contracts to exercise (rather than the full quantity of contracts held).","type":"object","properties":{"commission":{"type":"string","format":"decimal","example":"0.25","description":"The commission you want to collect from the user. (notional amount)"},"qty":{"type":"string","format":"decimal","example":"1","description":"The number of contracts to exercise. If not provided, all contracts will be exercised."}}},"ExerciseResponse":{"title":"ExerciseResponse","description":"Response to an exercise request.\nThis will return the total quantity of contracts exercised as well as the quantity of remaining contracts.","type":"object","properties":{"qty_exercised":{"type":"string","format":"decimal","description":"The total quantity of contracts exercised."},"qty_remaining":{"type":"string","format":"decimal","description":"The total quantity of contracts remaining after the exercise."}}},"CreateIFTransferRequest":{"type":"object","description":"Request to create a new instant funding transfer\n","required":["account_no","source_account_no","amount"],"properties":{"account_no":{"type":"string"},"source_account_no":{"type":"string"},"amount":{"type":"string","format":"decimal"}}},"TransmitterInfo":{"type":"object","description":"Information about the transmitter to satisfy travel rule requirements. Required if the requesting correspondent qualifies as a financial institution\n","properties":{"originator_full_name":{"type":"string","description":"Required if the requesting correspondent qualifies as a financial institution\n"},"originator_street_address":{"type":"string"},"originator_state":{"type":"string"},"originator_city":{"type":"string"},"originator_postal_code":{"type":"string"},"originator_country":{"type":"string","description":"Required if the requesting correspondent qualifies as a financial institution\n"},"originator_bank_account_number":{"type":"string","description":"Required if the requesting correspondent qualifies as a financial institution\n"},"originator_bank_name":{"type":"string","description":"Required if the requesting correspondent qualifies as a financial institution\n"},"other_identifying_information":{"type":"string","description":"Used to facilitate transfer lookup in the event it is required. Recommended to be the originating bank's reference number for the transfer\n"}}},"CreateSettlementRequest":{"type":"object","description":"Request to create a new settlement. All transfers included must use the same source account, and the total amount received must be in the same currency as the base currency of the source account as well as the transmitter information.\n","required":["transfers"],"properties":{"transfers":{"type":"array","items":{"$ref":"#/components/schemas/SettlementTransfer"}},"additional_info":{"type":"string","description":"Additional remittance information. Include if the funding source may require additional information to associate to the source account or settlement.\n"}}},"SettlementTransfer":{"type":"object","required":["instant_transfer_id","transmitter_info"],"properties":{"instant_transfer_id":{"type":"string","format":"uuid"},"transmitter_info":{"$ref":"#/components/schemas/TransmitterInfo"}}},"CreateJITSettlementRequest":{"type":"object","required":["currency","asset_class","accounts"],"description":"Request to create a new settlement. All transfers included must use the same source account, and the total amount received must be in the same currency as the base currency of the source account.\n","properties":{"currency":{"type":"string","description":"The currency of the settlement. All accounts identified should have this base currency.\n"},"asset_class":{"$ref":"#/components/schemas/JITAssetClass"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/SettlementAccount"}},"additional_info":{"type":"string","description":"Additional remittance information. Include if the funding source may require additional information to associate to the source account or settlement.\n"}}},"SettlementAccount":{"type":"object","required":["account_number","amount","transmitter_info"],"properties":{"account_number":{"type":"string","description":"The account number of the client account to settle\n"},"amount":{"type":"string","format":"decimal"},"transmitter_info":{"$ref":"#/components/schemas/TransmitterInfo"}}},"SettlementResponse":{"type":"object","description":"A settlement response, either from creation or retrieval\n","required":["id","total_amount","status","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"source_account_number":{"type":"string"},"total_amount":{"type":"string","format":"decimal"},"interest_amount":{"type":"string","format":"decimal","description":"The total interest amount accrued on the transfers included in this settlement. Only applicable for instant funding settlements.\n"},"status":{"$ref":"#/components/schemas/SettlementStatus"},"reason":{"type":"string","description":"The reason for failure, if applicable\n"},"additional_info":{"type":"string"},"completed_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"currency":{"type":"string","description":"The currency of the settlement. Only applicable to JIT settlements.\n"},"asset_class":{"$ref":"#/components/schemas/JITAssetClass"}}},"SettlementsResponse":{"type":"object","description":"Response to a successful settlements request\n","required":["settlements"],"properties":{"settlements":{"type":"array","items":{"$ref":"#/components/schemas/SettlementResponse"}}}},"JITAssetClass":{"type":"string","enum":["crypto","us_equity"],"description":"Values:\n * `crypto`: Used to identify a crypto only account\n * `us_equity`: Used to identify an account that trades US equities, or both crypto and\n  US equities.\n"},"SettlementStatus":{"type":"string","enum":["PENDING","AWAITING_ADDITIONAL_FUNDS","COMPLETED","FAILED"],"description":"Values:\n * `PENDING`: Created and waiting to be processed\n * `AWAITING_ADDITIONAL_FUNDS`: Waiting for additional funds to be deposited\n * `COMPLETED`: All transactions are reconciled\n * `FAILED`: Attempt to process this settlement has failed. If this is observed\n  additional remittance information may be required, or one of the transfers being settled\n  accrued additional interest since the settlement was created.\n"},"Reconciliation":{"type":"object","required":["id","amount","deadline","type","account_no","source_account_no"],"properties":{"id":{"type":"string","format":"uuid"},"amount":{"type":"string","format":"decimal"},"deadline":{"type":"string","format":"date"},"type":{"$ref":"#/components/schemas/ReconciliationType"},"account_no":{"type":"string"},"source_account_no":{"type":"string"}}},"InstantFunding":{"type":"object","required":["id","amount","account_no","source_account_no","status","system_date","deadline","created_at","total_interest","remaining_payable","interests","fees"],"properties":{"id":{"type":"string","format":"uuid"},"amount":{"type":"string","format":"decimal"},"account_no":{"type":"string"},"source_account_no":{"type":"string"},"status":{"$ref":"#/components/schemas/InstantFundingStatus"},"system_date":{"type":"string","format":"date"},"deadline":{"type":"string","format":"date"},"created_at":{"type":"string","format":"date-time"},"total_interest":{"type":"string","format":"decimal"},"remaining_payable":{"type":"string","format":"decimal"},"interests":{"type":"array","items":{"$ref":"#/components/schemas/Interest"}},"fees":{"type":"array","items":{"$ref":"#/components/schemas/IFFee"}}}},"Interest":{"type":"object","required":["id","date","amount","status","created_at","reconciled_at"],"properties":{"id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date"},"amount":{"type":"string","format":"decimal"},"status":{"$ref":"#/components/schemas/InstantFundingStatus"},"created_at":{"type":"string","format":"date-time"},"reconciled_at":{"type":"string","format":"date-time"}}},"IFFee":{"type":"object","required":["id","amount","type"],"properties":{"id":{"type":"string","format":"uuid"},"amount":{"type":"string","format":"decimal"},"type":{"$ref":"#/components/schemas/IFFeeType"}}},"ReconciliationType":{"type":"string","enum":["transfer","interest"],"description":"Status:\n * `transfer`: A reconciliation for an instant funding transfer\n * `interest`: A reconciliation for an interest on an overdue transfer\n"},"IFFeeType":{"type":"string","enum":["partner","alpaca"],"description":"Status:\n * `partner`: The fee on a transfer that was allocated to the partner\n * `alpaca`: The fee on a transfer that was allocated to Alpaca\n"},"InstantFundingStatus":{"type":"string","enum":["PENDING","CANCELED","EXECUTED","FAILED","COMPLETED"],"description":"Status:\n * `PENDING`: Created and waiting to be processed\n * `CANCELED`: Canceled\n * `EXECUTED`: All fees (including Partner fee) are transacted\n * `FAILED`: Failed mostly due to technical reasons\n * `COMPLETED`: All transactions are settled\n"},"ListSortBy":{"type":"string","enum":["created_at","amount","deadline"]},"SortOrder":{"type":"string","enum":["ASC","DESC"]},"CorrespondentLimit":{"type":"object","properties":{"amount_in_use":{"type":"string","format":"decimal"},"amount_available":{"type":"string","format":"decimal"},"amount_limit":{"type":"string","format":"decimal"}}},"AccountLimit":{"type":"object","required":["account_no","amount_in_use","amount_available","amount_limit"],"properties":{"account_no":{"type":"string"},"amount_in_use":{"type":"string","format":"decimal"},"amount_available":{"type":"string","format":"decimal"},"amount_limit":{"type":"string","format":"decimal"}}},"ReportsResponse":{"type":"object","required":["system_date","account_no","total_amount_owed","total_interest_penalty","deadline"],"properties":{"instant_funding_transfers":{"type":"array","items":{"$ref":"#/components/schemas/InstantFunding"}},"system_date":{"type":"string","format":"date"},"account_no":{"type":"string"},"total_amount_owed":{"type":"string","format":"decimal"},"total_interest_penalty":{"type":"string","format":"decimal"},"deadline":{"type":"string","format":"date"}}},"OvercontributedIRAAccount":{"type":"object","properties":{"account_id":{"type":"string","description":"The account id"},"total_contribution_amount":{"type":"number","description":"The total conntribution amount"},"tax_year":{"type":"number","description":"The tax year"}}},"ListAPRTiersResponse":{"type":"object","description":"Response to a successful request for a list of APR tiers.\n","properties":{"apr_tiers":{"type":"array","description":"All configured APR tiers available for assignment to accounts","items":{"$ref":"#/components/schemas/APRTier"}}}},"APRTier":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The unique identifier of the APR tier","example":"150df7eb-31e7-46b3-8848-a54ca21ff3bc"},"currency":{"type":"string","description":"The currency of the APR tier","example":"USD"},"name":{"type":"string","description":"The unique name of the APR tier","example":"gold"},"is_default":{"type":"boolean","description":"True if this is the default APR tier. Only one APR tier can be default per currency.\n","example":true},"correspondent_rate_bps":{"type":"integer","description":"The annualized correspondent fee rate, in basis points.","example":25},"account_rate_bps":{"type":"integer","description":"The annualized account interest rate, in basis points.","example":450},"created_at":{"type":"string","format":"date-time","description":"The timestamp the APR tier was created, in RFC 3339 format.","example":"2024-09-16T20:06:32.207729Z"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of the last update to the APR tier, in RFC 3339 format.","example":"2024-09-16T20:06:32.207729Z"},"details":{"$ref":"#/components/schemas/APRTierDetails"}}},"APRTierDetails":{"type":"object","description":"Additional details of the APR tier\n","properties":{"total_accounts":{"type":"integer","description":"The total number of accounts assigned this APR tier.","example":42},"total_balance":{"type":"string","format":"decimal","description":"The total balance of funds in this APR tier.","example":"10485.76"},"as_of":{"type":"string","format":"date","description":"The date on which the total balance was recorded, at the end of the day. YYYY-MM-DD format.\n","example":"2024-09-27"}}},"FPSLTier":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The unique identifier of the FPSL tier","example":"150df7eb-31e7-46b3-8848-a54ca21ff3bc"},"market":{"type":"string","description":"The market of the FPSL tier","example":"US"},"tier_name":{"type":"string","description":"The name of the FPSL tier","example":"gold"},"customer_split":{"type":"number","description":"Percentage of the customer split represented as a value between 0 and 1.00. Max 2 decimal places are allowed.","example":0.25},"partner_split":{"type":"number","description":"Percentage of the partner split represented as a value between 0 and 1.00. Max 2 decimal places are allowed.","example":0.3},"created_at":{"type":"string","format":"date-time","description":"The timestamp the FPSL tier was created, in RFC 3339 format.","example":"2024-09-16T20:06:32.207729Z"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of the last update to the FPSL tier, in RFC 3339 format.","example":"2024-09-16T20:06:32.207729Z"}}},"EoDCashInterestReportResponse":{"type":"object","properties":{"interest":{"type":"array","items":{"$ref":"#/components/schemas/DailyCashInterest"}},"next_page_token":{"type":"string","nullable":true,"example":"293639be-8807-423f-b00d-68c781e8bb56"}}},"DailyCashInterest":{"type":"object","properties":{"date":{"type":"string","format":"date","example":"2024-09-27"},"account_id":{"type":"string","format":"uuid","example":"02e5c5ba-36d2-467a-8699-81dc24271291"},"apr_tier_name":{"type":"string","example":"gold"},"apr_tier_id":{"type":"string","format":"uuid","example":"13d149c8-d620-43e0-978b-88af8abb2ef1"},"currency":{"type":"string","example":"USD"},"cash_balance":{"type":"string","format":"decimal","example":"10485.76"},"account_rate_bps":{"type":"integer","example":423},"account_accrued_interest":{"type":"string","format":"decimal","example":"1.2152"},"correspondent_rate_bps":{"type":"integer","example":25},"correspondent_fee":{"type":"string","format":"decimal","example":"0.0718"}}},"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":["isin","cusip","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"]},"ListFPSLLoansResponse":{"type":"object","description":"Response to a successful request for a list of FPSL loans.\n","properties":{"loans":{"type":"array","description":"All FPSL loans matching the filter criteria","items":{"$ref":"#/components/schemas/FPSLLoan"}},"next_page_token":{"type":"string","nullable":true,"description":"The token to use to retrieve the next page of results. If `null`, there are no more pages.\n"}},"required":["loans","next_page_token"]},"FPSLLoan":{"type":"object","description":"A loan of a security by an account on a date.","properties":{"date":{"type":"string","format":"date","example":"2006-01-02"},"account_id":{"type":"string","description":"Account's ID at Alpaca","example":"06d83e79-5bea-4ce9-a362-a25251a700ec"},"account_number":{"type":"string","description":"Account's number at Alpaca","example":"286873545"},"correspondent":{"type":"string","description":"Account's correspondent","example":"LPCA"},"symbol":{"type":"string","description":"Stock/Ticker symbol of a stock or security","example":"AAPL"},"quantity":{"type":"integer","format":"int64","description":"The number of shares in the loan. This may be less than the total number of eligible shares held by the account.","example":5},"market_value":{"type":"number","format":"double","description":"The total market value of the shares on loan.","example":1138.25},"collateral":{"type":"number","format":"double","description":"The collateral posted for the loan.","example":1161.015},"updated_at":{"type":"string","description":"Timestamp of the last update to this loan in RFC-3339 format with microsecond precision with timezone.\nAn updated value may indicate adjusted interest values.\n","format":"date-time","example":"2025-03-21T15:54:19.857034+01:00"},"interest":{"$ref":"#/components/schemas/FPSLInterest"}},"required":["date","account_id","account_number","correspondent","symbol","quantity","market_value","collateral"]},"FPSLInterest":{"type":"object","description":"The interest's details.\nPlease note that the object might not be set if interest has not yet been calculated for the loan.\nAdditionally, interest details may be adjusted retroactively at any time until interests are finalized for the month.\nThe loan's changed `updated_at` field can indicate such an adjustment.\n","properties":{"customer":{"type":"number","format":"double","description":"The interest accrued by the customer for this loan.","example":1.23},"partner":{"type":"number","format":"double","description":"The interest accrued by the partner for this loan.","example":1.65}},"required":["customer","partner"]},"FPSLError":{"type":"object","description":"FPSL API error response","properties":{"message":{"type":"string","example":"Internal Server Error"}}}},"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"},"Forbidden":{"description":"Request is forbidden","content":{"application/json":{"schema":{"type":"string"}}}},"BadRequest":{"description":"Malformed input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotAuthorized":{"description":"Client is not authorized for this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBodies":{},"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}},"TradeUpdateEventV2New":{"value":{"account_id":"529248ad-c4cc-4a50-bea4-6bfd2953f83a","at":"2022-04-19T14:12:30.656741Z","event":"new","event_id":"01G112NTT0XAXKDZK3AABK68TH","execution_id":"7e544af3-3104-4e1a-8cbc-dab2624949ff","previous_execution_id":"aeb60660-412f-4537-8d1f-1101b3fc8f64","order":{"asset_class":"us_equity","asset_id":"a4778bc8-fad1-47b7-87fe-d5cde10d43f4","cancel_requested_at":null,"canceled_at":null,"client_order_id":"6d873193-dac6-4f72-8e13-c57853a9339d","commission":"1","created_at":"2022-04-19T10:12:30.57117938-04:00","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"edada91a-8b55-4916-a153-8c7a9817e708","legs":null,"limit_price":"700","notional":null,"order_class":"","order_type":"limit","qty":"4","replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","position_intent":"buy_to_open","status":"new","stop_price":null,"submitted_at":"2022-04-19T10:12:30.403135025-04:00","symbol":"TSLA","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"limit","updated_at":"2022-04-19T10:12:30.609783218-04:00","expires_at":"2022-04-19T21:00:00Z"},"timestamp":"2022-04-19T14:12:30.602193534Z"}},"TradeUpdateEventV2MultilegOptionsFill":{"value":{"account_id":"529248ad-c4cc-4a50-bea4-6bfd2953f83a","at":"2025-01-14T16:05:51.872012Z","event_id":"01G112NTT0XAXKDZK3AABK68TH","qty":"1","legs":[{"qty":"1","price":"0.04","symbol":"AAPL250117P00200000","order_id":"8d58279f-7dc8-415f-8495-32f394935509","timestamp":"2025-01-14T16:05:51.867802561Z","execution_id":"ccf7d1dc-78e1-4eb5-92c6-5c86b2bcca8f"},{"qty":"1","price":"0.03","symbol":"AAPL250117C00250000","order_id":"8b0e2cff-eace-4e6a-8810-cad42c63df59","timestamp":"2025-01-14T16:05:51.867813051Z","execution_id":"06f94555-6db7-4059-a4c4-0b993084ccd0"}],"event":"fill","order":{"id":"8af45a94-0b35-4053-ad4e-716c6783fcc9","hwm":null,"qty":"1","legs":[{"id":"8d58279f-7dc8-415f-8495-32f394935509","hwm":null,"qty":"1","legs":null,"side":"buy","position_intent":"buy_to_open","type":"","status":"filled","symbol":"AAPL250117P00200000","asset_id":"8d1ba989-d98b-4551-889f-4647c2e86e20","notional":null,"replaces":null,"failed_at":null,"filled_at":"2025-01-14T16:05:51.867802561Z","ratio_qty":"1","created_at":"2025-01-14T16:05:51.79424769Z","expired_at":null,"filled_qty":"1","order_type":"","stop_price":null,"updated_at":"2025-01-14T16:05:51.869810922Z","asset_class":"us_option","canceled_at":null,"limit_price":null,"order_class":"mleg","replaced_at":null,"replaced_by":null,"trail_price":null,"submitted_at":"2025-01-14T16:05:51.800245966Z","time_in_force":"day","trail_percent":null,"extended_hours":false,"client_order_id":"9c5ce763-bd6f-41eb-b1b1-ed2c0b99d268","filled_avg_price":"0.04","cancel_requested_at":null,"expires_at":"2025-01-14T21:00:00Z"},{"id":"8b0e2cff-eace-4e6a-8810-cad42c63df59","hwm":null,"qty":"1","legs":null,"side":"buy","position_intent":"buy_to_open","type":"","status":"filled","symbol":"AAPL250117C00250000","asset_id":"e9f8c9ba-de7c-4e51-9eef-629f4cb79049","notional":null,"replaces":null,"failed_at":null,"filled_at":"2025-01-14T16:05:51.867813051Z","ratio_qty":"1","created_at":"2025-01-14T16:05:51.79424769Z","expired_at":null,"filled_qty":"1","order_type":"","stop_price":null,"updated_at":"2025-01-14T16:05:51.870879612Z","asset_class":"us_option","canceled_at":null,"limit_price":null,"order_class":"mleg","replaced_at":null,"replaced_by":null,"trail_price":null,"submitted_at":"2025-01-14T16:05:51.802310606Z","time_in_force":"day","trail_percent":null,"extended_hours":false,"client_order_id":"9cda9826-8fd5-4c01-8ee1-30c5286e2387","filled_avg_price":"0.03","cancel_requested_at":null,"expires_at":"2025-01-14T21:00:00Z"}],"side":"buy","position_intent":"","type":"limit","status":"filled","symbol":"","asset_id":"00000000-0000-0000-0000-000000000000","notional":null,"replaces":null,"failed_at":null,"filled_at":"2025-01-14T16:05:51.867813051Z","created_at":"2025-01-14T16:05:51.79424769Z","expired_at":null,"filled_qty":"1","order_type":"limit","stop_price":null,"updated_at":"2025-01-14T16:05:51.870937762Z","asset_class":"","canceled_at":null,"limit_price":"0.6","order_class":"mleg","replaced_at":null,"replaced_by":null,"trail_price":null,"submitted_at":"2025-01-14T16:05:51.802310606Z","time_in_force":"day","trail_percent":null,"extended_hours":false,"client_order_id":"9d2f39de-adae-4dae-a67e-838bf21fb5ae","filled_avg_price":"0.07","cancel_requested_at":null},"price":"0.07","timestamp":"2025-01-14T16:05:51.867813051Z","position_qtys":{"AAPL250117C00250000":"1","AAPL250117P00200000":"1"}}}},"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."}}},"paths":{"/v1/accounts":{"get":{"tags":["Accounts"],"summary":"Get All Accounts","parameters":[{"name":"query","in":"query","schema":{"type":"string"},"description":"A space-delimited list of tokens. The response will contain accounts that match with all of the tokens (i.e. a logical AND). A match means the token is present in either the account’s associated account number, phone number, name, or e-mail address (logical OR)."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"created_after","description":"Inclusive of timestamp. Example: 2019-10-12T07:20:50.52Z"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"created_before","description":"Inclusive of timestamp. Example: 2019-10-12T07:20:50.52Z"},{"schema":{"type":"string"},"in":"query","name":"status","description":"See the AccountStatus model for values"},{"$ref":"#/components/parameters/Sort"},{"schema":{"type":"string","enum":["agreements","contact","disclosures","documents","identity","trading_configurations","trusted_contact"]},"in":"query","name":"entities","description":"Comma-delimited entity names to include in the response. If not specified, all entities are included."}],"responses":{"200":{"description":"A list of accounts that match the query parameters.\n","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountExtended"}}}}}},"operationId":"getAllAccounts","description":"Retrieves the first 1000 accounts that match the query parameters.\nSorting is based on creation time.\nThe created_after/created_before query parameters can be used to paginate the results.\nTo further limit the size of the response, the entities query parameter can be used to specify which properties are included in the response.\n"},"post":{"tags":["Accounts"],"summary":"Create an Account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreationRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"The post body is not well formed.","content":{"application/json":{"schema":{"type":"string"}}}},"409":{"description":"There is already an existing account registered with the same email address."},"422":{"description":"One of the input values is not a valid value.","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"createAccount","description":"Submit an account application with KYC information. This will create a trading account for the end user. The account status may or may not be ACTIVE immediately and you will receive account status updates on the event API. "}},"/v1/accounts/{account_id}":{"get":{"summary":"Get An Account by ID","tags":["Accounts"],"description":"You can query a specific account that you submitted to Alpaca by passing into the query the account_id associated with the account you’re retrieving.\n","responses":{"200":{"description":"Will return an AccountExtended if an account with account_id exists, otherwise will throw an error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExtended"}}}}},"operationId":"getAccount"},"patch":{"tags":["Accounts"],"summary":"Update an Account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateRequest"}}}},"responses":{"200":{"description":"If all parameters are valid and updates have been made, it returns with status code 200. The response is the account model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExtended"}}}},"400":{"description":"The post body is not well formed.","content":{"application/json":{"schema":{"type":"string"}}}},"422":{"description":"​ The request body contains an attribute that is not permitted to be updated or you are attempting to set an invalid value.","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"patchAccount","description":"This operation updates account information.\n\nIf all parameters are valid and updates have been made, it returns with status code 200. The response is the account model."},"parameters":[{"$ref":"#/components/parameters/AccountID"}]},"/v1/accounts/{account_id}/options/approval":{"post":{"tags":["Accounts"],"summary":"Request options trading for an account (BETA)","description":"This endpoint requests options trading for an account.\nFollowing submission, an assigned administrator will review the request.\nUpon approval, the account's options_approved_level parameter will be modified, granting the account the ability to participate in options trading.\nNote: This endpoint is only available for partners who have been enabled for Options BETA.","parameters":[{"$ref":"#/components/parameters/AccountID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionsApprovalRequest"}}}},"responses":{"200":{"description":"The request was submitted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionsApprovalResponse"}}}},"400":{"description":"The request body is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Client does not exist, you do not have access to the client, or “client_secret” is incorrect.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request body did not pass all validations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"requestOptionsForAccount"}},"/v1/accounts/options/approvals":{"get":{"tags":["Accounts"],"summary":"Retrieve options level approval requests (BETA)","description":"This endpoint retrieves options trading level approval requests. Query parameters can be specified to filter the results. If multiple query parameters are specified, the results will be filtered to include only those that match all of the specified parameters. Each query parameter can only be specified once.","parameters":[{"name":"account_id","in":"query","schema":{"type":"string","format":"uuid","example":"c8f1ef5d-edc0-4f23-9ee4-378f19cb92a4"},"description":"Only return results for the specified account."},{"name":"requested_level","in":"query","schema":{"type":"integer","example":3,"description":"Only return requests with the specified requested level.\n0=Disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\n","enum":[0,1,2,3]}},{"name":"approved_level","in":"query","schema":{"type":"integer","example":3,"description":"Only return requests with the specified approved level.\n0=Disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\n","enum":[0,1,2,3]}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/OptionsApprovalStatus"},"description":"Only return requests with the specified approval request status."},{"name":"page_size","in":"query","description":"The maximum number of results to return. The default (and maximum value) is 1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000}},{"$ref":"#/components/parameters/PageToken"}],"responses":{"200":{"description":"The request was submitted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionsApprovalsList"}}}},"400":{"description":"The request body is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Client does not exist, you do not have access to the client, or “client_secret” is incorrect.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The correspondent entity does not have access to options approvals or the account does not exist.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"requestListOptionsApprovals"}},"/v1/accounts/{account_id}/documents":{"get":{"summary":"Retrieve a List of Account Documents","tags":["Documents"],"description":"This endpoint allows you to query all the account document based on an account ID. You can filter by date, or type of document.\n\nThese account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.","parameters":[{"name":"start","in":"query","description":"optional date value to filter the list (inclusive).","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"optional date value to filter the list (inclusive).","schema":{"type":"string","format":"date"}},{"$ref":"#/components/parameters/AccountDocumentType"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountDocument"}},"examples":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"getDocsForAccount"},"parameters":[{"$ref":"#/components/parameters/AccountID"}]},"/v1/accounts/{account_id}/documents/upload":{"post":{"tags":["Documents"],"summary":"Upload Owner Documents for an Existing Account","description":"Upload documents for the primary account owner of an account.\n\nDocuments are binary objects whose contents are encoded in base64. Each encoded content size is limited to 10MB if you use Alpaca for KYCaaS. If you perform your own KYC there are no document size limitations.\n\nAs a convenience, documents of type w8ben may be uploaded as a JSON object using the content_data request property. The Alpaca system will then generate a formatted W-8 BEN document for subsequent downloads.\n\nNote that these owner documents are distinct from the account documents generated by Alpaca, such as tax statements and trade confirmations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OwnerDocumentUploadRequest"}}}}},"responses":{"204":{"description":"Success (No Content)"},"400":{"description":"Bad Request. The body in the request is not valid.","content":{"application/json":{"schema":{"type":"string"}}}},"404":{"description":"Not Found. No account was found for this account_id","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"uploadDocToAccount"},"parameters":[{"$ref":"#/components/parameters/AccountID"}]},"/v1/accounts/{account_id}/documents/{document_id}/download":{"get":{"security":[{"BasicAuth":[]}],"summary":"Download an Account Document","tags":["Documents"],"description":"This endpoint downloads an account document based on the document ID. The document will be in PDF format.\n\nThe operation returns a pre-signed downloadable link as a redirect with HTTP status code 301 if one is found.\n\nYou can retrieve a JSON version of a monthly statement by passing in the header accept: application/json header.\n\nThese account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.\n","responses":{"301":{"description":"Redirect to the pre-signed download link for the account document PDF file.\n"},"404":{"description":"The document is not found."}},"operationId":"downloadDocFromAccount"},"parameters":[{"$ref":"#/components/parameters/AccountID"},{"$ref":"#/components/parameters/DocumentID"}]},"/v1/accounts/{account_id}/recipient_banks":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"tags":["Funding","Accounts"],"summary":"Retrieve Bank Relationships for an Account","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["ACTIVE","INACTIVE"],"example":"ACTIVE"}},{"name":"bank_name","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"An array of Bank relationships attached to this Account.\n\nAn empty array will be returned if no Bank relationships have been attached to this account","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Bank"}}}}},"400":{"description":"Bad request. The body in the request is not valid."}},"operationId":"getRecipientBanks","description":"Retrieves Bank Relationships for an account"},"post":{"tags":["Funding","Accounts"],"summary":"Create a Bank Relationship for an Account","parameters":[{"$ref":"#/components/parameters/AccountID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankRequest"}}}},"responses":{"200":{"description":"The created Bank relationship","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bank"}}}},"400":{"description":"Bad Request"},"409":{"description":"A Bank relationship already exists for this account"}},"operationId":"createRecipientBank","description":"If successful, retrieves Bank Relationships for an account"}},"/v1/accounts/{account_id}/recipient_banks/{bank_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"name":"bank_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"delete":{"tags":["Funding"],"summary":"Delete a Bank Relationship for an Account","responses":{"204":{"description":"Success (No Content)"},"400":{"description":"Bad Request"},"404":{"description":"No Bank Relationship with the id specified by bank_id was found for this Account"}},"operationId":"deleteRecipientBank","description":"If successful, deletes Bank Relationship for an account"}},"/v1/accounts/ira_excess_contributions":{"get":{"tags":["IRA"],"summary":"Retrieve Excess Contributions","description":"Returns all overcontributed IRA accounts","operationId":"listIRAExcessContritbutions","responses":{"200":{"description":"list of overcontributed IRA accounts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OvercontributedIRAAccount"}}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/demo/banking/funding":{"post":{"tags":["Funding Wallets"],"summary":"Create sandbox deposit transfer","operationId":"demoDepositFunding","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoFundingTransfer"}}}},"responses":{"200":{"description":"Demo deposit funding transfer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoFundingTransfer"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/funding_wallet":{"post":{"tags":["Funding Wallets"],"summary":"Batch create funding wallets","operationId":"batchCreateFundingWallets","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateFundingWalletRequest"}}}},"responses":{"200":{"description":"Funding wallets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateFundingWalletResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/{account_id}/funding_wallet":{"get":{"tags":["Funding Wallets"],"summary":"Retrieve funding wallet","operationId":"getFundingWallet","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"funding wallet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingWallet"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Funding Wallets"],"summary":"Creates a funding wallet","operationId":"createFundingWallet","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"funding wallet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingWallet"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/{account_id}/funding_wallet/funding_details":{"get":{"tags":["Funding Wallets"],"summary":"Retrieve funding details","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}},{"name":"payment_type","in":"query","description":"The type of SSI to be returned, priority (SWIFT) or regular (local). A null value returns all payment types.","required":false,"schema":{"$ref":"#/components/schemas/FundingDetailPaymentType"}},{"name":"currency","in":"query","description":"Should be provided in ISO 4217 standard","required":false,"schema":{"type":"string"}}],"description":"Returns a list of funding details if it exists. Query parameters must be passed to create a new funding details object if none exist.","operationId":"listFundingDetails","responses":{"200":{"description":"list of wallets","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ListFundingDetails"}}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/{account_id}/funding_wallet/transfers":{"get":{"tags":["Funding Wallets"],"summary":"Retrieve funding wallet transfers","operationId":"getFundingWalletTransfers","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"transfers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTransfersResponse"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/{account_id}/funding_wallet/transfers/{transfer_id}":{"get":{"tags":["Funding Wallets"],"summary":"Retrieve funding wallet transfer by ID","operationId":"getFundingWalletTransferByID","parameters":[{"name":"account_id","in":"path","description":"Alpaca account UUID","required":true,"schema":{"type":"string"}},{"name":"transfer_id","in":"path","description":"transfer UUID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"transfer response if found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingWalletTransfer"}}}},"404":{"description":"error response if transfer is not found"},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/{account_id}/funding_wallet/recipient_bank":{"get":{"tags":["Funding Wallets"],"summary":"Retrieve recipient bank","operationId":"getFundingWalletRecipientBank","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"recipient bank"},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Funding Wallets"],"summary":"Create a recipient bank","description":"Creates a new recipient bank. Returns the new recipient bank entity on success. entity.","operationId":"createFundingWalletRecipientBank","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"required":["bank_country","currency","bank_name","street_address","city","account_number"],"properties":{"bank_name":{"type":"string"},"bank_account_holder_name":{"type":"string","description":"Bank account holder's name."},"bank_country":{"type":"string","description":"Two-letter code for the country in which the beneficiary's bank account is held."},"currency":{"type":"string","description":"Currency in which money is held in the beneficiary's bank account. ISO-3 currency code."},"street_address":{"type":"string","description":"First line of address."},"account_number":{"type":"string","description":"Bank account number."},"routing_code_type":{"type":"string","description":"Local payment routing system. If supplied, routing_code should also be supplied.","enum":["sort_code","aba","bsb_code","institution_no","bank_code","branch_code","clabe","cnaps","ifsc"]},"routing_code":{"type":"string","description":"Routing code for routing_code_type. If supplied, routing_code_type should also be supplied."},"bic_swift":{"type":"string","description":"BIC/SWIFT code"},"iban":{"type":"string","description":"IBAN code"},"account_type":{"type":"string","description":"Bank account type.","enum":["checking","savings"]},"city":{"type":"string","description":"City"},"postal_code":{"type":"string","description":"Postal code"},"state_or_province":{"type":"string","description":"State or province."}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingWalletRecipientBank"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Funding Wallets"],"summary":"Delete a recipient bank","description":"deletes a recipient bank.","operationId":"deleteFundingWalletRecipientBank","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"recipient bank"},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1beta/accounts/{account_id}/funding_wallet/withdrawal":{"post":{"tags":["Funding Wallets"],"summary":"Create a withdrawal","description":"Creates a withdrawal","operationId":"createFundingWalletWithdrawal","parameters":[{"name":"account_id","in":"path","description":"UUID alpaca account ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFundingWalletWithdrawalRequest"}}}},"responses":{"200":{"description":"Transfer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingWalletTransfer"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{account_id}/transfers":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"summary":"Retrieve List of Transfers for an Account.","tags":["Funding"],"description":"You can query a list of transfers for an account.\n\n\nYou can filter requested transfers by values such as direction and status.\n\nReturns a list of transfer entities ordered by created_at\n","parameters":[{"name":"direction","in":"query","schema":{"enum":["INCOMING","OUTGOING"],"type":"string"},"description":"INCOMING or OUTGOING"},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"offset","in":"query","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Transfer"}},"examples":{"example-1":{"value":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","relationship_id":"81412018-ffa2-43f9-a3eb-d39f1c5e0f87","bank_id":"f1ae96de-94c1-468e-93a3-6b7213930ca8","account_id":"449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65","type":"ach","status":"QUEUED","reason":"string","amount":"string","direction":"INCOMING","created_at":"2019-08-24T14:15:22Z","updated_at":"2019-08-24T14:15:22Z","expires_at":"2019-08-24T14:15:22Z","additional_information":"string","ira":{"tax_year":"2024","fed_withholding_pct":"10.25","fed_withholding_amount":"102.5","state_withholding_pct":"9.75","state_withholding_amount":"97.5","distribution_reason":"normal"}}]},"example-2":{"value":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","relationship_id":"81412018-ffa2-43f9-a3eb-d39f1c5e0f87","bank_id":"f1ae96de-94c1-468e-93a3-6b7213930ca8","account_id":"449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65","type":"ach","status":"QUEUED","reason":"string","amount":"string","direction":"INCOMING","created_at":"2019-08-24T14:15:22Z","updated_at":"2019-08-24T14:15:22Z","expires_at":"2019-08-24T14:15:22Z","additional_information":"string","ira":{"tax_year":"2024","fed_withholding_pct":"10.25","fed_withholding_amount":"102.5","state_withholding_pct":"9.75","state_withholding_amount":"97.5","distribution_reason":"normal"}}]}}}}}},"operationId":"getTransfersForAccount"},"post":{"summary":"Request a New Transfer","tags":["Funding","Accounts"],"description":"Create a new transfer to an account to fund it.\n\nIn the sandbox environment, you can instantly deposit to or withdraw from an account with a virtual money amount. In the production environment, this endpoint is used only for requesting an outgoing (withdrawal) wire transfer at this moment. For the wire transfer (in production), you need to create a bank resource first using the Bank API. For more on how to fund an account in sandbox please check out this tutorial [here](https://alpaca.markets/learn/fund-broker-api/).","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransferRequest"}}}},"responses":{"200":{"description":"Successfully requested a transfer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}}},"operationId":"createTransferForAccount"}},"/v1/accounts/{account_id}/transfers/{transfer_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"schema":{"type":"string","format":"uuid"},"name":"transfer_id","in":"path","required":true,"description":"Tranfer identifier"}],"delete":{"summary":"Request to Close a Transfer","operationId":"deleteTransfer","responses":{"204":{"description":"Success (No Content)"},"404":{"description":" Transfer Not Found"}},"description":"Request to close a transfer","tags":["Funding"]}},"/v1/accounts/activities":{"get":{"tags":["Accounts"],"summary":"Retrieve Account Activities","parameters":[{"name":"account_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"id of a single account to filter by"},{"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."},{"$ref":"#/components/parameters/Direction"},{"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."},{"in":"query","name":"page_token","description":"Token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}}}}}},"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.\n\n* If specified with a `direction` of `desc`, for example, the results will end before the activity with the specified ID.\n* If specified with a `direction` of `asc`, results will begin with the activity immediately after the one specified.\n* `page_size` is the maximum number of entries to return in the response.\n* If `date` is not specified, the default and maximum value is 100.\n* If `date` is specified, the default behavior is to return all results, and there is no maximum page size."}},"/v1/accounts/activities/{activity_type}":{"parameters":[{"$ref":"#/components/parameters/ActivityType"}],"get":{"tags":["Accounts"],"parameters":[{"name":"account_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"id of a single account to filter by"},{"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."},{"$ref":"#/components/parameters/Direction"},{"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."}],"summary":"Retrieve Account Activities of Specific Type","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}}}}}},"operationId":"getAccountActivitiesByType","description":"Retrieves an Array of Activies by type\n\nIf {activity_type} is provided as part of the URL, category cannot be provided as query parameter. They are mutually exclusive.\n\nNotes:\n* Pagination is handled using the `page_token` and `page_size` parameters.\n* `page_token` represents the ID of the end of your current page of results.\n  for example if in your first response the id of the last Activiy item returned in the array was `20220203000000000::045b3b8d-c566-4bef-b741-2bf598dd6ae7`, you'd pass that value as `page_token` to get the next page of results\n\n* If specified with a `direction` of `desc`, for example, the results will end before the activity with the specified ID.\n* If specified with a `direction` of `asc`, results will begin with the activity immediately after the one specified.\n* `page_size` is the maximum number of entries to return in the response.\n* If `date` is not specified, the default and maximum value is 100.\n* If `date` is specified, the default behavior is to return all results, and there is no maximum page size."}},"/v1/accounts/{account_id}/ach_relationships":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"summary":"Retrieve ACH Relationships for an account","tags":["Funding"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ACHRelationship"}}}}}},"operationId":"getAccountACHRelationships","description":"Returns a list of ACH Relationships for an account","parameters":[{"schema":{"type":"string"},"in":"query","name":"statuses","description":"Comma-separated status values"}]},"post":{"summary":"Create an ACH Relationship","operationId":"createACHRelationshipForAccount","responses":{"200":{"description":"returns the newly created ACH Relationship entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ACHRelationship"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/NotAuthorized"},"409":{"description":"The account already has an active relationship.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Create a new ACHRelationship for an account\n\nIf successful, will return 200 code with a newly created ACH Relationship entity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateACHRelationshipRequest"}}},"description":"Create ACH Relationship "},"tags":["Funding"]}},"/v1/accounts/{account_id}/ach_relationships/{ach_relationship_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"schema":{"type":"string","format":"uuid"},"name":"ach_relationship_id","in":"path","description":"ACH relationship identifier","required":true}],"delete":{"summary":"Delete an existing ACH relationship","operationId":"deleteACHRelationshipFromAccount","responses":{"204":{"description":"Success (No Content)"},"400":{"description":"the passed in account_id or relationship_id were invalid"},"404":{"description":"Relationship Not Found"}},"description":"Delete an existing ACH relationship for an account","tags":["Funding"]}},"/v1/trading/accounts/{account_id}/account":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"operationId":"getTradingAccount","summary":"Retrieve Trading Details for an Account","tags":["Accounts"],"description":"As a broker you can view more trading details about your users.\n\nThe response is a Trading Account model.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeAccount"}}}}}}},"/v1/trading/accounts/{account_id}/positions":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"summary":"List Open Positions for an Account","tags":["Trading"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Position"}}}}}},"operationId":"getPositionsForAccount","description":"List open positions for an account"},"delete":{"summary":"Close All Positions for an Account","operationId":"closeAllPositionsForAccount","responses":{"207":{"description":"HTTP 207 Multi-Status with body; an 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/PositionClosedResponse"}},"examples":{"example-1":{"value":[{"symbol":"TSLA","status":200,"body":{"id":"d1143025-89fc-4952-8936-db2409d899f3","client_order_id":"17dbfab4-cb86-4e0a-8fa6-f0606b0a9a4e","created_at":"2022-05-13T16:25:29.336330998Z","updated_at":"2022-05-13T16:25:29.336330998Z","submitted_at":"2022-05-13T16:25:29.335776073Z","filled_at":null,"expired_at":null,"canceled_at":null,"failed_at":null,"replaced_at":null,"replaced_by":null,"replaces":null,"asset_id":"a4778bc8-fad1-47b7-87fe-d5cde10d43f4","symbol":"TSLA","asset_class":"us_equity","notional":null,"qty":"4","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,"source":null}}]}}}}},"500":{"description":"Failed to liquidate some positions"}},"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.","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"cancel_orders","description":"If true is specified, cancel all open orders before liquidating all positions."}],"tags":["Trading"]}},"/v1/trading/accounts/{account_id}/positions/{symbol_or_asset_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"schema":{"type":"string"},"name":"symbol_or_asset_id","in":"path","required":true,"description":"The symbol or asset_id "}],"get":{"summary":"Get an Open Position for account by Symbol or AssetId","responses":{"200":{"description":"The requested Position object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Position"}}}},"404":{"description":"Account doesn't have a position for this symbol or asset_id "}},"operationId":"getPositionsForAccountBySymbol","description":"Retrieves the account’s open position for the given symbol or asset_id.","tags":["Trading"]},"delete":{"summary":"Close a Position for an Account","operationId":"closePositionForAccountBySymbol","responses":{"200":{"description":"OK","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.","tags":["Trading"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"qty","description":"Optional the number of shares to liquidate. Can accept up to 9 decimal points. Cannot work with percentage"},{"schema":{"type":"string"},"in":"query","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","name":"percentage"}]}},"/v1/trading/accounts/{account_id}/account/pdt/status":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"summary":"Get Pattern Day Trader Status for account","responses":{"200":{"description":"The requested Pattern Day Trader Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PDTStatus"}}}}},"operationId":"pdtGetStatus","description":"Retrieves the account’s pattern day trader status","tags":["Accounts"]}},"/v1/trading/accounts/{account_id}/account/pdt/one-time-removal":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"post":{"summary":"Exercise PDT one time removal","responses":{"200":{"description":"Response to PDT one time removal request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PDTRemoval"}}}},"403":{"description":"Forbidden\n\nAccount is not flagged as PDT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"Account is not PDT":{"value":{"code":40310000,"message":"account is not PDT"}}}}}}},"operationId":"pdtOneTimeRemoval","description":"Requests the exercise of pattern day trader one time removal for given account","tags":["Accounts"]}},"/v1/trading/accounts/{account_id}/positions/{symbol_or_contract_id}/exercise":{"post":{"tags":["Trading"],"summary":"Exercise an Options Position (BETA)","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":[{"$ref":"#/components/parameters/AccountID"},{"schema":{"type":"string","format":"uuid"},"name":"symbol_or_contract_id","in":"path","required":true,"description":"Option contract symbol or ID."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExerciseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExerciseResponse"}}}},"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"}}}}}}}}},"/v1/trading/accounts/{account_id}/orders/{order_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"$ref":"#/components/parameters/OrderID"}],"get":{"summary":"Retrieve an Order by its ID","tags":["Trading"],"description":"Retrieves a single order for the given order_id.","responses":{"200":{"description":"The requested Order object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getOrderForAccount"},"patch":{"summary":"Replace an Order","tags":["Trading"],"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 found [here](https://docs.alpaca.markets/reference/subscribetotradev2sse).\n\nWhile an order is being replaced, the account's 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`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrderRequest"}}}},"responses":{"200":{"description":"A new Order object with a new order_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"description":"Buying power or shares are not sufficient"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"replaceOrderForAccount"},"delete":{"summary":"Cancel an Open Order","tags":["Trading"],"description":"Attempts to cancel an open order. If the order is no longer cancelable (for example if the status is \"filled\"), the server will respond with status 422, and reject the request.\n\nUpon acceptance of the cancel request, it returns status 204.","responses":{"204":{"description":"Success (No Content)"},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteOrderForAccount"}},"/v1/trading/accounts/{account_id}/orders":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"get":{"parameters":[{"name":"status","in":"query","description":"Order status to be queried. open, closed or all. Defaults to open.","schema":{"type":"string","enum":["open","closed","all"]}},{"name":"limit","in":"query","description":"The maximum number of orders in response. Defaults to 50 and max is 500.","schema":{"type":"integer","example":500}},{"$ref":"#/components/parameters/AssetClass"},{"$ref":"#/components/parameters/After"},{"$ref":"#/components/parameters/Until"},{"$ref":"#/components/parameters/Direction"},{"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."},{"$ref":"#/components/parameters/Symbols"},{"schema":{"type":"string"},"in":"query","name":"qty_above"},{"schema":{"type":"string"},"in":"query","name":"qty_below"},{"schema":{"type":"string"},"in":"query","name":"subtag"}],"summary":"Retrieve a List of Orders","tags":["Trading"],"description":"Retrieves a list of orders for the account, filtered by the supplied query parameters.\n\nEndpoint defaults to open orders if no parameters are provided.","responses":{"200":{"description":"Retrieves a list of orders for the account, filtered by the supplied query parameters.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getAllOrdersForAccount"},"post":{"summary":"Create an Order for an Account","tags":["Trading"],"description":"Creating an order for your end customer. Each trading request must pass in the account_id in the URL.\n\n- Note that when submitting crypto orders, `market`, `limit` and `stop_limit` orders are supported while the supported `time_in_force` values are `gtc`, and `ioc`.\n- For equities and crypto we accept fractional orders as well with either `notional` or `qty` provided.\n- Note that submitting an options order is only available for partners who have been enabled for Options BETA.\n- In case of Fixed Income, only `market` and `limit` order types with `day` `time_in_force` are supported, and order replacement is not supported.\nNote that submitting Fixed Income orders is only available for partners who have been enabled for Fixed Income.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"},"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 (BETA)","value":{"symbol":"AAPL250620C00100000","qty":"2","side":"buy","type":"limit","limit_price":"10","time_in_force":"day"}},"Crypto":{"summary":"Buy a crypto coin","value":{"symbol":"ETH/USD","qty":"0.02","side":"buy","type":"limit","limit_price":"2100","time_in_force":"gtc"}},"FixedIncome":{"summary":"Buy a US Treasury Bill","value":{"symbol":"US912797QN08","qty":"5000","side":"buy","type":"limit","limit_price":"99.15","time_in_force":"day"}}}}}},"responses":{"200":{"description":"OK","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"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Some parameters are not valid"}},"operationId":"createOrderForAccount"},"delete":{"summary":"Cancel all Open Orders For an Account","tags":["Trading"],"description":"Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled.","responses":{"207":{"description":"HTTP 207 Multi-Status with body, which is an array of objects that include the order id, http status code and an order object for each cancellation request.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderClosedResponse"}},"examples":{"example-1":{"value":[{"id":"872994c5-0620-40ad-8ae0-f224b9948df5","status":200}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteAllOrdersForAccount"}},"/v1/assets":{"get":{"tags":["Assets"],"summary":"Retrieve All Assets","description":"Returns all assets","responses":{"200":{"description":"An array of asset objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Asset"}}}}}},"operationId":"getAssets","parameters":[{"schema":{"type":"string","enum":["active","inactive","all"],"example":"all","default":"all"},"in":"query","name":"status","description":"Asset status to filter by, will default to `all`"},{"schema":{"type":"string","enum":["us_equity","crypto"],"example":"us_equity","default":"us_equity"},"in":"query","name":"asset_class","description":"Asset class to filter by, `us_equity` or `crypto`. Defaults to `us_equity`"},{"schema":{"type":"array","items":{"type":"string","enum":["ptp_no_exception","ptp_with_exception","ipo","has_options","options_late_close","fractional_eh_enabled","overnight_tradable","overnight_halted"]},"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`, `fractional_eh_enabled`, `overnight_tradable`, `overnight_halted`.\nNote: `overnight_tradable` and `overnight_halted` are only available when overnight trading is enabled.","explode":false}]}},"/v1/assets/{symbol_or_asset_id}":{"parameters":[{"name":"symbol_or_asset_id","required":true,"in":"path","schema":{"type":"string"},"description":"you can use either the asset's Id or the symbol to search"}],"get":{"tags":["Assets"],"summary":"Retrieve an Asset by ID","description":"Returns the requested asset, if found","responses":{"200":{"description":"Returns asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"404":{"description":"Asset not found"}},"operationId":"getAssetBySymbolOrId"}},"/v1/assets/entry-requirements":{"get":{"tags":["Assets"],"summary":"Retrieve Entry Requirements for requested assets","description":"Returns all entry-requirements","responses":{"200":{"description":"An array of asset entry requirement objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetEntryRequirements"}}}}}},"operationId":"get-asset-entry-requirements","parameters":[{"name":"symbols","in":"query","description":"Comma-separated symbols or asset ids. The symbols (or asset ids) for which asset entry requirements are to be requested. Maximum number of symbols allowed is 500.","required":true,"schema":{"type":"string"},"example":"AAPL,SPY"}]}},"/v1/options/contracts":{"get":{"summary":"Get Option Contracts (BETA)","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"]}}}}}}},"/v1/options/contracts/{symbol_or_id}":{"parameters":[{"schema":{"type":"string"},"name":"symbol_or_id","in":"path","required":true,"description":"The contract symbol or ID."}],"get":{"summary":"Get an option contract by ID or Symbol (BETA)","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"}}}}}}}}},"/v1/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."}},"/v1/calendar":{"get":{"tags":["Calendar"],"summary":"Retrieve the Market Calendar","parameters":[{"name":"start","description":"The first date to retrieve data for. (Inclusive) in YYYY-MM-DD format","in":"query","schema":{"type":"string","format":"date","example":"2022-01-01"}},{"name":"end","description":"The last date to retrieve data for. (Inclusive) in YYYY-MM-DD format","in":"query","schema":{"type":"string","format":"date","example":"2022-01-01"}},{"name":"date_type","schema":{"type":"string"},"in":"query","description":"‘trading’ or ‘settlement’. Default value is ‘trading’. Indicates to filter by trade date or settlement date if start or end are specified."}],"responses":{"200":{"description":"Returns the calendar object","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Calendar"}}}}}},"operationId":"queryMarketCalendar","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."}},"/v1/clock":{"get":{"tags":["Clock"],"summary":"Retrieve the Market Clock","responses":{"200":{"description":"The current market's timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Clock"},"examples":{}}}}},"operationId":"queryMarketClock","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."}},"/v1/country-info":{"get":{"tags":["Country Info"],"summary":"Retrieve countries information","responses":{"200":{"description":"Returns the countries information as a map","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryInfos"},"examples":{}}}}},"operationId":"queryCountryInfos","description":"The Country Info API serves country information for every supported countries including risk ratings and supported crypto states where applicable."}},"/v1/events/accounts/status":{"get":{"summary":"Subscribe to Account Status Events (SSE)","tags":["Events"],"description":"The accounts events API provides streaming of account changes as they occur, via SSE (server sent events). Past events can also be queried.\n\nEvents are generated for changes to the following account properties:\n- account_blocked\n- admin_configurations\n- cash_interest\n- crypto_status\n- kyc_results\n- options\n- pattern_day_trader\n- status\n- trading_blocked\n\nOnly the changed properties are included in the event payload.\n\nQuery Parameter Rules:\n- `since` is required if `until` specified\n- `since_id` is required if `until_id` specified\n- `since_ulid` is required if `until_ulid` specified\n- `since`, `since_id` and `since_ulid` can’t be used at the same time\n\nBehavior:\nThis API supports querying a range of events, starting now or in the past. If the end of the range is in the future or not specified, the connection is kept open and future events are pushed.\n\nTo be specific:\n- if `since`, `since_id` or `since_ulid` is not specified, this will not return any historic data\n- if `until`, `until_id` or `until_ulid` is reached, the stream will end with a status of 200\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3.\n","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"integer"}},{"name":"until_id","in":"query","schema":{"type":"integer"}},{"name":"since_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"schema":{"type":"string"},"in":"query","name":"id"}],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountStatusEvent"}},"examples":{}}}}},"operationId":"suscribeToAccountStatusSSE"}},"/v1/events/journals/status":{"get":{"summary":"Subscribe to Journal Events (SSE) (Legacy)","tags":["Events"],"description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to journal status updates as they get processed by our backoffice.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since_ulid` required if `until_ulid` specified\n- `since`, `since_id` or `since_ulid`  can’t be used at the same time\nBehavior:\n- if `since`, `since_id` or `since_ulid` not specified this will not return any historic data\n- if `until`, `until_id` or `until_ulid` reached stream will end (status 200)\n\n---\n\nThere is no compatibility between /v1/events/journals/status and /v2beta1/events/journals/status, the ids (ulid) are always different, and the number of events might also different\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3.\n","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"integer"}},{"name":"until_id","in":"query","schema":{"type":"integer"}},{"name":"since_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"schema":{"type":"string"},"in":"query","name":"id"}],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JournalStatusEvent"}}}}}},"operationId":"subscribeToJournalStatusSSE"}},"/v2beta1/events/journals/status":{"get":{"summary":"Subscribe to Journal Events (SSE)","tags":["Events"],"description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to journal status updates as they get processed by our backoffice.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since` and `since_id` can’t be used at the same time\n- `until` and `until_id` can’t be used at the same time\nBehavior:\n- if `since` or `since_ulid` not specified this will not return any historic data\n- if `until` or `until_id` reached stream will end (status 200)\n\n---\n\nThere is no compatibility between /v1/events/journals/status and /v2beta1/events/journals/status, the ids (ulid) are always different, and the number of events might also different\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3.\n","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_id","in":"query","schema":{"type":"string","format":"ulid"}},{"schema":{"type":"string"},"in":"query","name":"id"}],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JournalStatusEventV2"}}}}}},"operationId":"subscribeToJournalStatusV2SSE"}},"/v1/events/transfers/status":{"get":{"summary":"Subscribe to Transfer Events (SSE)","tags":["Events"],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransferStatusEvent"}}}}}},"parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"integer"}},{"name":"until_id","in":"query","schema":{"type":"integer"}},{"name":"since_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_ulid","in":"query","schema":{"type":"string","format":"ulid"}}],"operationId":"subscribeToTransferStatusSSE","description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to transfer status updates as they get processed by our backoffice, for both end-user and firm accounts.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since_ulid` required if `until_ulid` specified\n- `since`, `since_id` or `since_ulid`  can’t be used at the same time\nBehavior:\n- if `since`, `since_id` or `since_ulid` not specified this will not return any historic data\n- if `until`, `until_id` or `until_ulid` reached stream will end (status 200)\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3."},"parameters":[]},"/v1/events/trades":{"get":{"summary":"Subscribe to Trade Events (SSE) (Legacy)","deprecated":true,"tags":["Events"],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeUpdateEvent"}}}}}},"parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"integer"}},{"name":"until_id","in":"query","schema":{"type":"integer"}},{"name":"since_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_ulid","in":"query","schema":{"type":"string","format":"ulid"}}],"operationId":"subscribeToTradeSSE","description":"**Deprecation notice**\n\nAs part of the deprecation process, the legacy trade events API is now only available for existing broker-partners at: `GET /v1/events/trades` only for compatibility reasons.\n\nAll new broker partners will not have the option for the legacy trade event endpoint.\n\nAll new broker partners will have to integrate with the new `/v2/events/trades` endpoint.\n\nAlso, all existing broker partners are now recommended to upgrade to the `/v2/events/trades` endpoint, which provides faster event delivery times.\n\nFor trade events of MLeg (multi-leg) order, please use the `/v2/events/trades` endpoint.\n\nPlease note that the new `/v2` endpoint, is the same as, and was originally available under `/v2beta1`.\nWe encourage all customers to adjust their codebase from that interim beta endpoint to the `/v2` stable endpoint.\nIn the near future we will setup permanent redirect from `/v2beta1` to `/v2` before we completely remove the beta endpoint.\n\n---\n\nThe Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to events related to trade updates. Most market trades sent during market hours are filled instantly; you can listen to limit order updates through this endpoint.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since_ulid` required if `until_ulid` specified\n- `since`, `since_id` or `since_ulid`  can’t be used at the same time\nBehavior:\n- if `since`, `since_id` or `since_ulid` not specified this will not return any historic data\n- if `until`, `until_id` or `until_ulid` reached stream will end (status 200)\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3.\n\n---\n\n**Deprecation note**\n\nLegacy event id (integer based) is unavailable for new broker partners, and it will be deprecated for existing brokers as well.\nThis deprecation is includes the `since_id` and `until_id` query parameter and the `event_id` field in the response.\n\n---\n\n**Common events**\n\nThese are the events that are the expected results of actions you may have taken by sending API requests.\n\nThe meaning of the timestamp field changes for each type; the meanings have been specified here for which types the timestamp field will be present.\n\n- `accepted` Sent when an order recieved and accepted by Alpaca\n- `pending_new` Sent when the order has been received by Alpaca and routed to the exchanges, but has not yet been accepted for execution.\n- `new` Sent when an order has been routed to exchanges for execution.\n- `fill` Sent when your order has been completely filled.\n  - timestamp: The time at which the order was filled.\n- `partial_fill` Sent when a number of shares less than the total remaining quantity on your order has been filled.\n  - timestamp: The time at which the shares were filled.\n- `canceled` Sent when your requested cancellation of an order is processed.\n  - timestamp: The time at which the order was canceled.\n- `expired` Sent when an order has reached the end of its lifespan, as determined by the order's time in force value.\n  - timestamp: The time at which the order expired.\n- `done_for_day` Sent when the order is done executing for the day, and will not receive further updates until the next trading day.\n- `replaced` Sent when your requested replacement of an order is processed.\n  - timestamp: The time at which the order was replaced.\n\n**Rarer events**\n\nThese are events that may rarely be sent due to unexpected circumstances on the exchanges. It is unlikely you will need to design your code around them, but you may still wish to account for the possibility that they will occur.\n\n- `rejected` Sent when your order has been rejected.\n- `held` For multi-leg orders, the secondary orders (stop loss, take profit) will enter this state while waiting to be triggered.\n- `stopped` Sent when your order has been stopped, and a trade is guaranteed for the order, usually at a stated price or better, but has not yet occurred.\n- `pending_cancel` Sent when the order is awaiting cancellation. Most cancellations will occur without the order entering this state.\n- `pending_replace` Sent when the order is awaiting replacement.\n- `calculated` Sent when the order has been completed for the day - it is either filled or done_for_day - but remaining settlement calculations are still pending.\n- `suspended` Sent when the order has been suspended and is not eligible for trading.\n- `order_replace_rejected` Sent when the order replace has been rejected.\n- `order_cancel_rejected` Sent when the order cancel has been rejected.\n- `trade_bust`: Sent when a previously reported execution has been canceled (“busted”) by the upstream exchange.\n- `trade_correct`: Sent when a previously reported trade has been corrected. For example, the exchange may have updated the price, quantity, or another execution parameter after the trade was initially reported."},"parameters":[]},"/v2/events/trades":{"get":{"summary":"Subscribe to Trade Events (SSE)","tags":["Events","Trading"],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeUpdateEventV2"}},"examples":{"new":{"$ref":"#/components/examples/TradeUpdateEventV2New"},"MultilegOptions-fill":{"$ref":"#/components/examples/TradeUpdateEventV2MultilegOptionsFill"}}}}}},"parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_id","in":"query","schema":{"type":"string","format":"ulid"}}],"operationId":"subscribeToTradeV2SSE","description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to events related to trade updates. Most market trades sent during market hours are filled instantly; you can listen to limit order updates through this endpoint.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since` and `since_id` can’t be used at the same time\nBehavior:\n- if `since` or `since_id` not specified this will not return any historic data\n- if `until` or `until_id` reached stream will end (status 200)\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3.\n\n---\n\n**Legacy trade events API**\n\n**Deprecation notice**\n\nAs part of the deprecation process,\nthe legacy trade events API is now only available for existing broker-partners at: `GET /v1/events/trades` only for compatibility reasons.\n\nAll new broker partners will not have the option for the legacy trade event endpoint.\n\nAll new broker partners will have to integrate with the new `/v2/events/trades` endpoint.\n\nAlso, all existing broker partners are now recommended to upgrade to the `/v2/events/trades` endpoint, which provides faster event delivery times.\n\nThe legacy trade events api works the same way as the new one with the exception of the event_id which is an integer except of an ULID. This results in the request’s since_id and until_id are also being integers. This integer is monotonically increasing over time for events.\n\nPlease note that the new `/v2` endpoint, is the same as, and was originally available under `/v2beta1`.\nWe encourage all customers to adjust their codebase from that interim beta endpoint to the `/v2` stable endpoint.\nIn the near future we will setup permanent redirect from `/v2beta1` to `/v2` before we completely remove the beta endpoint.\n\n---\n\n###  Comment messages\nAccording to the SSE specification, any line that starts with a colon is a comment which does not contain data.  It is typically a free text that does not follow any data schema. A few examples mentioned below for comment messages.\n\n#####  Slow client\n\nThe server sends a comment when the client is not consuming messages fast enough. Example: `: you are reading too slowly, dropped 10000 messages`\n\n##### Internal server error\n\nAn error message is sent as a comment when the server closes the connection on an internal server error (only sent by the v2 and v2beta1 endpoints). Example: `: internal server error`\n\n---\n\n**Common events**\n\nThese are the events that are the expected results of actions you may have taken by sending API requests.\n\nThe meaning of the timestamp field changes for each type; the meanings have been specified here for which types the timestamp field will be present.\n\n- `accepted` Sent when an order recieved and accepted by Alpaca\n- `pending_new` Sent when the order has been received by Alpaca and routed to the exchanges, but has not yet been accepted for execution.\n- `new` Sent when an order has been routed to exchanges for execution.\n- `fill` Sent when your order has been completely filled.\n  - timestamp: The time at which the order was filled.\n- `partial_fill` Sent when a number of shares less than the total remaining quantity on your order has been filled.\n  - timestamp: The time at which the shares were filled.\n- `canceled` Sent when your requested cancellation of an order is processed.\n  - timestamp: The time at which the order was canceled.\n- `expired` Sent when an order has reached the end of its lifespan, as determined by the order's time in force value.\n  - timestamp: The time at which the order expired.\n- `done_for_day` Sent when the order is done executing for the day, and will not receive further updates until the next trading day.\n- `replaced` Sent when your requested replacement of an order is processed.\n  - timestamp: The time at which the order was replaced.\n\n**Rarer events**\n\nThese are events that may rarely be sent due to unexpected circumstances on the exchanges. It is unlikely you will need to design your code around them, but you may still wish to account for the possibility that they will occur.\n\n- `rejected` Sent when your order has been rejected.\n  - timestamp: The time at which the rejection occurred.\n- `held` For multi-leg orders, the secondary orders (stop loss, take profit) will enter this state while waiting to be triggered.\n- `stopped` Sent when your order has been stopped, and a trade is guaranteed for the order, usually at a stated price or better, but has not yet occurred.\n- `pending_cancel` Sent when the order is awaiting cancellation. Most cancellations will occur without the order entering this state.\n- `pending_replace` Sent when the order is awaiting replacement.\n- `calculated` Sent when the order has been completed for the day - it is either filled or done_for_day - but remaining settlement calculations are still pending.\n- `suspended` Sent when the order has been suspended and is not eligible for trading.\n- `order_replace_rejected` Sent when the order replace has been rejected.\n- `order_cancel_rejected` Sent when the order cancel has been rejected.\n- `trade_bust`: Sent when a previously reported execution has been canceled (“busted”) by the upstream exchange.\n- `trade_correct`: Sent when a previously reported trade has been corrected. For example, the exchange may have updated the price, quantity, or another execution parameter after the trade was initially reported.\n- `restated`: Sent when the order is manually modified."},"parameters":[]},"/v2/events/admin-actions":{"get":{"summary":"Subscribe to Admin Action Events (SSE)","tags":["Events"],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/AdminActionLegacyNote"},{"$ref":"#/components/schemas/AdminActionLiquidation"},{"$ref":"#/components/schemas/AdminActionTransactionCancel"}]}}}}}},"parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Format: RFC3339 or YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"Format: RFC3339 or YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_id","in":"query","schema":{"type":"string","format":"ulid"}}],"operationId":"subscribeToAdminActionSSE","description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nThis endpoint streams events related to administrative actions performed by our systems.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since` and `since_id` can’t be used at the same time\nBehavior:\n- if `since` or `since_id` not specified this will not return any historic data\n- if `until` or `until_id` reached stream will end (status 200)\n\n---\n\nWarning: Currently OAS-3 doesn't have full support for representing SSE style responses from an API.\n\nIn case the client code is generated from this OAS spec, don't specify a `since` and `until` there is a good chance the generated clients will hang forever waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific endpoint until the OAS-3 standards come to a consensus on how to represent this behavior in OAS-3.\n\n---\n\n###  Comment messages\nAccording to the SSE specification, any line that starts with a colon is a comment which does not contain data.  It is typically a free text that does not follow any data schema. A few examples mentioned below for comment messages.\n\n#####  Slow client\n\nThe server sends a comment when the client is not consuming messages fast enough. Example: `: you are reading too slowly, dropped 10000 messages`\n\n##### Internal server error\n\nAn error message is sent as a comment when the server closes the connection on an internal server error (only sent by the v2 and v2beta1 endpoints). Example: `: internal server error`\n\n---\n\n**Event Types**\n\n- **LegacyNote:** Old free text based admin notes\n- **Liquidation:** Event for a position liquidation which initialized by an admin\n- **TransactionCancel:** Event for a manually cancelled transaction"},"parameters":[]},"/v1/journals":{"get":{"summary":"Retrieve a List Journals","tags":["Journals"],"parameters":[{"name":"after","in":"query","schema":{"type":"string","format":"date"},"description":"By journal creation date. Format: 2020-01-01"},{"name":"before","in":"query","schema":{"type":"string","format":"date"},"description":"By journal creation date. Format: 2020-01-01"},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","canceled","executed","queued","rejected","deleted"]},"description":"See the JournalStatus model for more info"},{"name":"entry_type","in":"query","schema":{"type":"string","enum":["JNLC","JNLS"]},"description":"JNLC or JNLS"},{"name":"to_account","in":"query","schema":{"type":"string","format":"uuid"},"description":"The account id that received the journal"},{"name":"from_account","in":"query","schema":{"type":"string","format":"uuid"},"description":"The account id that initiated the journal"},{"name":"limit","in":"query","description":"The maximum number of results to return","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"discriminator":{"propertyName":"entry_type","mapping":{"JNLC":"#/components/schemas/JNLC","JNLS":"#/components/schemas/JNLS"}},"type":"array","items":{"$ref":"#/components/schemas/Journal"}}}}},"400":{"description":"One of the parameters is invalid.","content":{"application/json":{"schema":{"type":"string"}}}},"422":{"description":"Result set exceeds 100,000 records.","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"getAllJournals","description":"Returns an array of journal objects."},"post":{"summary":"Create a Journal","tags":["Journals"],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"An optional idempotency key can be used to ensure that a request is processed only once."}],"description":"A journal can be JNLC (move cash) or JNLS (move shares), dictated by `entry_type`. Generally, journal requests are subject to approval and starts from the `pending` status. The status changes are propagated through the Event API. Under certain conditions agreed for the partner, such journal transactions that meet the criteria are executed right away.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJournalRequest"},"example":{"entry_type":"JNLC","from_account":"7c891489-574f-4f9a-82f0-4082a07f4736","to_account":"2d47a229-0c25-40a2-8cc7-b2c8821ff93a","amount":"115.5"}}}},"responses":{"200":{"description":"The New Journal object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journal"}}}},"400":{"description":"One of the parameters is invalid.","content":{"application/json":{"schema":{"type":"string"}}}},"403":{"description":"The amount requested to move is not available.","content":{"application/json":{"schema":{"type":"string"}}}},"404":{"description":"One of the account is not found.","content":{"application/json":{"schema":{"type":"string"}}}},"422":{"description":"Unprocessable entity. The request is being rejected because of idempotency key violation: at least one field in the request has changed from the first request.\n"}},"operationId":"createJournal"}},"/v1/journals/{journal_id}":{"parameters":[{"name":"journal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"delete":{"summary":"Cancel a Pending Journal","tags":["Journals"],"description":"You can only delete a journal if the journal is still in a pending state, if a journal is executed you will not be able to delete. The alternative is to create a mirror journal entry to reverse the flow of funds.","responses":{"204":{"description":"The cancel request succeeded. (No-content)\n"},"404":{"description":"The journal is not found.\n"},"422":{"description":"The journal is not in the pending status.\n"}},"operationId":"deleteJournalById"},"get":{"summary":"Retrieve a Single Journal Entry","tags":["Journals"],"operationId":"get-v1-journals-journal_id","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journal"}}}}},"description":"You can query a specific journal entry that you submitted to Alpaca by passing into the query the journal_id.\n\nWill return a journal entry if a journal entry with journal_id exists, otherwise will throw an error."}},"/v1/journals/batch":{"post":{"summary":"Create a Batch Journal Transaction (One-to-Many)","operationId":"createBatchJournal","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"An optional idempotency key can be used to ensure that a request is processed only once."}],"responses":{"200":{"description":"an array of journal objects with an extra attribute error_message in the case when a specific account fails to receive a journal.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchJournalResponse"}},"examples":{}}}},"422":{"description":"Unprocessable entity. The request is being rejected because of idempotency key violation: at least one field in the request has changed from the first request.\n"}},"description":"You can create a batch of journal requests by using this endpoint. This is enabled on JNLC type Journals for now only.\n\nEvery single request must be valid for the entire batch operation to succeed.\n\nIn the case of a successful request, the response will contain an array of journal objects with an extra attribute error_message in the case when a specific account fails to receive a journal.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchJournalRequest"}}},"description":""},"tags":["Journals"]}},"/v1/oauth/clients/{client_id}":{"parameters":[{"name":"client_id","required":true,"in":"path","schema":{"type":"string","format":"uuid"}}],"get":{"summary":"Get an OAuth client","tags":["OAuth"],"description":"The endpoint returns the details of OAuth client to display in the authorization page.\n","parameters":[{"name":"response_type","in":"query","schema":{"type":"string","enum":["code","token"],"example":"token"},"description":"code or token"},{"name":"redirect_uri","in":"query","schema":{"type":"string","example":"https://example.com/authorize"},"description":"Redirect URI of the OAuth flow"},{"name":"scope","in":"query","schema":{"type":"string","example":"general"},"description":"Requested scopes by the OAuth flow"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OathClientResponse"},"examples":{"example-1":{"value":{"client_id":"7a3c52a910e1dc2abbb14da2b6b8e711","name":"TradingApp","description":"Sample description","url":"http://test.com","terms_of_use":"","privacy_policy":"","status":"ACTIVE","redirect_uri":["http://localhost"],"live_trading_approved":false}}}}}},"401":{"description":"Client does not exist or you do not have access to the client.\n","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"getOAuthClient"}},"/v1/oauth/token":{"post":{"summary":"Issue an OAuth token","tags":["OAuth"],"description":"The operation issues an OAuth code which can be used in the OAuth code flow.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueOAuthTokenResponse"},"examples":{"example-1":{"value":{"access_token":"87586f14-c3f4-4912-b107-f75bc17ff87a","token_type":"Bearer","scope":"general"}}}}}},"401":{"description":"Client does not exist, you do not have access to the client, or “client_secret” is incorrect.\n","content":{"application/json":{"schema":{"type":"string"}}}},"422":{"description":"Redirect URI or scope is invalid.\n","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"issueOAuthToken"}},"/v1/oauth/authorize":{"post":{"summary":"Authorize an OAuth Token","tags":["OAuth"],"description":"The operation issues an OAuth code which can be used in the OAuth code flow.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}}}},"responses":{"200":{"description":"Successfully issued a code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeOAuthTokenResponse"}}}},"401":{"description":"Client does not exist, you do not have access to the client, or “client_secret” is incorrect.\n","content":{"application/json":{"schema":{"type":"string"}}}},"422":{"description":"Redirect URI or scope is invalid.\n","content":{"application/json":{"schema":{"type":"string"}}}}},"operationId":"authorizeOAuthToken"}},"/v1/trading/accounts/{account_id}/watchlists":{"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"account_id","in":"path","required":true,"description":"Unique identifier of an account."}],"get":{"summary":"Retrieve all Watchlists for an Account","tags":["Watchlist"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WatchlistWithoutAsset"}}}}}},"operationId":"getAllWatchlistsForAccount","description":"Fetch a list of all watchlists currently in an account."},"post":{"summary":"Create a New Watchlist for an Account","tags":["Watchlist"],"operationId":"createWatchlistForAccount","description":"Returns the watchlist object","responses":{"200":{"description":"Newly created watchlist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWatchlistRequest"}}}}}},"/v1/trading/accounts/{account_id}/watchlists/{watchlist_id}":{"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"account_id","in":"path","required":true,"description":"Unique identifier of an account"},{"schema":{"type":"string","format":"uuid"},"name":"watchlist_id","in":"path","required":true,"description":"Unique identifier of a watchlist"}],"get":{"summary":"Manage watchlists","tags":["Watchlist"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"operationId":"getWatchlistForAccountById","description":"Retrieve Watchlist by ID"},"put":{"summary":"Update a Watchlist","tags":["Watchlist"],"operationId":"replaceWatchlistForAccountById","responses":{"200":{"description":"Updated watchlist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}}},"description":"Replace entirely the set of securities contained in the watchlist while optionally renaming it. Destructive operation.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWatchlistRequest"}}}}},"delete":{"summary":"Remove a Watchlist","tags":["Watchlist"],"operationId":"deleteWatchlistFromAccountById","responses":{"200":{"description":"Watchlist deleted."}},"description":"Irrevocably delete a watchlist."},"post":{"summary":"Add an Asset to a Watchlist","description":"Adds an asset to an existing watchlist.","tags":["Watchlist"],"operationId":"post-v1-trading-accounts-account_id-watchlists-watchlist_id","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}}},"404":{"description":"The requested watchlist is not found, or one of the symbols is not found in the assets"},"422":{"description":"Some parameters are not valid"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","x-stoplight":{"id":"zqgi2i6t4gw58"},"description":"The symbol name to add to the watchlist"}}}}},"description":""}}},"/v1/corporate_actions/announcements":{"get":{"summary":"Retrieve Announcements","deprecated":true,"tags":["Corporate Actions"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Announcement"}}}}},"400":{"$ref":"#/components/responses/BadRequest"}},"operationId":"getCorporateAnnouncements","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 CorporateActionType values","required":true},{"schema":{"type":"string","format":"date"},"in":"query","required":true,"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."},{"schema":{"type":"string","format":"date"},"in":"query","required":true,"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.","name":"until"},{"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","enum":["declaration_date","ex_date","record_date","payable_date"]},"in":"query","name":"date_type","description":"An emum of possible ways to use the `since` and `until` parameters to search by.\n\nthe types are:\n\n- **declaration_date**: The date of the preliminary announcement details or the date that any subsequent term updates took place.\n- **ex_date**: The date on which any security purchasing activity will not result in a corporate action entitlement. Any selling activity that takes place on or after this date will result in a corporate action entitlement.\n- **record_date**: The date the company checks its records to determine who is shareholder in order to allocate entitlements.\n- **payable_date**: The date that the stock and cash positions will update according to the account positions as of the record date."}]}},"/v1/accounts/{account_id}/cip":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true}],"post":{"summary":"Upload CIP information","operationId":"post-v1-accounts-account_id-cip","responses":{"200":{"description":"OK"}},"description":"The customer identification program (CIP) API allows you to submit the CIP results received from your KYC provider.\n\nThe minimum requirements to open an individual financial account are delimited and you must verify the true identity of the account holder at account opening:\n\nName\nDate of birth\nAddress\nIdentification number (for a U.S. citizen, a taxpayer identification number)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIPInfo"}}}},"tags":["KYC"]},"get":{"summary":"Retrieve CIP information","operationId":"get-v1-accounts-account_id-cip","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIPInfo"}}}}},"description":"You can retrieve the CIP information you’ve submitted for a given account.","tags":["KYC"]}},"/v1/accounts/{account_id}/onfido/sdk/tokens":{"get":{"summary":"Retrieve an Onfido SDK Token","tags":["KYC"],"parameters":[{"name":"account_id","in":"path","schema":{"type":"string","format":"uuid"},"required":true,"description":"The account ID"},{"name":"referrer","in":"query","schema":{"type":"string"},"description":"The referrer URL of your web app or the application ID of your mobile app. If not passed in, will default to the * wildcard"},{"name":"platform","in":"query","schema":{"type":"string"},"description":"Required if referrer provided. Enum values are either mobile or web"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"x-examples":{"Example 1":{"token":"header.payload.signature"}}}}}},"422":{"description":"Onfido applicant not yet created for account. If you haven’t already contacted Alapca to enable Onfido, please do so."}},"operationId":"get-v1-accounts-account_id-onfido-sdk-tokens","description":"Get an SDK token to activate the Onfido SDK flow within your app. You will have to keep track of the SDK token so you can pass it back when you upload the SDK outcome. We recommend storing the token in memory rather than persistent storage to reduce any unnecessary overhead in your app."}},"/v1/accounts/{account_id}/onfido/sdk":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true}],"patch":{"summary":"Update the Onfido SDK Outcome","operationId":"patch-v1-accounts-account_id-onfido-sdk","responses":{"200":{"description":"OK"},"404":{"description":"Account Not Found​"},"422":{"description":"Invalid input value for outcome."}},"description":"This request allows you to send Alpaca the result of the Onfido SDK flow in your app. A notification of a successful outcome is required for Alpaca to continue the KYC process.","requestBody":{"content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"outcome":"USER_EXITED","reason":"User denied consent","token":"header.payload.signature"}},"properties":{"outcome":{"$ref":"#/components/schemas/OnfidoSDKOutcome"},"reason":{"type":"string","description":"Any additional information related to the outcome"},"token":{"type":"string","description":"The SDK token associated with the SDK flow you are updating the outcome for"}},"required":["outcome","token"]}}}},"tags":["KYC"]}},"/v1/accounts/{account_id}/documents/w8ben/{document_id}/download":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true,"description":"The id of the related account"},{"schema":{"type":"string"},"name":"document_id","in":"path","required":true,"description":"The id of the W8BEN to download"}],"get":{"summary":"Download the W8BEN document for the primary owner of an account","tags":["Documents"],"responses":{"301":{"description":"Redirects to a presigned download link for the document PDF."},"404":{"description":"Document Not Found"}},"operationId":"get-v1-accounts-account_id-documents-w8ben-document_id-download","description":"This endpoint allows you to download a W-8 BEN document for the primary owner of an account based on the document_id passed as a path parameter. The returned document is in PDF format.\n\nFor certain individuals, a W-8 BEN form should be submitted at onboarding. If the individual is not a registered U.S. taxpayer (not subject to a W-9), the W-8 BEN form may need to be submitted. The IRS explains which individuals this applies to and provides instructions on completing the form. Every three years, in addition to the calendar year it was signed, a new W-8 BEN form must be submitted.\n\nThe form can be submitted in JSON, JSONC, PNG, JPEG or PDF. If submitting it in JSON, please see the W-8 BEN completed with the corresponding field names for the API here.\n\nNote: The dates collected on the form are in a slightly different format than how they need to be submitted via Accounts API. It is requested by the user on the form in MM-DD-YYYY, but should be submitted as YYYY-MM-DD."}},"/v1/corporate_actions/announcements/{id}":{"parameters":[{"schema":{"type":"string"},"name":"id","in":"path","required":true,"description":"The id of the corporate action announcement to be returned."}],"get":{"summary":"Retrieve a Specific Announcement","deprecated":true,"tags":["Corporate Actions"],"responses":{"200":{"description":"An Announcement object."},"400":{"description":"The body in the request is not valid"},"422":{"description":"Invalid input value."},"500":{"description":"A server error occurred. Please contact Alpaca."}},"operationId":"get-GET-v1-corporate_actions-announcements-id","description":"This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead."}},"/v1/events/nta":{"get":{"summary":"Subscribe to Non-Trading Activities Events (SSE)","tags":["Events"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonTradeActivityEvent"}}}}},"operationId":"get-v1-events-nta","description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to non-trading activities updates as they get processed by our backoffice, for both end-user and firm accounts.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nYou can listen to when NTAs are pushed such as CSDs, JNLC (journals) or FEEs.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since_ulid` required if `until_ulid` specified\n- `since`, `since_id` or `since_ulid`  can’t be used at the same time\nBehavior:\n- if `since`, `since_id` or `since_ulid` not specified this will not return any historic data\n- if `until`, `until_id` or `until_ulid` reached stream will end (status 200)'","parameters":[{"schema":{"type":"string"},"in":"query","name":"id"},{"schema":{"type":"string","format":"date"},"in":"query","name":"since","description":"Format: YYYY-MM-DD"},{"schema":{"type":"string","format":"date"},"in":"query","name":"until","description":"Format: YYYY-MM-DD"},{"schema":{"type":"integer"},"in":"query","name":"since_id"},{"schema":{"type":"integer"},"in":"query","name":"until_id"},{"name":"since_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"schema":{"type":"boolean"},"in":"query","name":"include_preprocessing"},{"name":"group_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"ID used to link activities who share a sibling relationship"}]}},"/v1/transfers/jit/reports":{"get":{"summary":"Retrieve JIT Reports","tags":["Funding"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JITReport"}}}}},"operationId":"get-v1-transfers-jit-reports","parameters":[{"name":"report_type","in":"query","required":true,"schema":{"type":"string","enum":["detail","net_summary","net_payment","net_payment_final","gross_summary","gross_payment","gross_payment_final"]},"description":"The type of report you want to get."},{"name":"system_date","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"Date of file generation."},{"name":"asset_class","in":"query","schema":{"type":"string","enum":["us_equity","crypto"]},"description":"The asset class to retrieve for."}],"description":"Returns all JIT reports"}},"/v1/transfers/jit/limits":{"get":{"summary":"Retrieve Daily Trading Limits","tags":["Funding"],"responses":{"200":{"description":"Returns the JIT Securities Daily Trading Limit Object based off of real time calculations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyTradingLimit"}}}}},"operationId":"get-v1-transfers-jit-limits","description":"The JIT Securities daily trading limit is set at the correspondent level and is used as the limit for the total amount due to Alpaca on the date of settlement. The limit in use returns the real time usage of this limit and is calculated by taking the net of trade and non-trade activity inflows and outflows. If the limit in use reaches the daily net limit, further purchasing activity will be halted, however, the limit can be adjusted by reaching out to Alpaca with the proposed new limit and the reason for the change."}},"/v1/transfers/jit/ledgers":{"get":{"summary":"Retrieve JIT Ledgers","tags":["Funding"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JITLedgerAccount"}}}}}},"operationId":"get-v1-transfers-jit-ledgers","description":"Returns an array of objects that correspond to each ledger account, each of whichcontain the following attributes."}},"/v1/transfers/jit/{ledger_id}/balances":{"get":{"summary":"Retrieve JIT Ledger Balances","tags":["Funding"],"parameters":[{"name":"ledger_id","schema":{"type":"string"},"in":"path","required":true},{"name":"start_date","in":"query","schema":{"type":"string","format":"date"},"description":"The start date (inclusive) of the ledgerbalances and activities."},{"name":"end_date","in":"query","schema":{"type":"string","format":"date"},"description":"The end date (inclusive) of the ledgerbalances and activities."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","x-stoplight":{"id":"i93oh1b7w2em9"},"description":"The ledger ID"},"ledger_no":{"type":"string","x-stoplight":{"id":"ybo7l8ty2z4ba"},"description":"The ledger account number"},"ledger_name":{"type":"string","x-stoplight":{"id":"g2430brqomb76"},"description":"The ledger name"},"transactions":{"type":"array","x-stoplight":{"id":"7jnr31tbri9l0"},"items":{"$ref":"#/components/schemas/Transaction"}},"starting_balance":{"type":"string","x-stoplight":{"id":"19ncib5wve17o"},"description":"Ledger balance at the beginning of the date range","format":"decimal"},"ending_balance":{"type":"string","x-stoplight":{"id":"etolgr1qisrz5"},"description":"Ledger balance at the end of the date range","format":"decimal"},"activity_amount":{"type":"string","x-stoplight":{"id":"eon4dv0x49fvs"},"description":"The number of transactions related to the ledger during the specified date range ","format":"decimal"}}}}}}},"operationId":"get-v1-transfers-jit-ledger_id-balances","description":"Returns an array of objects that correspond to each ledger account."}},"/v1/journals/reverse_batch":{"post":{"summary":"Create a Reverse Batch Journal Transaction (Many-to-One)","tags":["Journals"],"operationId":"post-v1-journals-reverse_batch","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchJournalResponse"}}}}},"400":{"description":"Invalid Request Body"},"403":{"description":" Insufficient Balance (JNLC) or Insufficient Assets (JNLS)"},"404":{"description":"Account not found"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseBatchJournalRequest"}}}},"description":"You can also create a batch journal request by using the following endpoint. This is enabled on JNLC for now only.\n\nNote that if there is an invalid account_id the whole batch operation will be canceled.\nEvery single request must be valid for the entire batch operation to succeed.\n\nIn the case of a successful request, the response will contain an array of journal objects with an extra attribute error_message in the case when a specific account fails to submit a journal."}},"/v1beta1/logos/{symbol}":{"parameters":[{"schema":{"type":"string"},"name":"symbol","in":"path","required":true,"description":"Stock or crypto symbol (e.g. AAPL, BTCUSD, etc.)"}],"get":{"summary":"Get Logo","tags":["Logos"],"responses":{"200":{"description":"The API response will return the raw image as a binary"}},"operationId":"get-v1beta1-logos-symbol","description":"Alpaca’s Logo API serves uniform logo images for select stock and crypto symbols.\n\nNote: For Logo API pricing details, reach out to sales@alpaca.markets\n\nThe API response will return the raw image as a binary","parameters":[{"schema":{"type":"string"},"in":"query","name":"placeholder","description":"True by default, will return sample placeholder images with the first letter of the asset symbol. If false, 404 will be returned for symbols which do not contain an image."}]}},"/v1/reporting/eod/aggregate_positions":{"get":{"summary":"Retrieve Aggregate Positions","tags":["Reporting"],"responses":{"200":{"description":"Array of objects, each object pertains to the date specified in the request and a unique asset. See parameters below. Notes: Returns an empty array for non-trading days, assets with no positions are omitted.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AggregatePositionResponse"}}}}}},"operationId":"get-v1-reporting-eod-aggregate_positions","description":"This API endpoint provides reporting data to partners for aggregate common stock and crypto positions across their account base. Partners can view historical snapshots of their holding across their entire account base. Please note that this API utilizes an 8:00 pm (EST) cutoff which aligns with the end of the Securities extended hours trading session as well as Alpaca’s 24 hour Crypto trading window. Additionally, the endpoint supports indexing to help the partner efficiently filter by key information including date and symbol while being able to include or remove firm accounts.","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"“YYYY-MM-DD” format"},{"name":"symbols","in":"query","schema":{"type":"string"},"description":"Comma-separated symbols. If populated, then only the specified symbols will be returned. If null, then all symbols will be included in the response."},{"name":"firm_accounts","in":"query","schema":{"type":"string"},"description":"Defaults to True which includes firm accounts. Passing False will exclude all firm accounts."}]}},"/v1/reporting/eod/positions":{"get":{"summary":"Retrieve EOD Positions","tags":["Reporting"],"responses":{"200":{"description":"Successful response containing the end-of-day positions for the specified accounts.","content":{"application/json":{"schema":{"type":"object","properties":{"asof":{"type":"string","format":"date","description":"The date of the snapshot in the 'YYYY-MM-DD' format."},"positions":{"type":"object","description":"A detailed map of account IDs to their respective positions.","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/Position"}}},"next_page_token":{"$ref":"#/components/schemas/NextPageToken"}}}}}},"422":{"description":"This can be returned if the asof param does not match the latest snap available at Alpaca."}},"operationId":"get-v1-reporting-eod-positions","description":"This API retrieves a comprehensive list of end-of-day positions for all accounts. End-of-day (EOD) positions are typically accessible after 4:00 am Eastern Time (ET) on the following day, providing a comprehensive view of the day's closing positions across all accounts.\nThis API currently only supports retrieving EOD positions for the last trading date.","parameters":[{"name":"account_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"Filter the results by account_id (optional)."},{"name":"asset","in":"query","schema":{"type":"string"},"description":"Filter the results by asset ID or symbol (optional)."},{"name":"asof","in":"query","schema":{"type":"string","format":"date"},"description":"The positions date in 'YYYY-MM-DD' format. It's recommended to provide this parameter when the 'page' parameter is specified, to ensure precise data retrieval based on the desired date.\nOnly previous trading date is supported."},{"$ref":"#/components/parameters/PageToken"},{"name":"limit","in":"query","schema":{"type":"integer"},"description":"The number of accounts to display per page (default=1000, max=10000)."}]}},"/v1/trading/accounts/{account_id}/orders/estimation":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true}],"post":{"summary":"Estimate an Order","tags":["Trading"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}},"operationId":"get-v1-trading-accounts-account_id-orders-estimation","description":"Order estimation endpoint will display, based on user’s account balance, the estimated quantity and price they will receive for their notional order.\n\nFor LCT - customer’s order will include the Alpaca swap_fee, while correspondent side swap_fee is configurable in the API call. Utilising this API does not result in a real order and after the calculation - the user’s buying power reverts to the previous state.\n\nResponses and Errors are the same as with the Orders API\n\nPlease note that the estimation is based on the market condition at the time of submission and a live order will differ. The output should be considered indicative.\n\n**Note:** This does not support Crypto or non-market orders at this time.","requestBody":{"content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"symbol":"AAPL","side":"buy","type":"market","time_in_force":"day","notional":"40","swap_fee_bps":45}},"properties":{"symbol":{"type":"string"},"side":{"$ref":"#/components/schemas/OrderSide"},"type":{"$ref":"#/components/schemas/OrderType"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"notional":{"type":"string"},"swap_fee_bps":{"type":"integer"}}}}}}}},"/v1/accounts/positions":{"get":{"summary":"Bulk Fetch All Accounts Positions","deprecated":true,"tags":["Trading"],"responses":{"200":{"description":"The response contains two fields:\n\nasof: the timestamp for which the positions are returned. It is always the last market close\n\npositions: an account-id to position list map, contains the requested page’s accounts\nThe positions map is empty for the last page.\n\nNote: when fetching bulk positions, which can take multiple minutes depending on the number of accounts managed have, a market close can happen, and after that a new set of results might be returned. To make sure results are consistent, please always check that the as_of field didn’t change during the whole fetching process.","content":{"application/json":{"schema":{"type":"object","properties":{"as_of":{"type":"string","x-stoplight":{"id":"4nvwcf6eps5vb"},"format":"date-time"},"positions":{"type":"object","x-stoplight":{"id":"yluo5l5ya9i7u"}}}},"examples":{"Example 1":{"value":{"as_of":"2022-08-04T16:00:00-04:00","positions":{"000c8a47-7487-430b-94e1-e628a71cd123":[{"asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","symbol":"AAPL","exchange":"NASDAQ","asset_class":"us_equity","asset_marginable":true,"qty":"0.079145874","avg_entry_price":"172.34","side":"long","market_value":"13.14850404762","cost_basis":"13.63999992516","unrealized_pl":"-0.49149587754","unrealized_plpc":"-0.0360334223047464","unrealized_intraday_pl":"0","unrealized_intraday_plpc":"0","current_price":"166.13","lastday_price":"166.13","change_today":"0","qty_available":"0.079145874"}]}}}}}}}},"operationId":"get-v1-accounts-positions","description":"Retrieves a list of the account’s open positions.\nThis endpoint is deprecated and will be removed in the future. Please use the [GET /v1/reporting/eod/positions endpoint](https://docs.alpaca.markets/reference/get-v1-reporting-eod-positions-1) instead.\n","parameters":[{"name":"page","in":"query","schema":{"type":"integer"},"description":"The number of the page of the results to be fetched."}]}},"/v1/trading/accounts/{account_id}/account/portfolio/history":{"get":{"tags":["Portfolio History"],"summary":"Get Account Portfolio History","parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true},{"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":"get-v1-trading-accounts-account_id-account-portfolio-history","description":"Returns timeseries data about equity and profit/loss (P/L) of the account in requested timespan."}},"/v1/trading/accounts/{account_id}/watchlists/{watchlist_id}/{symbol}":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true,"description":"Account identifier."},{"schema":{"type":"string"},"name":"watchlist_id","in":"path","required":true,"description":"The Watchlist ID"},{"schema":{"type":"string"},"name":"symbol","in":"path","required":true,"description":"The symbol "}],"delete":{"summary":"Remove a Symbol from a Watchlist","tags":["Watchlist"],"operationId":"delete-DELETE-v1-trading-accounts-account_id-watchlists-watchlist_id-symbol","responses":{"200":{"description":"OK"},"404":{"description":"The requested watchlist is not found"}},"description":"Delete one entry for an asset by symbol name"}},"/v1/trading/accounts/{account_id}/account/configurations":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true}],"patch":{"summary":"Update Trading Configurations for an Account","tags":["Trading"],"operationId":"patch-PATCH-v1-trading-accounts-account_id-account-configurations","responses":{"200":{"description":"Response will contain the account configuration settings for the account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}}}},"description":"You can also set the margin settings for your users’ account by passing a PATCH request. By default any account with funds under $2,000 is set a margin multiplier of 1.0, and accounts with over $2,000 are set to 2.0.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}}}}},"/v1/rebalancing/portfolios":{"get":{"summary":"List Portfolios","tags":["Rebalancing"],"responses":{"200":{"description":"Array of Portfolios","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Portfolio"}}}}}},"operationId":"get-v1-rebalancing-portfolios","description":"Lists portfolios.\n\nWhen more than one query parameter is passed, only portfolios meeting all provided values will be returned (logical AND between parameter values).","parameters":[{"schema":{"type":"string"},"in":"query","name":"name","description":"Name of portfolio"},{"schema":{"type":"string"},"in":"query","name":"description","description":"Description of portfolio"},{"schema":{"type":"string"},"in":"query","name":"symbol","description":"Symbol included in portfolio"},{"schema":{"type":"string"},"in":"query","name":"portfolio_id","description":"Portfolio ID"},{"schema":{"type":"string","enum":["active","inactive","needs_adjustment"]},"in":"query","name":"status","description":"Portfolio Status"}]},"post":{"summary":"Create Portfolio","tags":["Rebalancing"],"operationId":"post-v1-rebalancing-portfolios","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}}},"description":"Creates a portfolio allocation containing securities and/or cash. Having no rebalancing conditions is allowed but the rebalance event would need to be triggered manually. Portfolios created with API may have multiple rebalance_conditions, but only one of type calendar.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","x-stoplight":{"id":"fsltdl41ae1xd"},"description":"Name of portfolio"},"description":{"type":"string","x-stoplight":{"id":"o0u18pq91rr58"},"description":"Text to describe portfolio"},"weights":{"type":"array","x-stoplight":{"id":"eg3up2qlst7yz"},"description":"Weight configuration to portfolio. Sum of “percent” values in the weights array must be 100.00","items":{"$ref":"#/components/schemas/PortfolioWeights"}},"cooldown_days":{"type":"integer","x-stoplight":{"id":"cx9wgk8f71ipb"},"description":"Count of calendar days following a rebalance before a subscription is eligible to trigger another rebalance"},"rebalance_conditions":{"type":"array","x-stoplight":{"id":"y1tx9a759snoo"},"description":"Rebalancing conditions for portfolio","items":{"$ref":"#/components/schemas/RebalancingConditions"}}}}}},"description":""}}},"/v1/rebalancing/portfolios/{portfolio_id}":{"parameters":[{"schema":{"type":"string"},"name":"portfolio_id","in":"path","required":true,"description":"The Portfolio ID"}],"get":{"summary":"Get Portfolio by ID","tags":["Rebalancing"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}}},"operationId":"get-v1-rebalancing-portfolios-portfolio_id","description":"Get a portfolio by its ID."},"patch":{"summary":"Update Portfolio by ID","tags":["Rebalancing"],"operationId":"patch-v1-rebalancing-portfolios-portfolio_id","responses":{"200":{"description":"The updated portfolio","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}}},"description":"Updates a portfolio. If weights or conditions are changed, all subscribed accounts will be evaluated for rebalancing at the next opportunity (normal market hours). If a cooldown is active on the portfolio, the rebalancing will occur after the cooldown expired.","requestBody":{"content":{"application/json":{"schema":{"required":["cooldown_days"],"type":"object","properties":{"name":{"type":"string","x-stoplight":{"id":"7fuld928yxavq"},"description":"Used to update portfolio name."},"description":{"type":"string","x-stoplight":{"id":"8jk2p1rddsjkf"},"description":"Used to update portfolio description."},"weights":{"x-stoplight":{"id":"wgbbes9sen8w6"},"type":"array","description":"Used to update portfolio weights.","items":{"$ref":"#/components/schemas/PortfolioWeights"}},"rebalancing_conditions":{"type":"array","x-stoplight":{"id":"f8fw54c4u1hb4"},"description":"Used to update portfolio conditions.","items":{"$ref":"#/components/schemas/RebalancingConditions"}},"cooldown_days":{"type":"integer","x-stoplight":{"id":"zijb6bfo981m5"},"description":"Used to update portfolio cooldown days."}}}}}}},"delete":{"summary":"Inactivate Portfolio By ID","tags":["Rebalancing"],"operationId":"delete-v1-rebalancing-portfolios-portfolio_id","responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request"},"422":{"description":"Unprocessable Entity "}},"description":"Sets a portfolio to “inactive”, so it can be filtered out of the list request. Only permitted if there are no active subscriptions to this portfolio and this portfolio is not a listed in the weights of any active portfolios.\n\nInactive portfolios cannot be linked in new subscriptions or added as weights to new portfolios."}},"/v1/rebalancing/subscriptions":{"get":{"summary":"List All Subscriptions","tags":["Rebalancing"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioSubscription"}}}}}},"operationId":"get-v1-rebalancing-subscriptions","description":"Lists subscriptions","parameters":[{"schema":{"type":"string"},"in":"query","name":"account_id","description":"Any subscriptions for this account_id will be returned"},{"schema":{"type":"string"},"in":"query","name":"portfolio_id","description":"Portfolio ID"},{"schema":{"type":"string"},"in":"query","name":"page_token","description":"Pagination token"},{"schema":{"type":"string"},"in":"query","name":"limit","description":"Max number of subscriptions to return per page"}]},"post":{"summary":"Create Subscription","tags":["Rebalancing"],"operationId":"post-v1-rebalancing-subscriptions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioSubscription"}}}}},"description":"Creates a subscription between an account and a portfolio.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","x-stoplight":{"id":"org99c0oum746"},"description":"Account ID. Account must be active and the account must not have any active subscriptions already (only 1 is permitted at a time)"},"portfolio_id":{"type":"string","x-stoplight":{"id":"7ybyckn6mlpcf"},"description":"Portfolio ID. Portfolio must be active"}}}}},"description":""}}},"/v1/rebalancing/subscriptions/{subscription_id}":{"parameters":[{"schema":{"type":"string"},"name":"subscription_id","in":"path","required":true}],"get":{"summary":"Get Subscription by ID","tags":["Rebalancing"],"responses":{"200":{"description":"The portfolio subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioSubscription"}}}}},"operationId":"get-v1-rebalancing-subscriptions-subscription_id","description":"Get a subscription by its ID."},"delete":{"summary":"Unsubscribe Account (Delete Subscription)","tags":["Rebalancing"],"operationId":"delete-v1-rebalancing-subscriptions-subscription_id","responses":{"204":{"description":"No Content"}},"description":"Deletes the subscription which stops the rebalancing of an account."}},"/v1/rebalancing/runs":{"get":{"summary":"List All Runs","tags":["Rebalancing"],"responses":{"200":{"description":"The runs which match the query","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioRun"}}}}}},"operationId":"get-v1-rebalancing-runs","description":"Lists runs.","parameters":[{"schema":{"type":"string"},"in":"query","name":"account_id","description":"Any runs for this account_id will be returned"},{"schema":{"type":"string"},"in":"query","name":"status","description":"Status of portfolio run to filter by"},{"schema":{"type":"string"},"in":"query","name":"type","description":"Type of portfolio run (full_rebalance, invest_cash)"},{"schema":{"type":"string"},"in":"query","name":"page_token","description":"Pagination token"},{"schema":{"type":"string"},"in":"query","name":"limit","description":"Max number of runs to return per page"}]},"post":{"summary":"Create Run (Manual rebalancing event)","tags":["Rebalancing"],"operationId":"post-v1-rebalancing-runs","responses":{"200":{"description":"OK"}},"description":"Manually creates a run.\n\nThe determination of a run’s orders and the execution of a run take place during normal market hours\n\nRuns can be initiated either by the system (when the system evaluates the rebalance conditions specified at the portfolio level) or by API call (manual run creation using POST /v1/rebalancing/runs). Runs can be initiated manually outside of the normal market hours but will remain in the QUEUED status until normal market hours\n\nOnly 1 run in a non-terminal status is allowed at any time.\n\nManually executing a run is currently only allowed for accounts who do not have an active subscription.","requestBody":{"content":{"application/json":{"schema":{"type":"object","x-examples":{"Example 1":{"account_id":"bf2b0f93-f296-4276-a9cf-288586cf4fb7","type":"full_rebalance","weights":[{"type":"asset","symbol":"AAPL","percent":"35"},{"type":"asset","symbol":"TSLA","percent":"20"},{"type":"asset","symbol":"SPY","percent":"45"}]}},"properties":{"account_id":{"type":"string","description":"The account to create the run for."},"type":{"type":"string","description":"`full_rebalance` or `invest_cash`"},"weights":{"$ref":"#/components/schemas/PortfolioWeights"}}}}}}}},"/v1/rebalancing/runs/{run_id}":{"parameters":[{"schema":{"type":"string"},"name":"run_id","in":"path","required":true,"description":"the id of the portfolio run"}],"get":{"summary":"Get Run by ID","tags":["Rebalancing"],"responses":{"200":{"description":"The run object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioRun"}}}}},"operationId":"get-v1-rebalancing-runs-run_id","description":"Get a run by its ID."},"delete":{"summary":"Cancel Run by ID","tags":["Rebalancing"],"operationId":"delete-v1-rebalancing-runs-run_id","responses":{"204":{"description":"No Content"}},"description":"Cancels a run. Only runs within certain statuses (QUEUED, CANCELED, SELLS_IN_PROGRESS, BUYS_IN_PROGRESS) are cancelable. If this endpoint is called after orders have been submitted, we’ll attempt to cancel the orders."}},"/v1/accounts/{account_id}/actions/close":{"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true,"description":"The id of the account to be closed"}],"post":{"summary":"Close an Account","tags":["Accounts"],"operationId":"post-v1-accounts-account_id-actions-close","responses":{"204":{"description":"Success"},"404":{"description":"Account Not Found"}},"description":"This operation closes an active account. The underlying records and information of the account are not deleted by this operation.\n\n**Before closing an account, you are responsible for closing all the positions and withdrawing all the money associated with that account. Learn more in the Positions Documentation.**"}},"/v1/accounts/{account_id}/wallets":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"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"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{account_id}/wallets/transfers":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"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"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"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"}}}}}}},"/v1/accounts/{account_id}/wallets/transfers/{transfer_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"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"}}}}}}},"/v1/accounts/{account_id}/wallets/whitelists":{"parameters":[{"$ref":"#/components/parameters/AccountID"}],"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"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"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"}}}}}}},"/v1/accounts/{account_id}/wallets/whitelists/{whitelisted_address_id}":{"parameters":[{"$ref":"#/components/parameters/AccountID"},{"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"}}}},"/v1/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"}}}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/trading/accounts/{account_id}/limits":{"get":{"summary":"Retrieve real-time Trading Limits for an Account","tags":["Trading"],"parameters":[{"schema":{"type":"string"},"name":"account_id","in":"path","required":true}],"responses":{"200":{"description":"Returns the trading limit set for the account and the real-time usage of the limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountTradingLimit"}}}},"404":{"description":"Returned when the account is not configured for trading limits"}},"operationId":"get-v1-account-trading-limits","description":"This endpoint is only available to accounts with the trading limits feature enabled, and not on JIT.\nThe daily trading limit is set at the correspondent level (or the account level) and is used as the limit for the total amount due to Alpaca on the date of settlement.\nThe limit in use returns the real time usage of this limit, based on the setup it uses the usage is calculated differently.\nIf the limit in use reaches the `daily_net_limit` or `available` is zero, further purchasing activity will be halted, however, the limit can be adjusted by reaching out to Alpaca with the proposed new limit and the reason for the change."}},"/v1/instant_funding":{"get":{"summary":"Get Instant Funding List","description":"Returns a list of instant funding records based on the query parameters. The results are\npaginated, sorted, and filtered based on the parameters provided.","operationId":"get-v1-instant-funding-list","tags":["Instant Funding"],"parameters":[{"name":"sort_by","in":"query","description":"sort results based on created_at, amount, and deadline","required":false,"schema":{"$ref":"#/components/schemas/ListSortBy"}},{"name":"sort_order","description":"Defines the ordering of sort_by query. Defaults to ASC when not specified.","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortOrder"}},{"name":"limit","description":"defines the number of results that will be returned from the request","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"offset","description":"defines the number of results that will be skipped before picking the results that will be returned","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"system_date","in":"query","description":"filter transfers based on system date","required":false,"schema":{"type":"string","format":"date"}},{"name":"deadline","in":"query","description":"filter transfers based on settlement deadline","required":false,"schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"filter transfers based on status","required":false,"schema":{"$ref":"#/components/schemas/InstantFundingStatus"}},{"name":"before","in":"query","description":"filter transfers based on the date of creation","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"list of transfers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InstantFunding"}}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an intant funding request","description":"Creates an instant funding request. The request will be processed and the funds will be\nmade available to the account in the form of a Memopost non trade activity. Upon settlement\nthe Memoposted will be corrected to a CSD activity.","operationId":"post-v1-instant-funding","tags":["Instant Funding"],"requestBody":{"description":"details of the instant funding request","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIFTransferRequest"}}}},"responses":{"200":{"description":"Instant transfer request created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstantFunding"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/instant_funding/{instant_funding_id}":{"get":{"summary":"Get an instant funding request","description":"Returns an instant funding transfer based on the ID supplied.","operationId":"get-v1-instant-funding-single","tags":["Instant Funding"],"parameters":[{"name":"instant_funding_id","in":"path","description":"ID of the instant funding transfer","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstantFunding"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"description":"Cancels a single instant funding request based on the ID supplied if possible.","summary":"Cancel an instant funding request","operationId":"delete-v1-instant-funding-single","tags":["Instant Funding"],"parameters":[{"name":"instant_funding_id","in":"path","description":"UUID ID of the instant funding transfer to cancel","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Successful response."},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/instant_funding/settlements":{"get":{"summary":"List settlements","description":"Returns all settlements filtered by status if provided.","operationId":"get-v1-instant-funding-settlements","tags":["Instant Funding"],"parameters":[{"name":"statuses","in":"query","description":"comma delimited list of statuses to use as a filter","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementsResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a new settlement","description":"Creates a new settlement, which will trigger the reconciliation process for all included\ntransfers and their interests.","operationId":"post-v1-instant-funding-settlements","tags":["Instant Funding"],"requestBody":{"description":"details of the settlement request","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSettlementRequest"}}}},"responses":{"200":{"description":"Settlement created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/instant_funding/settlements/{settlement_id}":{"get":{"summary":"Get a single settlement","description":"Returns the settlement specified by the path parameter.","operationId":"get-v1-instant-funding-settlements-single","tags":["Instant Funding"],"parameters":[{"name":"settlement_id","in":"path","description":"ID of the settlement","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/instant_funding/limits":{"get":{"description":"Returns globally configured limits for the correspondent. These limits are used to determine\nthe maximum amount that can be extended to all accounts, and reaching this limit will result\nin further requests to create instant funding requests being rejected.","summary":"Get instant funding limits","operationId":"get-v1-instant-funding-correspondent-limits","tags":["Instant Funding"],"responses":{"200":{"description":"correspondent instant funding limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrespondentLimit"}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/instant_funding/limits/accounts":{"get":{"description":"Returns the limits for individual partner accounts.","summary":"Get instant funding account limits","operationId":"get-v1-instant-funding-account-limits","tags":["Instant Funding"],"parameters":[{"name":"account_numbers","in":"query","description":"filter limits based on comma separated account_numbers","required":true,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"invidual broker account limits","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountLimit"}}}}},"default":{"description":"error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/instant_funding/reports":{"get":{"description":"Returns instant funding reports which are to be used for daily reconciliation reporting.","summary":"Get instant funding report","operationId":"get-v1-instant-funding-reports","tags":["Instant Funding"],"parameters":[{"name":"report_type","in":"query","description":"The report type to be returned; 'summary' or 'detail', defaults to 'summary'","required":false,"schema":{"type":"string"}},{"name":"system_date","in":"query","description":"The system date to be used for the report. If not provided then the last system date will be used.\n","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportsResponse"}}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jit/settlements":{"get":{"description":"Returns all JIT settlements filtered by status if provided.","summary":"List all JIT Settlements","operationId":"get-v1-jit-settlements","tags":["Funding"],"parameters":[{"name":"statuses","in":"query","description":"comma delimited list of statuses to use as a filter","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementsResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a new JIT settlement","description":"Creates a new JIT settlement, which will trigger the reconciliation process for all included accounts.\n","operationId":"post-v1-jit-settlements","tags":["Funding"],"requestBody":{"description":"details of the JIT settlement request","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJITSettlementRequest"}}}},"responses":{"200":{"description":"Settlement created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jit/settlements/{settlement_id}":{"get":{"summary":"Get a single JIT settlement","description":"Returns the JIT settlement specified by the path parameter.","operationId":"get-v1-jit-settlements-single","tags":["Funding"],"parameters":[{"name":"settlement_id","in":"path","description":"ID of the JIT settlement","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementResponse"}}}},"default":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cash_interest/apr_tiers":{"get":{"summary":"List APR Tiers","description":"List all available APR tiers. These tiers may be assigned to an account, and will be used to determine the interest rate paid on uninvested cash balances.","operationId":"get-v1-list-apr-tiers","tags":["Cash Interest"],"responses":{"200":{"description":"Successful response, returns a list of APR tiers or none if no tiers are available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAPRTiersResponse"}}}},"401":{"description":"Unauthorized. Please check your API key and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Please wait a moment and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"A server error occurred. Please contact Alpaca.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reporting/eod/cash_interest":{"get":{"summary":"Retrieve EOD Cash Interest Details","description":"This API retrieves a list of cash interest details for the given date(s) for a single account or all accounts. End-of-day (EOD) details are typically accessible after 8:00pm Eastern Time (ET) and reflect that day’s ending state across cash balances, accrued interest, accrued fees, as well as additional ancillary details.","operationId":"get-v1-get-eod-cash-interest-report","tags":["Reporting","Cash Interest"],"parameters":[{"name":"account_id","in":"query","description":"Account globally unique identifier. If not provided, the report will be generated for all accounts.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","description":"A date in the format YYYY-MM-DD. If not provided, the report will be generated for the most recent date this report is available.","required":false,"schema":{"type":"string","format":"date"}},{"name":"after","in":"query","description":"A date in the format YYYY-MM-DD, valid only if account_id is provided and date is not provided. If not provided, this will use `before` value. If neither is provided the most recent available date is used for both `before` and `after`.","required":false,"schema":{"type":"string","format":"date"}},{"name":"before","in":"query","description":"A date in the format YYYY-MM-DD, valid only if account_id is provided and date is not provided. If not provided, this will use the most recent available date.","required":false,"schema":{"type":"string","format":"date"}},{"name":"direction","in":"query","description":"The direction to use for sorting responses, either `asc` or `desc`. Only valid for account_id queries, for which only sorting by date is supported. Defaults to `desc`.","required":false,"schema":{"type":"string"}},{"name":"page_size","in":"query","description":"The page size, used for paginating responses. Defaults to 1000, with a maximum of 10,000.","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":1000}},{"name":"page_token","in":"query","description":"A token used to retrieve the next page for paginated queries. If provided the response will begin at the next page of the results for the response from which the `next_page_token` is used.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response, returns a list of daily interest accruals and an optional next page token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EoDCashInterestReportResponse"}}}},"400":{"description":"A client error occurred. Please check the provided request parameters and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized. Please check your API key and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Please wait a moment and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"A server error occurred. Please contact Alpaca.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/fpsl/tiers":{"get":{"summary":"List FPSL Tiers","description":"List all available FPSL tiers. These tiers may be assigned to an account.","operationId":"get-v1-list-fpsl-tiers","tags":["FPSL Program"],"responses":{"200":{"description":"Successful response, returns a list of FPSL tiers or none if no tiers are available.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FPSLTier"}}}}},"401":{"description":"Unauthorized. Please check your API key and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Please wait a moment and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"A server error occurred. Please contact Alpaca.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/fpsl/loans":{"get":{"summary":"List FPSL Loans","description":"Returns a list of all FPSL loans that match the specified filter criteria, ordered in ascending order by `date`, `account_number`, and `symbol`. Each entry represents a loan of a `symbol` on a given `date`, made on behalf of the specified `account_number`.","operationId":"get-v1-list-fpsl-loans","tags":["FPSL Program"],"parameters":[{"name":"account_id","in":"query","description":"The account identifier","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"start","in":"query","description":"Filter loans after or on this start date.","required":false,"schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Filter loans before this end date.","required":false,"schema":{"type":"string","format":"date"}},{"name":"page_token","in":"query","description":"The pagination token used to continue retrieving results. This value is returned in certain responses when additional data is available, typically due to a response size limit.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The maximum number of data points to return in the response page.","required":false,"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1000}}],"responses":{"200":{"description":"Returns a list of FPSL loans for the account, or an empty list if no loans are found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFPSLLoansResponse"}}}},"400":{"description":"One of the request parameters is invalid. See the returned message for details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FPSLError"}}}},"401":{"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FPSLError"}}}},"403":{"description":"User has no access to a resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FPSLError"}}}},"500":{"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FPSLError"}}}}}}},"/v2/events/funding/status":{"get":{"summary":"Subscribe to Funding Status Events (SSE)","tags":["Events"],"responses":{"200":{"description":"Connected. Events will now start streaming as long as you keep the connection open.","content":{"text/event-stream":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/StatusFundingEvent"}]}}}}}},"parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string","format":"date"},"description":"Format: YYYY-MM-DD"},{"name":"since_id","in":"query","schema":{"type":"integer"}},{"name":"until_id","in":"query","schema":{"type":"integer"}},{"name":"since_ulid","in":"query","schema":{"type":"string","format":"ulid"}},{"name":"until_ulid","in":"query","schema":{"type":"string","format":"ulid"}}],"operationId":"subscribeToFundingStatusSSE","description":"The Events API provides event push as well as historical queries via SSE (server sent events).\n\nYou can listen to funding status updates as they get processed by our backoffice, for both end-user and firm accounts.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery Params Rules:\n- `since` required if `until` specified\n- `since_id` required if `until_id` specified\n- `since_ulid` required if `until_ulid` specified\n- `since`, `since_id` or `since_ulid`  can’t be used at the same time\nBehavior:\n- if `since`, `since_id` or `since_ulid` not specified this will not return any historic data\n- if `until`, `until_id` or `until_ulid` reached stream will end (status 200)\n\n---\n\nNote for people using the clients generated from this OAS spec. Currently OAS-3 doesn't have full support for representing SSE style responses from an API, so if you are using a generated client and don't specify a `since` and `until` there is a good chance the generated clients will hang waiting for the response to end.\n\nIf you require the streaming capabilities we recommend not using the generated clients for this specific usecase until the OAS-3 standards come to a consensus on how to represent this correcting in OAS-3."},"parameters":[]}},"security":[{"BasicAuth":[]}],"x-readme":{"explorer-enabled":true,"proxy-enabled":false}}