Skip to main content

IbRestApiClient

Struct IbRestApiClient 

Source
pub struct IbRestApiClient {
    pub client: Client,
    pub base_url: Url,
}

Fields§

§client: Client§base_url: Url

Implementations§

Source§

impl IbRestApiClient

Source

pub fn new() -> Self

Create a client using the OpenAPI servers[0] URL.

Source

pub fn with_base_url(base_url: impl AsRef<str>) -> Result<Self>

Create a client with a custom base URL.

Source

pub fn with_client(base_url: impl AsRef<str>, client: Client) -> Result<Self>

Create a client from an existing reqwest::Client.

Source

pub async fn get_account_owners( &self, request: GetAccountOwnersRequest, ) -> Result<GetAccountOwnersResponse>

List Account Signatures And Owners

Receive a list of all applicant names on the account and for which account and entity is represented.

  • Path: GET /acesws/{accountId}/signatures-and-owners
Source

pub async fn get_trading_schedule( &self, request: GetTradingScheduleRequest, ) -> Result<GetTradingScheduleResponse>

Trading Schedule (NEW)

Returns the trading schedule for the 6 total days surrounding the current trading day. Non-Trading days, such as holidays, will not be returned.

  • Path: GET /contract/trading-schedule
Source

pub async fn get_model_presets( &self, request: GetModelPresetsRequest, ) -> Result<GetModelPresetsResponse>

Get Model Preset

Get the preset behavior for model rebalancing.

  • Path: POST /fa/fa-preset/get
Source

pub async fn set_model_presets( &self, request: SetModelPresetsRequest, ) -> Result<SetModelPresetsResponse>

Set Model Preset

Set the preset behavior for models.

  • Path: POST /fa/fa-preset/save
Source

pub async fn get_accounts_in_model( &self, request: GetAccountsInModelRequest, ) -> Result<GetAccountsInModelResponse>

Get Models Accounts

Request all accounts held within a model.

  • Path: POST /fa/model/accounts-details
Source

pub async fn set_accountinvestment_in_model( &self, request: SetAccountinvestmentInModelRequest, ) -> Result<SetAccountinvestmentInModelResponse>

Invest Account Into Model

Assign an account and the amount of cash to allocate into a model.

  • Path: POST /fa/model/invest-divest
Source

pub async fn get_invested_accounts_in_model( &self, request: GetInvestedAccountsInModelRequest, ) -> Result<GetInvestedAccountsInModelResponse>

Summary Of Accounts Invested In The Model

Request the list of all accounts already invested in the provided model and a summary of their investment.

  • Path: POST /fa/model/invest-divest-positions
Source

pub async fn get_allmodels( &self, request: GetAllmodelsRequest, ) -> Result<GetAllmodelsResponse>

Request All Models

Retrieve summaries for all models under the advisor account.

  • Path: POST /fa/model/list
Source

pub async fn get_all_model_positions( &self, request: GetAllModelPositionsRequest, ) -> Result<GetAllModelPositionsResponse>

Request Model Positions

Request all positions held within the model.

  • Path: POST /fa/model/positions
Source

pub async fn set_model_target_positions( &self, request: SetModelTargetPositionsRequest, ) -> Result<SetModelTargetPositionsResponse>

Set Model Allocations

Create or Modify a model’s target positions.

  • Path: POST /fa/model/save
Source

pub async fn submit_model_orders( &self, request: SubmitModelOrdersRequest, ) -> Result<SubmitModelOrdersResponse>

Submit Transfers

Submit all pending orders to the models. This is similar to the Model page’s Submit All Orders selection.

  • Path: POST /fa/model/submit-transfers
Source

pub async fn get_model_summary_single( &self, request: GetModelSummarySingleRequest, ) -> Result<GetModelSummarySingleResponse>

Request Model Summary

Request a summary for a single model.

  • Path: POST /fa/model/summary
Source

pub async fn get_forecast_categories( &self, request: GetForecastCategoriesRequest, ) -> Result<GetForecastCategoriesResponse>

Event Contract Categories

Returns the category names, parent ids, and markets for Event Contracts.

  • Path: GET /forecast/category/tree
Source

pub async fn get_forecast_contract( &self, request: GetForecastContractRequest, ) -> Result<GetForecastContractResponse>

Event Contract Details

Provides instrument details for the specific forecast contract.

  • Path: GET /forecast/contract/details
Source

pub async fn get_forecast_markets( &self, request: GetForecastMarketsRequest, ) -> Result<GetForecastMarketsResponse>

Provides All Contracts For Given Underlying Market.

Returns all high level contract details affiliated with the underlying market conid provided.

  • Path: GET /forecast/contract/market
Source

pub async fn get_forecast_rules( &self, request: GetForecastRulesRequest, ) -> Result<GetForecastRulesResponse>

Event Contract Rules

Provides trading rules for specific event contracts.

  • Path: GET /forecast/contract/rules
Source

pub async fn get_forecast_schedule( &self, request: GetForecastScheduleRequest, ) -> Result<GetForecastScheduleResponse>

Event Contract Schedules

Provides forecast trading schedules.

  • Path: GET /forecast/contract/schedules
Source

pub async fn get_fyi_delivery( &self, request: GetFyiDeliveryRequest, ) -> Result<GetFyiDeliveryResponse>

Get Delivery Options

Options for sending fyis to email and other devices.

  • Path: GET /fyi/deliveryoptions
Source

pub async fn modify_fyi_delivery( &self, request: ModifyFyiDeliveryRequest, ) -> Result<ModifyFyiDeliveryResponse>

Toggle Delivery To A Device

Choose whether a particular device is enabled or disabled.

  • Path: POST /fyi/deliveryoptions/device
Source

pub async fn modify_fyi_emails( &self, request: ModifyFyiEmailsRequest, ) -> Result<ModifyFyiEmailsResponse>

Toggle Email Delivery

Enable or disable your account’s primary email to receive notifications.

  • Path: PUT /fyi/deliveryoptions/email
Source

pub async fn delete_fyi_device( &self, request: DeleteFyiDeviceRequest, ) -> Result<DeleteFyiDeviceResponse>

Delete A Device

Delete a specific device from our saved list of notification devices.

  • Path: DELETE /fyi/deliveryoptions/{deviceId}
Source

pub async fn get_fyi_disclaimerss( &self, request: GetFyiDisclaimerssRequest, ) -> Result<GetFyiDisclaimerssResponse>

Get Disclaimers By FYI Type

Receive additional disclaimers based on the specified typecode.

  • Path: GET /fyi/disclaimer/{typecode}
Source

pub async fn read_fyi_disclaimer( &self, request: ReadFyiDisclaimerRequest, ) -> Result<ModifyFyiDeliveryResponse>

Mark FYI Disclaimer Read

Mark a specific disclaimer message as read.

  • Path: PUT /fyi/disclaimer/{typecode}
Source

pub async fn get_all_fyis( &self, request: GetAllFyisRequest, ) -> Result<GetAllFyisResponse>

List All Notifications

Get a list of available notifications.

  • Path: GET /fyi/notifications
Source

pub async fn read_fyi_notification( &self, request: ReadFyiNotificationRequest, ) -> Result<ReadFyiNotificationResponse>

Mark Notification Read

Mark a particular notification message as read or unread.

  • Path: PUT /fyi/notifications/{notificationID}
Source

pub async fn get_fyi_settings( &self, request: GetFyiSettingsRequest, ) -> Result<GetFyiSettingsResponse>

Get Notification Settings

Return the current choices of subscriptions for notifications.

  • Path: GET /fyi/settings
Source

pub async fn modify_fyi_notification( &self, request: ModifyFyiNotificationRequest, ) -> Result<ModifyFyiEmailsResponse>

Modify FYI Notifications

Enable or disable group of notifications by the specific typecode.

  • Path: POST /fyi/settings/{typecode}
Source

pub async fn get_unread_fyis( &self, request: GetUnreadFyisRequest, ) -> Result<GetUnreadFyisResponse>

Get Number Of Unread Notifications

Returns the total number of unread notifications

  • Path: GET /fyi/unreadnumber
Source

pub async fn get_gw_api_v1_accounts( &self, request: GetGwApiV1AccountsRequest, ) -> Result<GetGwApiV1AccountsResponse>

Retrieve Processed Application

Retrieve the application request and IBKR response data based on IBKR accountId or externalId. Only available for accounts that originate via API

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts
Source

pub async fn post_gw_api_v1_accounts( &self, request: PostGwApiV1AccountsRequest, ) -> Result<PostGwApiV1AccountsResponse>

Create Account

Submit account application. This will create brokerage account for the end user.

Scope: accounts.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/accounts
Source

pub async fn patch_gw_api_v1_accounts( &self, request: PatchGwApiV1AccountsRequest, ) -> Result<PostGwApiV1AccountsResponse>

Update Account

Update information for an existing accountId

Scope: accounts.write
Security Policy: Signed JWT

  • Path: PATCH /gw/api/v1/accounts
Source

pub async fn post_gw_api_v1_accounts_documents( &self, request: PostGwApiV1AccountsDocumentsRequest, ) -> Result<PostGwApiV1AccountsResponse>

Submit General Agreements And Disclosures

Provides mechanism to submit Agreements and Disclosures to IBKR once a day instead of with each application. We store these documents on the servers and will use them for new application requests submitted that day.

  • Documents will need to be submitted once a day (before the Applications are submitted). PDFs will be displayed and submitted as is- no changes/edits will be made to the actual PDF files.
  • This end-point will not process any Tax Form Documents. Tax Form document should be submitted with every application
  • If submitted in the morning, you only need to include the Tax Form attachment for each applicant. Otherwise, you will need to include PDFs with each application (Create Account).


Scope: accounts.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/accounts/documents
Source

pub async fn get_gw_api_v1_accounts_login_messages( &self, request: GetGwApiV1AccountsLoginMessagesRequest, ) -> Result<GetGwApiV1AccountsLoginMessagesResponse>

Get Login Messages

Query all accounts associated with ‘Client ID’ that have incomplete login message

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/login-messages
Source

pub async fn get_gw_api_v1_accounts_status( &self, request: GetGwApiV1AccountsStatusRequest, ) -> Result<GetGwApiV1AccountsStatusResponse>

Get Status Of Accounts

Query status of all accounts associated with ‘Client ID’

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/status
Source

pub async fn get_gw_api_v1_accounts_accountid_details( &self, request: GetGwApiV1AccountsAccountidDetailsRequest, ) -> Result<GetGwApiV1AccountsAccountidDetailsResponse>

Get Account Information


Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/{accountId}/details
Source

pub async fn get_gw_api_v1_accounts_accountid_kyc( &self, request: GetGwApiV1AccountsAccountidKycRequest, ) -> Result<GetGwApiV1AccountsAccountidKycResponse>

Retrieve Au10Tix URL

Generate URL address to complete real-time KYC verification using Au10Tix

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/{accountId}/kyc
Source

pub async fn get_gw_api_v1_accounts_accountid_login_messages( &self, request: GetGwApiV1AccountsAccountidLoginMessagesRequest, ) -> Result<GetGwApiV1AccountsLoginMessagesResponse>

Get Login Message By Account

Query login messages assigned by accountId

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/{accountId}/login-messages
Source

pub async fn get_gw_api_v1_accounts_accountid_status( &self, request: GetGwApiV1AccountsAccountidStatusRequest, ) -> Result<GetGwApiV1AccountsAccountidStatusResponse>

Get Status By Account

Query status of account by accountId

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/{accountId}/status
Source

pub async fn patch_gw_api_v1_accounts_accountid_status( &self, request: PatchGwApiV1AccountsAccountidStatusRequest, ) -> Result<GetGwApiV1AccountsAccountidStatusResponse>

Update Status By Account

Query status of account by accountId

Scope: accounts.write
Security Policy: Signed JWT

  • Path: PATCH /gw/api/v1/accounts/{accountId}/status
Source

pub async fn get_gw_api_v1_accounts_accountid_tasks( &self, request: GetGwApiV1AccountsAccountidTasksRequest, ) -> Result<GetGwApiV1AccountsAccountidTasksResponse>

Get Registration Tasks

Query registration tasks assigned to account and pending tasks that are required for account approval

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/accounts/{accountId}/tasks
Source

pub async fn post_gw_api_v1_accounts_accountid_tasks( &self, request: PostGwApiV1AccountsAccountidTasksRequest, ) -> Result<PostGwApiV1AccountsAccountidTasksResponse>

Assign Tasks

Task can be assigned from this api

Scope: accounts.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/accounts/{accountId}/tasks
Source

pub async fn patch_gw_api_v1_accounts_accountid_tasks( &self, request: PatchGwApiV1AccountsAccountidTasksRequest, ) -> Result<PostGwApiV1AccountsAccountidTasksResponse>

Update Tasks Status

Task status can be updated from this api

Scope: accounts.write
Security Policy: Signed JWT

  • Path: PATCH /gw/api/v1/accounts/{accountId}/tasks
Source

pub async fn post_gw_api_v1_balances_query( &self, request: PostGwApiV1BalancesQueryRequest, ) -> Result<PostGwApiV1BalancesQueryResponse>

View Cash Balances

View available cash for withdrawal and account equity value by accountId

Scope: balances.read
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/balances/query
Source

pub async fn post_gw_api_v1_bank_instructions( &self, request: PostGwApiV1BankInstructionsRequest, ) -> Result<PostGwApiV1BankInstructionsResponse>

Manage Bank Instructions

Create or delete bank instructions by accountId. Only ACH and EDDA are supported for ‘Create’.

Scope: bank-instructions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/bank-instructions
Source

pub async fn post_gw_api_v1_bank_instructions_query( &self, request: PostGwApiV1BankInstructionsQueryRequest, ) -> Result<PostGwApiV1BankInstructionsQueryResponse>

View Bank Instructions

View active bank instructions for an accountId.

Scope: bank-instructions.read
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/bank-instructions/query
Source

pub async fn post_gw_api_v1_bank_instructions_bulk( &self, request: PostGwApiV1BankInstructionsBulkRequest, ) -> Result<PostGwApiV1BankInstructionsBulkResponse>

Creates Multiple Banking Instructions(ach, Delete, Micro-amount, Predefined-destination-instruction)


Scope: bank-instructions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/bank-instructions:bulk
Source

pub async fn get_gw_api_v1_client_instructions_clientinstructionid( &self, request: GetGwApiV1ClientInstructionsClientinstructionidRequest, ) -> Result<GetGwApiV1InstructionsInstructionidResponse>

Get Status For ClientInstructionId

Retrieve status of request by clientInstructionId.

Scope: instructions.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/client-instructions/{clientInstructionId}
Source

pub async fn get_gw_api_v1_echo_https( &self, request: GetGwApiV1EchoHttpsRequest, ) -> Result<GetGwApiV1EchoHttpsResponse>

Echo A Request With HTTPS Security Policy Back After Validation.


Scope: echo.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/echo/https
Source

pub async fn post_gw_api_v1_echo_signed_jwt( &self, request: PostGwApiV1EchoSignedJwtRequest, ) -> Result<GetGwApiV1EchoHttpsResponse>

Echo A Request With Signed JWT Security Policy Back After Validation.


Scope: echo.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/echo/signed-jwt
Source

pub async fn get_gw_api_v1_enumerations_complex_asset_transfer( &self, request: GetGwApiV1EnumerationsComplexAssetTransferRequest, ) -> Result<GetGwApiV1EnumerationsComplexAssetTransferResponse>

Get A List Of Participating Brokers For The Given Asset Type

Get list of brokers supported for given asset transfer type

Scope: enumerations.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/enumerations/complex-asset-transfer
Source

pub async fn get_gw_api_v1_enumerations_enumerationtype( &self, request: GetGwApiV1EnumerationsEnumerationtypeRequest, ) -> Result<GetGwApiV1EnumerationsEnumerationtypeResponse>

Get Enumerations

Used to query list of enumerations for attributes included within extPositionsTransfers, occupation, employerBusiness, financialInformation, affiliationDetails, tradingPermissions, etc.

Scope: accounts.read OR enumerations.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/enumerations/{enumerationType}
Source

pub async fn post_gw_api_v1_external_asset_transfers( &self, request: PostGwApiV1ExternalAssetTransfersRequest, ) -> Result<PostGwApiV1BankInstructionsResponse>

Transfer Positions Externally (ACATS, ATON, FOP, DWAC, Complex Asset Transfer)

Initiate request to submit external position transfer. Methods- ACATS, ATON, Basic FOP, FOP, DWAC. More information on transfer methods can be found here - https://www.interactivebrokers.com/campus/trading-lessons/cash-and-position-transfers/

Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/external-asset-transfers
Source

pub async fn post_gw_api_v1_external_asset_transfers_bulk( &self, request: PostGwApiV1ExternalAssetTransfersBulkRequest, ) -> Result<PostGwApiV1BankInstructionsBulkResponse>

Creates Multiple External Asset Transfers (Fop, DWAC And Complex Asset Transfer)


Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/external-asset-transfers:bulk
Source

pub async fn post_gw_api_v1_external_cash_transfers( &self, request: PostGwApiV1ExternalCashTransfersRequest, ) -> Result<PostGwApiV1BankInstructionsResponse>

Transfer Cash Externally

Initiate request to deposit or withdrawal between IBKR account and bank account. More information on transfer methods can be found here - https://www.interactivebrokers.com/campus/trading-lessons/cash-and-position-transfers

Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/external-cash-transfers
Source

pub async fn post_gw_api_v1_external_cash_transfers_query( &self, request: PostGwApiV1ExternalCashTransfersQueryRequest, ) -> Result<PostGwApiV1ExternalCashTransfersQueryResponse>

View Cash Balances

View available cash for withdrawal with and without margin loan by accountId

Scope: transfers.read
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/external-cash-transfers/query
Source

pub async fn post_gw_api_v1_external_cash_transfers_bulk( &self, request: PostGwApiV1ExternalCashTransfersBulkRequest, ) -> Result<PostGwApiV1BankInstructionsBulkResponse>

Creates Multiple External Cash Transfers (Deposit And Withdraw Fund)


Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/external-cash-transfers:bulk
Source

pub async fn get_gw_api_v1_forms( &self, request: GetGwApiV1FormsRequest, ) -> Result<GetGwApiV1FormsResponse>

Get Forms

Get forms

Scope: accounts.read OR forms.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/forms
Source

pub async fn get_gw_api_v1_forms_required_forms( &self, request: GetGwApiV1FormsRequiredFormsRequest, ) -> Result<GetGwApiV1FormsRequiredFormsResponse>

Get Required Forms

Get required forms

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/forms/required-forms
Source

pub async fn get_gw_api_v1_instruction_sets_instructionsetid( &self, request: GetGwApiV1InstructionSetsInstructionsetidRequest, ) -> Result<GetGwApiV1InstructionSetsInstructionsetidResponse>

Get Status For InstructionSetId

Retrieve status of all requests associated with instructionSetId.

Scope: instructions.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/instruction-sets/{instructionSetId}
Source

pub async fn post_gw_api_v1_instructions_cancel( &self, request: PostGwApiV1InstructionsCancelRequest, ) -> Result<PostGwApiV1InstructionsCancelResponse>

Cancel Request

Cancel request by instructionId.

Scope: instructions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/instructions/cancel
Source

pub async fn post_gw_api_v1_instructions_cancel_bulk( &self, request: PostGwApiV1InstructionsCancelBulkRequest, ) -> Result<PostGwApiV1BankInstructionsBulkResponse>

Creates Multiple Cancel Instructions


Scope: instructions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/instructions/cancel:bulk
Source

pub async fn post_gw_api_v1_instructions_query( &self, request: PostGwApiV1InstructionsQueryRequest, ) -> Result<PostGwApiV1BankInstructionsResponse>

Get Transaction History

Query list of recent transactions (up to 30 days) based on accountId.

Scope: instructions.read
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/instructions/query
Source

pub async fn get_gw_api_v1_instructions_instructionid( &self, request: GetGwApiV1InstructionsInstructionidRequest, ) -> Result<GetGwApiV1InstructionsInstructionidResponse>

Get Status For InstructionId

Retrieve status of request by instructionId

Scope: instructions.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/instructions/{instructionId}
Source

pub async fn post_gw_api_v1_internal_asset_transfers( &self, request: PostGwApiV1InternalAssetTransfersRequest, ) -> Result<PostGwApiV1BankInstructionsResponse>

Transfer Positions Internally

Transfer positions internally between two accounts with Interactive Brokers

Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/internal-asset-transfers
Source

pub async fn post_gw_api_v1_internal_asset_transfers_bulk( &self, request: PostGwApiV1InternalAssetTransfersBulkRequest, ) -> Result<PostGwApiV1BankInstructionsBulkResponse>

Creates Multiple Internal Asset Transfers Between The Provided Account Id Pairs


Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/internal-asset-transfers:bulk
Source

pub async fn post_gw_api_v1_internal_cash_transfers( &self, request: PostGwApiV1InternalCashTransfersRequest, ) -> Result<PostGwApiV1InstructionsCancelResponse>

Transfer Cash Internally

Transfer cash internally between two accounts with Interactive Brokers.

Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/internal-cash-transfers
Source

pub async fn post_gw_api_v1_internal_cash_transfers_bulk( &self, request: PostGwApiV1InternalCashTransfersBulkRequest, ) -> Result<PostGwApiV1BankInstructionsBulkResponse>

Creates Multiple Internal Cash Transfers Between The Provided Account Id Pairs


Scope: transfers.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/internal-cash-transfers:bulk
Source

pub async fn get_gw_api_v1_participating_banks( &self, request: GetGwApiV1ParticipatingBanksRequest, ) -> Result<GetGwApiV1ParticipatingBanksResponse>

Get Participating Banks

Get list of banks which support banking connection with Interactive Brokers.

Scope: enumerations.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/participating-banks
Source

pub async fn get_gw_api_v1_requests( &self, request: GetGwApiV1RequestsRequest, ) -> Result<GetGwApiV1RequestsResponse>

Get Requests’ Details By Timeframe

Fetch Requests’ Details By Timeframe

Scope: accounts.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/requests
Source

pub async fn patch_gw_api_v1_requests_requestid_status( &self, request: PatchGwApiV1RequestsRequestidStatusRequest, ) -> Result<PatchGwApiV1RequestsRequestidStatusResponse>

Update Status Of An Am Request

This api will be used to update the status of am request

Scope: accounts.read
Security Policy: Signed JWT

  • Path: PATCH /gw/api/v1/requests/{requestId}/status
Source

pub async fn apply_csv( &self, request: ApplyCsvRequest, ) -> Result<ApplyCsvResponse>

Apply PTC CSV

Applies verified CSV changes. Requires both Bearer token (header) and signed JWT (body). CSV must be verified via /csv/v2/verify first. JWT validity: 1 minute.

Scope: restrictions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/restrictions
Source

pub async fn verify_csv( &self, request: VerifyCsvRequest, ) -> Result<ApplyCsvResponse>

Verify PTC CSV

Validates CSV structure, restriction names, and rule parameters without applying changes. Must be called before /csv/v2/apply with the same requestId.

Scope: restrictions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/restrictions/verify
Source

pub async fn post_gw_api_v1_sso_browser_sessions( &self, request: PostGwApiV1SsoBrowserSessionsRequest, ) -> Result<PostGwApiV1SsoBrowserSessionsResponse>

Create SSO Browser Session.


Scope: sso-browser-sessions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/sso-browser-sessions
Source

pub async fn post_gw_api_v1_sso_sessions( &self, request: PostGwApiV1SsoSessionsRequest, ) -> Result<PostGwApiV1SsoSessionsResponse>

Create A New SSO Session On Behalf Of An End-user.


Scope: sso-sessions.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/sso-sessions
Source

pub async fn post_gw_api_v1_statements( &self, request: PostGwApiV1StatementsRequest, ) -> Result<PostGwApiV1StatementsResponse>

Generates Statements In Supported Formats Based On Request Parameters.


Scope: statements.read OR statements.write OR reports.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/statements
Source

pub async fn get_gw_api_v1_statements_available( &self, request: GetGwApiV1StatementsAvailableRequest, ) -> Result<GetGwApiV1StatementsAvailableResponse>

Fetch Available Daily, Monthly, And Annual Report Dates For An Account Id


Scope: statements.read OR reports.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/statements/available
Source

pub async fn post_gw_api_v1_tax_documents( &self, request: PostGwApiV1TaxDocumentsRequest, ) -> Result<PostGwApiV1TaxDocumentsResponse>

Fetch Tax Forms In Supported Formats Based On Request Parameters.


Scope: statements.write OR reports.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/tax-documents
Source

pub async fn get_gw_api_v1_tax_documents_available( &self, request: GetGwApiV1TaxDocumentsAvailableRequest, ) -> Result<GetGwApiV1TaxDocumentsAvailableResponse>

Fetch List Of Available Tax Reports/forms/documents For A Specified Account And Tax Year


Scope: statements.read OR reports.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/tax-documents/available
Source

pub async fn post_gw_api_v1_trade_confirmations( &self, request: PostGwApiV1TradeConfirmationsRequest, ) -> Result<PostGwApiV1TradeConfirmationsResponse>

Fetch Trade Confirmations In Supported Formats Based On Request Parameters.


Scope: statements.write OR reports.write
Security Policy: Signed JWT

  • Path: POST /gw/api/v1/trade-confirmations
Source

pub async fn get_gw_api_v1_trade_confirmations_available( &self, request: GetGwApiV1TradeConfirmationsAvailableRequest, ) -> Result<GetGwApiV1TradeConfirmationsAvailableResponse>

Fetch List Of Available Trade Confirmation Dates, For A Specific Account Id


Scope: statements.read OR reports.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/trade-confirmations/available
Source

pub async fn get_gw_api_v1_validations_usernames_username( &self, request: GetGwApiV1ValidationsUsernamesUsernameRequest, ) -> Result<GetGwApiV1ValidationsUsernamesUsernameResponse>

Verify User Availability

Verify whether user is valid and available

Scope: accounts.read OR validations.read
Security Policy: HTTPS

  • Path: GET /gw/api/v1/validations/usernames/{username}
Source

pub async fn set_active_account( &self, request: SetActiveAccountRequest, ) -> Result<SetActiveAccountResponse>

Switch Selected Account

Switch the active account for how you request data. Only available for financial advisors and multi-account structures.

  • Path: POST /iserver/account
Source

pub async fn get_alert_details( &self, request: GetAlertDetailsRequest, ) -> Result<GetAlertDetailsResponse>

Details Of A Specific Alert

Request details of a specific alert by providing the assigned alertId Id.

  • Path: GET /iserver/account/alert/{alertId}
Source

pub async fn get_allocatable_subaccounts( &self, request: GetAllocatableSubaccountsRequest, ) -> Result<GetAllocatableSubaccountsResponse>

List Allocatable Subaccounts

Retrieves a list of all sub-accounts and returns their net liquidity and available equity for advisors to make decisions on what accounts should be allocated and how. This endpoint is only supported for Financial Advisors and IBroker Accounts.

  • Path: GET /iserver/account/allocation/accounts
Source

pub async fn get_allocation_groups( &self, request: GetAllocationGroupsRequest, ) -> Result<GetAllocationGroupsResponse>

List All Allocation Groups

Retrieves a list of all of the advisor’s allocation groups. This describes the name of the allocation group, number of subaccounts within the group, and the method in use for the group. This endpoint is only supported for Financial Advisors and IBroker Accounts.

  • Path: GET /iserver/account/allocation/group
Source

pub async fn modify_allocation_group( &self, request: ModifyAllocationGroupRequest, ) -> Result<CreateAllocationGroupResponse>

Modify Allocation Group

Modify an existing allocation group.

  • Path: PUT /iserver/account/allocation/group
Source

pub async fn create_allocation_group( &self, request: CreateAllocationGroupRequest, ) -> Result<CreateAllocationGroupResponse>

Add Allocation Group

Add a new allocation group. This group can be used to trade in place of the {accountId} for the /iserver/account/{accountId}/orders endpoint.

  • Path: POST /iserver/account/allocation/group
Source

pub async fn delete_allocation_group( &self, request: DeleteAllocationGroupRequest, ) -> Result<CreateAllocationGroupResponse>

Delete An Allocation Group

Deletes a previously created allocation group. This endpoint is only supported for Financial Advisors and IBroker Accounts.

  • Path: POST /iserver/account/allocation/group/delete
Source

pub async fn get_single_allocation_group( &self, request: GetSingleAllocationGroupRequest, ) -> Result<GetSingleAllocationGroupResponse>

Retrieve Single Allocation Group

Retrieves the configuration of a single account group. This describes the name of the allocation group, the specific accounts contained in the group, and the allocation method in use along with any relevant quantities. This endpoint is only supported for Financial Advisors and IBroker Accounts.

  • Path: POST /iserver/account/allocation/group/single
Source

pub async fn get_allocation_presets( &self, request: GetAllocationPresetsRequest, ) -> Result<GetAllocationPresetsResponse>

Retrieve Allocation Presets

Retrieve the preset behavior for allocation groups for specific events. This endpoint is only supported for Financial Advisors and IBroker Accounts.

  • Path: GET /iserver/account/allocation/presets
Source

pub async fn set_allocation_preset( &self, request: SetAllocationPresetRequest, ) -> Result<SetAllocationPresetResponse>

Set Allocation Preset

Set the preset behavior for new allocation groups for specific events.

  • Path: POST /iserver/account/allocation/presets
Source

pub async fn get_mta_details( &self, request: GetMtaDetailsRequest, ) -> Result<GetMtaDetailsResponse>

Details Of A Mobile Trading Alert

Retrieve information about your MTA alert. Each login user only has one mobile trading assistant (MTA) alert with it’s own unique tool id that cannot be changed. MTA alerts can not be created or deleted, only modified. When modified a new order Id is generated.

  • Path: GET /iserver/account/mta
Source

pub async fn get_order_status( &self, request: GetOrderStatusRequest, ) -> Result<GetOrderStatusResponse>

Status Of A Single Order

Retrieve the status of a single order. Only displays orders from the current brokerage session. If orders executed on a previous day or session, queries will 503 error.

  • Path: GET /iserver/account/order/status/{orderId}
Source

pub async fn get_open_orders( &self, request: GetOpenOrdersRequest, ) -> Result<GetOpenOrdersResponse>

List Open Orders

Returns open orders and filled or cancelled orders submitted during the current brokerage session.

  • Path: GET /iserver/account/orders
Source

pub async fn get_pnl(&self, request: GetPnlRequest) -> Result<GetPnlResponse>

Account Profit And Loss

Returns updated profit and loss values for the selected account. Initial request will return an empty array in the upnl object.

  • Path: GET /iserver/account/pnl/partitioned
Source

pub async fn get_dynamic_accounts( &self, request: GetDynamicAccountsRequest, ) -> Result<GetDynamicAccountsResponse>

Search Dynamic Accounts

Returns a list of accounts matching a query pattern set in the request. Broker accounts configured with the DYNACCT property will not receive account information at login. Instead, they must dynamically query then set their account number. Customers without the DYNACCT property will receive a 503 error.

  • Path: GET /iserver/account/search/{searchPattern}
Source

pub async fn get_trade_history( &self, request: GetTradeHistoryRequest, ) -> Result<GetTradeHistoryResponse>

Trade History

Retrieve a list of trades, up to a maximum of 7 days prior.

  • Path: GET /iserver/account/trades
Source

pub async fn create_alert( &self, request: CreateAlertRequest, ) -> Result<CreateAlertResponse>

Create Or Modify Alert

Endpoint used to create a new alert, or modify an existing alert.

  • Path: POST /iserver/account/{accountId}/alert
Source

pub async fn activate_alert( &self, request: ActivateAlertRequest, ) -> Result<ActivateAlertResponse>

Activate Or Deactivate An Alert

Activate or Deactivate existing alerts created for this account. This does not delete alerts, but disables notifications until reactivated.

  • Path: POST /iserver/account/{accountId}/alert/activate
Source

pub async fn delete_alert( &self, request: DeleteAlertRequest, ) -> Result<DeleteAlertResponse>

Delete An Alert

Permanently delete an existing alert. Deleting an MTA alert will reset it to the default state.

  • Path: DELETE /iserver/account/{accountId}/alert/{alertId}
Source

pub async fn get_all_alerts( &self, request: GetAllAlertsRequest, ) -> Result<GetAllAlertsResponse>

List All Alerts

Retrieve a list of all alerts attached to the provided account.

  • Path: GET /iserver/account/{accountId}/alerts
Source

pub async fn modify_open_order( &self, request: ModifyOpenOrderRequest, ) -> Result<ModifyOpenOrderResponse>

Modify Open Order

Modify an existing, unfilled order.

  • Path: POST /iserver/account/{accountId}/order/{orderId}
Source

pub async fn cancel_open_order( &self, request: CancelOpenOrderRequest, ) -> Result<CancelOpenOrderResponse>

Cancel An Open Order

Cancel an existing, unfilled order.

  • Path: DELETE /iserver/account/{accountId}/order/{orderId}
Source

pub async fn submit_new_order( &self, request: SubmitNewOrderRequest, ) -> Result<SubmitNewOrderResponse>

Submit New Order

Submit a new order(s) ticket, bracket, or OCA group.

  • Path: POST /iserver/account/{accountId}/orders
Source

pub async fn preview_margin_impact( &self, request: PreviewMarginImpactRequest, ) -> Result<PreviewMarginImpactResponse>

New Order Preview

Preview the projected effects of an order ticket or bracket of orders, including cost and changes to margin and account equity.

  • Path: POST /iserver/account/{accountId}/orders/whatif
Source

pub async fn get_account_summary( &self, request: GetAccountSummaryRequest, ) -> Result<GetAccountSummaryResponse>

Summary Of Account Values

Provides a general overview of the account details such as balance values.

  • Path: GET /iserver/account/{accountId}/summary
Source

pub async fn get_fund_summary( &self, request: GetFundSummaryRequest, ) -> Result<GetFundSummaryResponse>

Summary Of Available Funds

Provides a summary specific for avilable funds giving more depth than the standard /summary endpoint.

  • Path: GET /iserver/account/{accountId}/summary/available_funds
Source

pub async fn get_balance_summary( &self, request: GetBalanceSummaryRequest, ) -> Result<GetBalanceSummaryResponse>

Summary Of Account Balances

Returns a summary of an account’s equity and cash balances, in total and by account segment.

  • Path: GET /iserver/account/{accountId}/summary/balances
Source

pub async fn get_margin_summary( &self, request: GetMarginSummaryRequest, ) -> Result<GetMarginSummaryResponse>

Summary Of Account Margin Usage

Returns a summary of an account’s margin, in total and by account segment.

  • Path: GET /iserver/account/{accountId}/summary/margins
Source

pub async fn get_account_market_summary( &self, request: GetAccountMarketSummaryRequest, ) -> Result<GetAccountMarketSummaryResponse>

Summary Of Account Market Value

Returns a summary of an account’s market value, by currency and asset class.

  • Path: GET /iserver/account/{accountId}/summary/market_value
Source

pub async fn get_brokerage_accounts( &self, request: GetBrokerageAccountsRequest, ) -> Result<GetBrokerageAccountsResponse>

List All Tradable Accounts

Returns a list of accounts the user has trading access to, their respective aliases and the currently selected account. Note this endpoint must be called before modifying an order or querying open orders.

  • Path: GET /iserver/accounts
Source

pub async fn initialize_session( &self, request: InitializeSessionRequest, ) -> Result<InitializeSessionResponse>

Initialize Brokerage Session

After retrieving the access token and subsequent Live Session Token, customers can initialize their brokerage session with the ssodh/init endpoint.

  • Path: POST /iserver/auth/ssodh/init
Source

pub async fn get_brokerage_status( &self, request: GetBrokerageStatusRequest, ) -> Result<GetBrokerageStatusResponse>

Brokerage Session Status

Current Authentication status to the Brokerage system. Market Data and Trading is not possible if not authenticated.

  • Path: POST /iserver/auth/status
Source

pub async fn get_contract_rules( &self, request: GetContractRulesRequest, ) -> Result<GetContractRulesResponse>

Search Contract Rules

Returns trading related rules for a specific contract and side.

  • Path: POST /iserver/contract/rules
Source

pub async fn get_algos_by_instrument( &self, request: GetAlgosByInstrumentRequest, ) -> Result<GetAlgosByInstrumentResponse>

Search Algos For An Instrument

Returns supported IB Algos for an instrument. A pre-flight request must be submitted before retrieving information.

  • Path: GET /iserver/contract/{conid}/algos
Source

pub async fn get_instrument_info( &self, request: GetInstrumentInfoRequest, ) -> Result<GetInstrumentInfoResponse>

General Instrument Information

Requests full contract details for the given conid.

  • Path: GET /iserver/contract/{conid}/info
Source

pub async fn get_info_and_rules( &self, request: GetInfoAndRulesRequest, ) -> Result<GetInfoAndRulesResponse>

Instrument Info And Market Rules

Requests full contract details and trading rules for the given conid. A follow-up request will provide additional trading rules.

  • Path: GET /iserver/contract/{conid}/info-and-rules
Source

pub async fn get_currency_pairs( &self, request: GetCurrencyPairsRequest, ) -> Result<GetCurrencyPairsResponse>

Available Currency Pairs

Obtains available currency pairs corresponding to the given target currency.

  • Path: GET /iserver/currency/pairs
Source

pub async fn set_dynamic_account( &self, request: SetDynamicAccountRequest, ) -> Result<SetActiveAccountResponse>

Set Active Dynamic Account

Set the active dynamic account.

  • Path: POST /iserver/dynaccount
Source

pub async fn get_exchange_rates( &self, request: GetExchangeRatesRequest, ) -> Result<GetExchangeRatesResponse>

Currency Exchange Rate

Obtains the exchange rates of the currency pair.

  • Path: GET /iserver/exchangerate
Source

pub async fn get_md_history( &self, request: GetMdHistoryRequest, ) -> Result<GetMdHistoryResponse>

Historical OHLC Bar Data

Request historical data for an instrument in the form of OHLC bars.

  • Path: GET /iserver/marketdata/history
Source

pub async fn get_md_snapshot( &self, request: GetMdSnapshotRequest, ) -> Result<GetMdSnapshotResponse>

Live Market Data Snapshot

Get Market Data for the given conid(s). A pre-flight request must be made prior to ever receiving data. For some fields, it may take more than a few moments to receive information. See response fields for a list of available fields that can be request via fields argument. The endpoint /iserver/accounts must be called prior to /iserver/marketdata/snapshot. For derivative contracts the endpoint /iserver/secdef/search must be called first.

  • Path: GET /iserver/marketdata/snapshot
Source

pub async fn close_md_stream( &self, request: CloseMdStreamRequest, ) -> Result<CloseMdStreamResponse>

Close A Backend Data Stream

Instruct IServer to close its backend stream for the instrument when real-time snapshots are no longer needed.

  • Path: POST /iserver/marketdata/unsubscribe
Source

pub async fn close_all_md_streams( &self, request: CloseAllMdStreamsRequest, ) -> Result<CloseAllMdStreamsResponse>

Close All Backend Data Streams

Instruct IServer to close all of its open backend data streams for all instruments.

  • Path: GET /iserver/marketdata/unsubscribeall
Source

pub async fn ack_server_prompt( &self, request: AckServerPromptRequest, ) -> Result<AckServerPromptResponse>

Dismiss Server Prompt

Respond to a server prompt received via ntf websocket message.

  • Path: POST /iserver/notification
Source

pub async fn suppress_order_replies( &self, request: SuppressOrderRepliesRequest, ) -> Result<SuppressOrderRepliesResponse>

Suppress Order Reply Messages

Suppress the specified order reply messages for the duration of the brokerage session.

  • Path: POST /iserver/questions/suppress
Source

pub async fn reset_order_suppression( &self, request: ResetOrderSuppressionRequest, ) -> Result<ResetOrderSuppressionResponse>

Reset Order Reply Message Suppression

Removes suppression of all order reply messages that were previously suppressed in the current brokerage session.

  • Path: POST /iserver/questions/suppress/reset
Source

pub async fn confirm_order_reply( &self, request: ConfirmOrderReplyRequest, ) -> Result<ConfirmOrderReplyResponse>

Confirm Order Reply Message

Confirm an order reply message and continue with submission of order ticket.

  • Path: POST /iserver/reply/{replyId}
Source

pub async fn get_scanner_parameters( &self, request: GetScannerParametersRequest, ) -> Result<GetScannerParametersResponse>

Get Valid IServer Scanner Parameters

Returns an xml file containing all available parameters to be sent for the Iserver scanner request.

  • Path: GET /iserver/scanner/params
Source

pub async fn get_scanner_results( &self, request: GetScannerResultsRequest, ) -> Result<GetScannerResultsResponse>

Run An IServer Market Scanner

Searches for contracts according to the filters specified in /iserver/scanner/params endpoint.

  • Path: POST /iserver/scanner/run
Source

pub async fn get_bond_filters( &self, request: GetBondFiltersRequest, ) -> Result<GetBondFiltersResponse>

Search Bond Filter Information

Request a list of filters relating to a given Bond issuerID. The issuerId is retrieved from /iserver/secdef/search and can be used in /iserver/secdef/info?issuerId={issuerId} for retrieving conIds.

  • Path: GET /iserver/secdef/bond-filters
Source

pub async fn get_contract_info( &self, request: GetContractInfoRequest, ) -> Result<GetContractInfoResponse>

Instrument Attributes Detail

Returns the attributes of the instrument.

  • Path: GET /iserver/secdef/info
Source

pub async fn get_contract_symbols( &self, request: GetContractSymbolsRequest, ) -> Result<GetContractSymbolsResponse>

Search Instruments By Symbol

Returns a list of contracts based on the search symbol provided as a query param.

  • Path: GET /iserver/secdef/search
Source

pub async fn get_contract_symbols_from_body( &self, request: GetContractSymbolsFromBodyRequest, ) -> Result<GetContractSymbolsResponse>

Search Instruments By Symbol

Returns a list of contracts based on the search symbol provided as a query param.

  • Path: POST /iserver/secdef/search
Source

pub async fn get_contract_strikes( &self, request: GetContractStrikesRequest, ) -> Result<GetContractStrikesResponse>

Search Strikes For An Underlier

Returns lists of valid strikes for options contracts on a given underlier, for all currently trading expirations. The /iserver/secdef/search endpoint must be called prior for the underlying. Otherwise empty arrays will return for “puts” and “calls”.

  • Path: GET /iserver/secdef/strikes
Source

pub async fn get_specific_watchlist( &self, request: GetSpecificWatchlistRequest, ) -> Result<GetSpecificWatchlistResponse>

Return A Single Saved Watchlist

Retrieve details of a single watchlist stored in the username’s settings.

  • Path: GET /iserver/watchlist
Source

pub async fn post_new_watchlist( &self, request: PostNewWatchlistRequest, ) -> Result<PostNewWatchlistResponse>

Create A Watchlist

Create a named watchlist by submitting a set of conids.

  • Path: POST /iserver/watchlist
Source

pub async fn delete_watchlist( &self, request: DeleteWatchlistRequest, ) -> Result<DeleteWatchlistResponse>

Delete A Saved Watchlist

Delete a specified watchlist from the username’s settings.

  • Path: DELETE /iserver/watchlist
Source

pub async fn get_all_watchlists( &self, request: GetAllWatchlistsRequest, ) -> Result<GetAllWatchlistsResponse>

Return All Saved Watchlists

Returns all saved watchlists stored on IB backend for the username in use in the current Web API session.

  • Path: GET /iserver/watchlists
Source

pub async fn logout(&self, request: LogoutRequest) -> Result<LogoutResponse>

Terminate Web API Session

Logs the user out of the gateway session. Any further activity requires re-authentication. Discard client-side cookies upon logout.

  • Path: POST /logout
Source

pub async fn req_access_token( &self, request: ReqAccessTokenRequest, ) -> Result<ReqAccessTokenResponse>

Generate An Access Token

Request an access token for the IB username that has granted authorization to the consumer.

  • Path: POST /oauth/access_token
Source

pub async fn req_live_session_token( &self, request: ReqLiveSessionTokenRequest, ) -> Result<ReqLiveSessionTokenResponse>

Generate A Live Session Token

Generate a Live Session Token shared secret and gain access to Web API.

  • Path: POST /oauth/live_session_token
Source

pub async fn req_temp_token( &self, request: ReqTempTokenRequest, ) -> Result<ReqTempTokenResponse>

Obtain A Request Token

Request a temporary token as a third party to begin the OAuth 1.0a authorization workflow.

  • Path: POST /oauth/request_token
Source

pub async fn generate_token( &self, request: GenerateTokenRequest, ) -> Result<GenerateTokenResponse>

Create Access Token

Generate OAuth 2.0 access tokens based on request parameters.

  • Path: POST /oauth2/api/v1/token
Source

pub async fn get_performance_all_periods( &self, request: GetPerformanceAllPeriodsRequest, ) -> Result<GetPerformanceAllPeriodsResponse>

Account Performance (All Time Periods)

Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.

  • Path: POST /pa/allperiods
Source

pub async fn get_single_performance_period( &self, request: GetSinglePerformancePeriodRequest, ) -> Result<GetSinglePerformancePeriodResponse>

Account Performance

Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.

  • Path: POST /pa/performance
Source

pub async fn get_transactions( &self, request: GetTransactionsRequest, ) -> Result<GetTransactionsResponse>

Transaction History

Transaction history for a given number of conids and accounts. Types of transactions include dividend payments, buy and sell transactions, transfers.

  • Path: POST /pa/transactions
Source

pub async fn get_all_accounts( &self, request: GetAllAccountsRequest, ) -> Result<GetAllAccountsResponse>

List All Accounts

return accounts

  • Path: GET /portfolio/accounts
Source

pub async fn get_all_accounts_for_conid( &self, request: GetAllAccountsForConidRequest, ) -> Result<GetAllAccountsForConidResponse>

All Account Positions In An Instrument

Get positions in accounts for a given instrument (no secDef await control)

  • Path: GET /portfolio/positions/{conid}
Source

pub async fn get_all_subaccounts( &self, request: GetAllSubaccountsRequest, ) -> Result<GetAllSubaccountsResponse>

List All Subaccounts

Retrieve attributes of the subaccounts in the account structure.

  • Path: GET /portfolio/subaccounts
Source

pub async fn get_many_subaccounts( &self, request: GetManySubaccountsRequest, ) -> Result<GetManySubaccountsResponse>

Portfolio Subaccounts (Large Account Structures)

Used in tiered account structures (such as Financial Advisor and IBroker Accounts) to return a list of sub-accounts, paginated up to 20 accounts per page, for which the user can view position and account-related information. This endpoint must be called prior to calling other /portfolio endpoints for those sub-accounts. If you have less than 100 sub-accounts use /portfolio/subaccounts. To query a list of accounts the user can trade, see /iserver/accounts.

  • Path: GET /portfolio/subaccounts2
Source

pub async fn get_asset_allocation( &self, request: GetAssetAllocationRequest, ) -> Result<GetAssetAllocationResponse>

Account Allocations

Get an account’s allocations by asset class, sector group, and sector.

  • Path: GET /portfolio/{accountId}/allocation
Source

pub async fn get_combo_positions( &self, request: GetComboPositionsRequest, ) -> Result<GetComboPositionsResponse>

Combination Positions

Provides all positions held in the account acquired as a combination, including values such as ratios, size, and market value.

  • Path: GET /portfolio/{accountId}/combo/positions
Source

pub async fn get_portfolio_ledger( &self, request: GetPortfolioLedgerRequest, ) -> Result<GetPortfolioLedgerResponse>

Account Ledger

Get the given account’s ledger data detailing its balances by currency.

  • Path: GET /portfolio/{accountId}/ledger
Source

pub async fn get_portfolio_metadata( &self, request: GetPortfolioMetadataRequest, ) -> Result<GetPortfolioMetadataResponse>

Account Attributes

Get a single account’s attributes and capabilities.

  • Path: GET /portfolio/{accountId}/meta
Source

pub async fn invalidate_position_cache( &self, request: InvalidatePositionCacheRequest, ) -> Result<InvalidatePositionCacheResponse>

Refresh Position Cache

Instructs IB to discard cached portfolio positions for a given account, so that the next request for positions delivers freshly obtained data.

  • Path: POST /portfolio/{accountId}/positions/invalidate
Source

pub async fn get_paginated_positions( &self, request: GetPaginatedPositionsRequest, ) -> Result<GetPaginatedPositionsResponse>

Account Positions

Get all positions in an account.

  • Path: GET /portfolio/{accountId}/positions/{pageId}
Source

pub async fn get_portfolio_summary( &self, request: GetPortfolioSummaryRequest, ) -> Result<GetPortfolioSummaryResponse>

Account Portfolio Summary

Returns detailed summary of account values, by segment where appropriate.

  • Path: GET /portfolio/{accountId}/summary
Source

pub async fn get_position_by_conid( &self, request: GetPositionByConidRequest, ) -> Result<GetPositionByConidResponse>

Account Position In An Instrument

Get position for a given instrument in a single account.

  • Path: GET /portfolio/{accountid}/position/{conid}
Source

pub async fn get_uncached_positions( &self, request: GetUncachedPositionsRequest, ) -> Result<GetUncachedPositionsResponse>

Account Positions (NEW)

Returns a list of positions for the given account. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint. This endpoint provides near-real time updates and removes caching otherwise found in the /portfolio/{accountId}/positions/{pageId} endpoint.

  • Path: GET /portfolio2/{accountId}/positions
Source

pub async fn get_session_validation( &self, request: GetSessionValidationRequest, ) -> Result<GetSessionValidationResponse>

Validate SSO Web API Session

Validates the current session for the SSO user.

  • Path: GET /sso/validate
Source

pub async fn get_session_token( &self, request: GetSessionTokenRequest, ) -> Result<GetSessionTokenResponse>

Brokerage Keep-Alive Ping

If the gateway has not received any requests for several minutes an open session will automatically timeout. The tickle endpoint pings the server to prevent the session from ending. It is expected to call this endpoint approximately every 60 seconds to maintain the connection to the brokerage session.

  • Path: POST /tickle
Source

pub async fn get_conids_by_exchange( &self, request: GetConidsByExchangeRequest, ) -> Result<GetConidsByExchangeResponse>

List All Stock Conids By Exchange

Send out a request to retrieve all contracts made available on a requested exchange. This returns all contracts that are tradable on the exchange, even those that are not using the exchange as their primary listing.

  • Path: GET /trsrv/all-conids
Source

pub async fn get_future_by_symbol( &self, request: GetFutureBySymbolRequest, ) -> Result<GetFutureBySymbolResponse>

Search Futures By Symbol

Returns a list of non-expired future contracts for given symbol(s)

  • Path: GET /trsrv/futures
Source

pub async fn get_instrument_definition( &self, request: GetInstrumentDefinitionRequest, ) -> Result<GetInstrumentDefinitionResponse>

Instrument Definition Detail

Returns a list of security definitions for the given conids.

  • Path: GET /trsrv/secdef
Source

pub async fn get_trading_schedule_get_trsrv_secdef_schedule( &self, request: GetTradingScheduleGetTrsrvSecdefScheduleRequest, ) -> Result<GetTradingScheduleGetTrsrvSecdefScheduleResponse>

Trading Schedule By Symbol

Returns the trading schedule up to a month for the requested contract.

  • Path: GET /trsrv/secdef/schedule
Source

pub async fn get_stock_by_symbol( &self, request: GetStockBySymbolRequest, ) -> Result<GetStockBySymbolResponse>

Search Stocks By Symbol

Returns an object contains all stock contracts for given symbol(s)

  • Path: GET /trsrv/stocks

Trait Implementations§

Source§

impl Clone for IbRestApiClient

Source§

fn clone(&self) -> IbRestApiClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IbRestApiClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IbRestApiClient

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> ServiceExt for T

§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
§

fn set_request_id<M>( self, header_name: HeaderName, make_request_id: M, ) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension. Read more
§

fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>
where Self: Sized, M: MakeRequestId,

Add request id header and extension, using x-request-id as the header name. Read more
§

fn propagate_request_id( self, header_name: HeaderName, ) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses. Read more
§

fn propagate_x_request_id(self) -> PropagateRequestId<Self>
where Self: Sized,

Propgate request ids from requests to responses, using x-request-id as the header name. Read more
§

fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>
where Self: Sized,

Intercept requests with over-sized payloads and convert them into 413 Payload Too Large responses. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more