Requests

AccountCreationRequest

class alpaca.broker.requests.CreateAccountRequest(*, account_type: AccountType | str | None = None, account_sub_type: AccountSubType | str | None = None, contact: Contact, identity: Identity, disclosures: Disclosures, agreements: List[Agreement], documents: List[AccountDocument | UploadW8BenDocumentRequest] | None = None, trusted_contact: TrustedContact | None = None, currency: SupportedCurrencies | None = None, enabled_assets: List[AssetClass] | None = None, minor_identity: MinorIdentity | None = None)

Class used to format data necessary for making a request to create a brokerage account

account_type

The type of account

Type:

Optional[AccountType]

account_sub_type

The sub type of account

Type:

Optional[AccountSubType]

contact

The contact details for the account holder

Type:

Contact

identity

The identity details for the account holder

Type:

Identity

disclosures

The account holder’s political disclosures

Type:

Disclosures

agreements

The agreements the account holder has signed

Type:

List[Agreement]

documents

The documents the account holder has submitted

Type:

List[Union[AccountDocument, UploadW8BenDocumentRequest]]

trusted_contact

The account holder’s trusted contact details

Type:

TrustedContact

minor_identity

Identity of the minor. Required for a custodial account.

Type:

Optional[MinorIdentity]

UpdateAccountRequest

class alpaca.broker.requests.UpdateAccountRequest(*, contact: UpdatableContact | None = None, identity: UpdatableIdentity | None = None, disclosures: UpdatableDisclosures | None = None, trusted_contact: UpdatableTrustedContact | None = None, agreements: List[Agreement] | None = None, allow_instant_ach: bool | None = None, beneficiaries: List[Beneficiary] | None = None, cash_interest: CashInterest | None = None, enabled_assets: List[AssetClass] | None = None, fpsl: FPSL | None = None)

Represents the data allowed in a request to update an Account. Note not all fields of an account are currently modifiable so this model uses models that represent the subset of modifiable fields.

contact

Contact details to update to

Type:

Optional[UpdatableContact]

identity

Identity details to update to

Type:

Optional[UpdatableIdentity]

disclosures

Disclosure details to update to

Type:

Optional[UpdatableDisclosures]

trusted_contact

TrustedContact details to update to

Type:

Optional[UpdatableTrustedContact]

agreements

Agreements to add or revise

Type:

Optional[List[Agreement]]

allow_instant_ach

Whether the partner enables Instant ACH

Type:

Optional[bool]

beneficiaries

IRA beneficiaries

Type:

Optional[List[Beneficiary]]

cash_interest

USD cash interest enrollment

Type:

Optional[CashInterest]

enabled_assets

Asset classes enabled on the account

Type:

Optional[List[AssetClass]]

fpsl

Fully Paid Securities Lending configuration

Type:

Optional[FPSL]

UpdatableContact

class alpaca.broker.requests.UpdatableContact(*, email_address: str | None = None, phone_number: str | None = None, street_address: List[str] | None = None, unit: str | None = None, city: str | None = None, state: str | None = None, postal_code: str | None = None, country: str | None = None)

An extended version of Contact that has all fields as optional, so you don’t need to specify all fields if you only want to update a subset of them.

email_address

The user’s email address

Type:

Optional[str]

phone_number

The user’s phone number. It should include the country code.

Type:

Optional[str]

street_address

The user’s street address lines.

Type:

Optional[List[str]]

unit

The user’s apartment unit, if any.

Type:

Optional[str]

city

The city the user resides in.

Type:

Optional[str]

state

The state the user resides in. This is required if country is ‘USA’.

Type:

Optional[str]

postal_code

The user’s postal

Type:

Optional[str]

country

The country the user resides in. 3 letter country code is permissible.

Type:

Optional[str]

UpdatableIdentity

class alpaca.broker.requests.UpdatableIdentity(*, given_name: str | None = None, middle_name: str | None = None, family_name: str | None = None, date_of_birth: str | None = None, tax_id: str | None = None, tax_id_type: TaxIdType | None = None, country_of_citizenship: str | None = None, country_of_birth: str | None = None, country_of_tax_residence: str | None = None, visa_type: VisaType | None = None, visa_expiration_date: str | None = None, date_of_departure_from_usa: str | None = None, permanent_resident: bool | None = None, funding_source: List[FundingSource] | None = None, annual_income_min: float | None = None, annual_income_max: float | None = None, liquid_net_worth_min: float | None = None, liquid_net_worth_max: float | None = None, total_net_worth_min: float | None = None, total_net_worth_max: float | None = None)

This class is a subset version of Identity. Currently, not all fields on accounts are modifiable so this class represents which ones are modifiable on the identity field of an account when making an BrokerClient::update_account call.

Also has all fields as optional, so you don’t need to specify all fields if you only want to update a subset

given_name

The user’s first name

Type:

Optional[str]

middle_name

The user’s middle name, if any

Type:

Optional[str]

family_name

The user’s last name

Type:

Optional[str]

date_of_birth

The user’s date of birth in YYYY-MM-DD format

Type:

Optional[str]

tax_id

The user’s country specific tax id, required if tax_id_type is provided

Type:

Optional[str]

tax_id_type

The tax_id_type for the tax_id provided, required if tax_id provided

Type:

Optional[TaxIdType]

country_of_citizenship

The country the user is a citizen

Type:

Optional[str]

country_of_birth

The country the user was born

Type:

Optional[str]

country_of_tax_residence

The country the user files taxes

Type:

Optional[str]

visa_type

Only used to collect visa types for users residing in the USA.

Type:

Optional[VisaType]

visa_expiration_date

The date of expiration for visa, Required if visa_type is set.

Type:

Optional[str]

date_of_departure_from_usa

Required if visa_type = B1 or B2

Type:

Optional[str]

permanent_resident

Only used to collect permanent residence status in the USA.

Type:

Optional[bool]

funding_source

How the user will fund their account

Type:

Optional[List[FundingSource]]

annual_income_min

The minimum of the user’s income range

Type:

Optional[float]

annual_income_max

The maximum of the user’s income range

Type:

Optional[float]

liquid_net_worth_min

The minimum of the user’s liquid net worth range

Type:

Optional[float]

liquid_net_worth_max

The maximum of the user’s liquid net worth range

Type:

Optional[float]

total_net_worth_min

The minimum of the user’s total net worth range

Type:

Optional[float]

total_net_worth_max

The maximum of the user’s total net worth range

Type:

Optional[float]

UpdatableDisclosures

class alpaca.broker.requests.UpdatableDisclosures(*, is_control_person: bool | None = None, is_affiliated_exchange_or_finra: bool | None = None, is_politically_exposed: bool | None = None, immediate_family_exposed: bool | None = None, employment_status: EmploymentStatus | None = None, employer_name: str | None = None, employer_address: str | None = None, employment_position: str | None = None)

An extended version of Disclosures that has all fields as optional, so you don’t need to specify all fields if you only want to update a subset of them.

is_control_person

Whether user holds a controlling position in a publicly traded company

Type:

Optional[bool]

is_affiliated_exchange_or_finra

If user is affiliated with any exchanges or FINRA

Type:

Optional[bool]

is_politically_exposed

If user is politically exposed

Type:

Optional[bool]

immediate_family_exposed

If user’s immediate family member is either politically exposed or holds a control position.

Type:

Optional[bool]

employment_status

The employment status of the user

Type:

Optional[EmploymentStatus]

employer_name

The user’s employer’s name, if any

Type:

Optional[str]

employer_address

The user’s employer’s address, if any

Type:

Optional[str]

employment_position

The user’s employment position, if any

Type:

Optional[str]

UpdatableTrustedContact

class alpaca.broker.requests.UpdatableTrustedContact(*, given_name: str | None = None, family_name: str | None = None, email_address: str | None = None, phone_number: str | None = None, street_address: Annotated[str | None, _TrustedStreetAddressSchema, BeforeValidator(func=_validate_trusted_street_address, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_trusted_street_address, return_type=List[str] | None, when_used=always)] = None, city: str | None = None, state: str | None = None, postal_code: str | None = None, country: str | None = None)

An extended version of TrustedContact that has all fields as optional, so you don’t need to specify all fields if you only want to update a subset of them.

given_name

The first name of the user’s trusted contact

Type:

Optional[str]

family_name

The last name of the user’s trusted contact

Type:

Optional[str]

email_address

The email address of the user’s trusted contact

Type:

Optional[str]

phone_number

The email address of the user’s trusted contact

Type:

Optional[str]

city

The email address of the user’s trusted contact

Type:

Optional[str]

state

The email address of the user’s trusted contact

Type:

Optional[str]

postal_code

The email address of the user’s trusted contact

Type:

Optional[str]

country

The email address of the user’s trusted contact

Type:

Optional[str]

street_address

Street address. The Broker API stores an array of strings. A string still works and is stored as a string, but it is deprecated and will be removed in the next release; it is sent as a one-item list.

Type:

Optional[str]

ListAccountsRequest

class alpaca.broker.requests.ListAccountsRequest(*args, query: str | None = None, created_before: datetime | None = None, created_after: datetime | None = None, status: List[AccountStatus] | None = None, sort: Sort, entities: List[AccountEntities] | None = None)

Represents the values you can specify when making a request to list accounts

query

Pass space-delimited tokens. The response will contain accounts that match with each of the tokens (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).

Type:

Optional[str]

created_before

Accounts that were created before this date

Type:

Optional[datetime]

created_after

Accounts that were created after this date

Type:

Optional[datetime]

status

Accounts that have their status field as one of these

Type:

Optional[AccountStatus]

sort

The chronological order of response based on the submission time. Defaults to DESC.

Type:

Sort, optional

entities

By default, this endpoint doesn’t return all information for each account to save space in the response. This field lets you specify what additional information you want to be included on each account.

ie, specifying [IDENTITY, CONTACT] would ensure that each returned account has its identity and contact fields filled out.

Type:

Optional[List[AccountEntities]]

GetAccountActivitiesRequest

class alpaca.broker.requests.GetAccountActivitiesRequest(*args, account_id: UUID | str | None = None, activity_types: List[ActivityType] | None = None, category: ActivityCategory | None = None, order_id: UUID | None = None, date: datetime | None = None, until: datetime | None = None, after: datetime | None = None, direction: Sort | None = None, page_size: int | None = None, page_token: UUID | str | None = None)

Represents the filtering values you can specify when getting AccountActivities for an Account

Notes on pagination and the `page_size` and `page_token` fields.

The BrokerClient::get_account_activities function by default will automatically handle the pagination of results for you to get all results at once. However, if you’re requesting a very large amount of results this can use a large amount of memory and time to gather all the results. If you instead want to handle pagination yourself page_size and page_token are how you would handle this.

Say you put in a request with page_size set to 4, you’ll only get 4 results back to get the next “page” of results you would set page_token to be the id field of the last Activity returned in the result set.

This gets more indepth if you start specifying the sort field as well. If specified with a direction of Sort.DESC, for example, the results will end before the activity with the specified ID. However, specified with a direction of Sort.ASC, results will begin with the activity immediately after the one specified.

Also, to note if date is not specified, the default and maximum page_size value is 100. If date is specified, the default behavior is to return all results, and there is no maximum page size; page size is still supported in this state though.

Please see https://alpaca.markets/docs/api-references/broker-api/accounts/account-activities/#retrieving-account-activities for more information

account_id

Specifies to filter to only activities for this Account

Type:

Optional[Union[UUID, str]]

activity_types

A list of ActivityType’s to filter results down to. Cannot be combined with category.

Type:

Optional[List[ActivityType]]

category

trade_activity or non_trade_activity. Cannot be combined with activity_types.

Type:

Optional[ActivityCategory]

order_id

Restrict results to this order.

Type:

Optional[UUID]

date

Filter to Activities only on this date.

Type:

Optional[datetime]

until

Filter to Activities before this date. Cannot be used if date is also specified.

Type:

Optional[datetime]

after

Filter to Activities after this date. Cannot be used if date is also specified.

Type:

Optional[datetime]

direction

Which direction to sort results in. Defaults to Sort.DESC

Type:

Optional[Sort]

page_size

The maximum number of entries to return in the response

Type:

Optional[int]

page_token

If you’re not using the built-in pagination this field is what you would use to mark the end of the results of your last page.

Type:

Optional[Union[UUID, str]]

GetTradeDocumentsRequest

class alpaca.broker.requests.GetTradeDocumentsRequest(*, start: date | str | None = None, end: date | str | None = None, type: TradeDocumentType | None = None)

Represents the various filters you can specify when making a call to get TradeDocuments for an Account

start

Filter to TradeDocuments created after this Date. str values will attempt to be upcast into date instances. Format must be in YYYY-MM-DD.

Type:

Optional[Union[date, str]]

end

Filter to TradeDocuments created before this Date. str values will attempt to be upcast into date instances. Format must be in YYYY-MM-DD.

Type:

Optional[Union[date, str]]

type

Filter to only these types of TradeDocuments

Type:

Optional[TradeDocumentType]

UploadDocumentRequest

class alpaca.broker.requests.UploadDocumentRequest(*, document_type: DocumentType, document_sub_type: UploadDocumentSubType | None = None, content: str, mime_type: UploadDocumentMimeType)
document_type

The type of document you are uploading

Type:

DocumentType

document_sub_type

If supported for the corresponding document_type this field allows you to specify a sub type to be even more specific.

Type:

Optional[UploadDocumentSubType]

content

A string containing Base64 encoded data to upload.

Type:

str

mime_type

The mime type of the data in content

Type:

UploadDocumentMimeType

UploadW8BenDocumentRequest

class alpaca.broker.requests.UploadW8BenDocumentRequest(*, document_type: DocumentType, document_sub_type: UploadDocumentSubType, content: str | None = None, content_data: W8BenDocument | None = None, mime_type: UploadDocumentMimeType)
content

A string containing Base64 encoded data to upload. Must be set if content_data is not set.

Type:

Optional[str]

content_data

The data representing a W8BEN document in field form. Must be set if content is not set.

Type:

Optional[W8BenDocument]

mime_type

The mime type of the data in content, or if using content_data must be UploadDocumentMimeType.JSON. If content_data is set this will default to JSON

Type:

UploadDocumentMimeType

CreateACHRelationshipRequest

class alpaca.broker.requests.CreateACHRelationshipRequest(*, account_owner_name: str, bank_account_type: BankAccountType, bank_account_number: str, bank_routing_number: str, nickname: str | None = None, instant: bool | None = None, processor_token: str | None = None)
account_owner_name

The name of the ACH account owner for the relationship that is being created.

Type:

str

bank_account_type

Specifies the type of bank account for the ACH relationship that is being created.

Type:

BankAccountType

bank_account_number

The bank account number associated with the ACH relationship.

Type:

str

bank_routing_number

THe bank routing number associated with the ACH relationship.

Type:

str

nickname

Optionally specify a nickname to assign to the created ACH relationship.

Type:

Optional[str]

instant

Whether to create an instant ACH relationship.

Type:

Optional[bool]

processor_token

Plaid processor token. Can be sent together with the bank account fields.

Type:

Optional[str]

CreatePlaidRelationshipRequest

class alpaca.broker.requests.CreatePlaidRelationshipRequest(*, processor_token: str)

This request is made following the Plaid bank account link user flow.

Upon the user completing their connection with Plaid, a public token specific to the user is returned by Plaid. This token is used to get an Alpaca processor token via Plaid’s /processor/token/create endpoint, which is subsequently used by this endpoint to transfer the user’s Plaid information to Alpaca.

processor_token

The processor token that is specific to Alpaca and was returned by Plaid.

Type:

str

CreateBankRequest

class alpaca.broker.requests.CreateBankRequest(*, name: str, bank_code_type: IdentifierType, bank_code: str, account_number: str, country: str | None = None, state_province: str | None = None, postal_code: str | None = None, city: str | None = None, street_address: str | None = None, extra_fields: BankAdditionalFields | None = None)
name

The name of the recipient bank.

Type:

str

bank_code_type

Specifies the type of the bank (international or domestic). See enums.IdentifierType for more details.

Type:

IdentifierType

bank_code

The 9-digit ABA routing number (domestic) or bank identifier code (BIC, international).

Type:

str

account_number

The bank account number.

Type:

str

country

The country of the bank, if and only if creating an international bank account connection.

Type:

Optional[str]

state_province

The state/province of the bank, if and only if creating an international bank account connection.

Type:

Optional[str]

postal_code

The postal code of the bank, if and only if creating an international bank account connection.

Type:

Optional[str]

city

The city of the bank, if and only if creating an international bank account connection.

Type:

Optional[str]

street_address

The street address of the bank, if and only if creating an international bank account connection.

Type:

Optional[str]

extra_fields

Intermediary-bank instructions for an international wire.

Type:

Optional[BankAdditionalFields]

CreateACHTransferRequest

class alpaca.broker.requests.CreateACHTransferRequest(*, amount: str, direction: TransferDirection, fee_payment_method: FeePaymentMethod | None = None, ira: TransferIRA | None = None, relationship_id: UUID, transfer_type: TransferType = TransferType.ACH)
transfer_type

Type of the transfer.

Type:

TransferType

relationship_id

ID of the relationship to use for the transfer, required for ACH transfers.

Type:

Optional[UUID]

ira

IRA contribution or distribution instructions. Omit for a non-IRA transfer.

Type:

Optional[TransferIRA]

CreateBankTransferRequest

class alpaca.broker.requests.CreateBankTransferRequest(*, amount: str, direction: TransferDirection, fee_payment_method: FeePaymentMethod | None = None, ira: TransferIRA | None = None, bank_id: UUID, transfer_type: TransferType = TransferType.WIRE, additional_information: str | None = None)
bank_id

ID of the bank to use for the transfer, required for wire transfers.

Type:

UUID

additional_information

Additional wire transfer details.

Type:

Optional[str]

ira

IRA contribution or distribution instructions. Omit for a non-IRA transfer.

Type:

Optional[TransferIRA]

GetTransfersRequest

class alpaca.broker.requests.GetTransfersRequest(*, direction: TransferDirection | None = None, limit: int | None = None, offset: int | None = None)
direction

Optionally filter for transfers of only a single TransferDirection.

Type:

alpaca.broker.enums.TransferDirection | None

OrderRequest

class alpaca.broker.requests.OrderRequest(*, symbol: str | None = None, qty: float | None = None, notional: float | None = None, side: OrderSide | None = None, type: OrderType, time_in_force: TimeInForce, order_class: OrderClass | None = None, extended_hours: bool | None = None, client_order_id: str | None = None, legs: List[OptionLegRequest] | None = None, take_profit: TakeProfitRequest | None = None, stop_loss: StopLossRequest | None = None, position_intent: PositionIntent | None = None, commission: float | None = None, currency: SupportedCurrencies | None = None)

See base alpaca.trading.requests.OrderRequest model for more information.

symbol

The symbol identifier for the asset being traded

Type:

str

qty

The number of shares to trade. Fractional qty for stocks only with market orders.

Type:

Optional[float]

notional

The base currency value of the shares to trade. For stocks, only works with MarketOrders. Does not work with qty.

Type:

Optional[float]

side

Whether the order will buy or sell the asset.

Type:

OrderSide

type

The execution logic type of the order (market, limit, etc).

Type:

OrderType

time_in_force

The expiration logic of the order.

Type:

TimeInForce

extended_hours

Whether the order can be executed during extended hours.

Type:

Optional[bool]

client_order_id

A string to identify which client submitted the order.

Type:

Optional[float]

order_class

The class of the order. Simple orders have no other legs.

Type:

Optional[OrderClass]

take_profit

For orders with multiple legs, an order to exit a profitable trade.

Type:

Optional[TakeProfitRequest]

stop_loss

For orders with multiple legs, an order to exit a losing trade.

Type:

Optional[StopLossRequest]

commission

The dollar value commission you want to charge the end user.

Type:

Optional[float]

MarketOrderRequest

class alpaca.broker.requests.MarketOrderRequest(*, symbol: str | None = None, qty: float | None = None, notional: float | None = None, side: OrderSide | None = None, type: OrderType, time_in_force: TimeInForce, order_class: OrderClass | None = None, extended_hours: bool | None = None, client_order_id: str | None = None, legs: List[OptionLegRequest] | None = None, take_profit: TakeProfitRequest | None = None, stop_loss: StopLossRequest | None = None, position_intent: PositionIntent | None = None, commission: float | None = None)

See base alpaca.trading.requests.MarketOrderRequest model for more information.

symbol

The symbol identifier for the asset being traded

Type:

str

qty

The number of shares to trade. Fractional qty for stocks only with market orders.

Type:

Optional[float]

notional

The base currency value of the shares to trade. For stocks, only works with MarketOrders. Does not work with qty.

Type:

Optional[float]

side

Whether the order will buy or sell the asset.

Type:

OrderSide

type

The execution logic type of the order (market, limit, etc).

Type:

OrderType

time_in_force

The expiration logic of the order.

Type:

TimeInForce

extended_hours

Whether the order can be executed during extended hours.

Type:

Optional[bool]

client_order_id

A string to identify which client submitted the order.

Type:

Optional[float]

order_class

The class of the order. Simple orders have no other legs.

Type:

Optional[OrderClass]

take_profit

For orders with multiple legs, an order to exit a profitable trade.

Type:

Optional[TakeProfitRequest]

stop_loss

For orders with multiple legs, an order to exit a losing trade.

Type:

Optional[StopLossRequest]

commission

The dollar value commission you want to charge the end user.

Type:

Optional[float]

LimitOrderRequest

class alpaca.broker.requests.LimitOrderRequest(*, symbol: str | None = None, qty: float | None = None, notional: float | None = None, side: OrderSide | None = None, type: OrderType, time_in_force: TimeInForce, order_class: OrderClass | None = None, extended_hours: bool | None = None, client_order_id: str | None = None, legs: List[OptionLegRequest] | None = None, take_profit: TakeProfitRequest | None = None, stop_loss: StopLossRequest | None = None, position_intent: PositionIntent | None = None, limit_price: float | None = None, commission: float | None = None)

See base alpaca.trading.requests.LimitOrderRequest model for more information.

symbol

The symbol identifier for the asset being traded

Type:

str

qty

The number of shares to trade. Fractional qty for stocks only with market orders.

Type:

Optional[float]

notional

The base currency value of the shares to trade. For stocks, only works with MarketOrders. Does not work with qty.

Type:

Optional[float]

side

Whether the order will buy or sell the asset.

Type:

OrderSide

type

The execution logic type of the order (market, limit, etc).

Type:

OrderType

time_in_force

The expiration logic of the order.

Type:

TimeInForce

extended_hours

Whether the order can be executed during extended hours.

Type:

Optional[bool]

client_order_id

A string to identify which client submitted the order.

Type:

Optional[float]

order_class

The class of the order. Simple orders have no other legs.

Type:

Optional[OrderClass]

take_profit

For orders with multiple legs, an order to exit a profitable trade.

Type:

Optional[TakeProfitRequest]

stop_loss

For orders with multiple legs, an order to exit a losing trade.

Type:

Optional[StopLossRequest]

limit_price

The worst fill price for a limit or stop limit order.

Type:

float

commission

The dollar value commission you want to charge the end user.

Type:

Optional[float]

StopOrderRequest

class alpaca.broker.requests.StopOrderRequest(*, symbol: str | None = None, qty: float | None = None, notional: float | None = None, side: OrderSide | None = None, type: OrderType, time_in_force: TimeInForce, order_class: OrderClass | None = None, extended_hours: bool | None = None, client_order_id: str | None = None, legs: List[OptionLegRequest] | None = None, take_profit: TakeProfitRequest | None = None, stop_loss: StopLossRequest | None = None, position_intent: PositionIntent | None = None, stop_price: float, commission: float | None = None)

See base alpaca.trading.requests.StopOrderRequest model for more information.

symbol

The symbol identifier for the asset being traded

Type:

str

qty

The number of shares to trade. Fractional qty for stocks only with market orders.

Type:

Optional[float]

notional

The base currency value of the shares to trade. For stocks, only works with MarketOrders. Does not work with qty.

Type:

Optional[float]

side

Whether the order will buy or sell the asset.

Type:

OrderSide

type

The execution logic type of the order (market, limit, etc).

Type:

OrderType

time_in_force

The expiration logic of the order.

Type:

TimeInForce

extended_hours

Whether the order can be executed during extended hours.

Type:

Optional[bool]

client_order_id

A string to identify which client submitted the order.

Type:

Optional[float]

order_class

The class of the order. Simple orders have no other legs.

Type:

Optional[OrderClass]

take_profit

For orders with multiple legs, an order to exit a profitable trade.

Type:

Optional[TakeProfitRequest]

stop_loss

For orders with multiple legs, an order to exit a losing trade.

Type:

Optional[StopLossRequest]

stop_price

The price at which the stop order is converted to a market order or a stop limit order is converted to a limit order.

Type:

float

commission

The dollar value commission you want to charge the end user.

Type:

Optional[float]

StopLimitOrderRequest

class alpaca.broker.requests.StopLimitOrderRequest(*, symbol: str | None = None, qty: float | None = None, notional: float | None = None, side: OrderSide | None = None, type: OrderType, time_in_force: TimeInForce, order_class: OrderClass | None = None, extended_hours: bool | None = None, client_order_id: str | None = None, legs: List[OptionLegRequest] | None = None, take_profit: TakeProfitRequest | None = None, stop_loss: StopLossRequest | None = None, position_intent: PositionIntent | None = None, stop_price: float, limit_price: float, commission: float | None = None)

See base alpaca.trading.requests.StopLimitOrderRequest model for more information.

symbol

The symbol identifier for the asset being traded

Type:

str

qty

The number of shares to trade. Fractional qty for stocks only with market orders.

Type:

Optional[float]

notional

The base currency value of the shares to trade. For stocks, only works with MarketOrders. Does not work with qty.

Type:

Optional[float]

side

Whether the order will buy or sell the asset.

Type:

OrderSide

type

The execution logic type of the order (market, limit, etc).

Type:

OrderType

time_in_force

The expiration logic of the order.

Type:

TimeInForce

extended_hours

Whether the order can be executed during extended hours.

Type:

Optional[bool]

client_order_id

A string to identify which client submitted the order.

Type:

Optional[float]

order_class

The class of the order. Simple orders have no other legs.

Type:

Optional[OrderClass]

take_profit

For orders with multiple legs, an order to exit a profitable trade.

Type:

Optional[TakeProfitRequest]

stop_loss

For orders with multiple legs, an order to exit a losing trade.

Type:

Optional[StopLossRequest]

stop_price

The price at which the stop order is converted to a market order or a stop limit order is converted to a limit order.

Type:

float

limit_price

The worst fill price for a limit or stop limit order.

Type:

float

commission

The dollar value commission you want to charge the end user

Type:

Optional[float]

TrailingStopOrderRequest

class alpaca.broker.requests.TrailingStopOrderRequest(*, symbol: str | None = None, qty: float | None = None, notional: float | None = None, side: OrderSide | None = None, type: OrderType, time_in_force: TimeInForce, order_class: OrderClass | None = None, extended_hours: bool | None = None, client_order_id: str | None = None, legs: List[OptionLegRequest] | None = None, take_profit: TakeProfitRequest | None = None, stop_loss: StopLossRequest | None = None, position_intent: PositionIntent | None = None, trail_price: float | None = None, trail_percent: float | None = None, commission: float | None = None)

See base alpaca.trading.requests.TrailingStopOrderRequest model for more information.

symbol

The symbol identifier for the asset being traded

Type:

str

qty

The number of shares to trade. Fractional qty for stocks only with market orders.

Type:

Optional[float]

notional

The base currency value of the shares to trade. For stocks, only works with MarketOrders. Does not work with qty.

Type:

Optional[float]

side

Whether the order will buy or sell the asset.

Type:

OrderSide

type

The execution logic type of the order (market, limit, etc).

Type:

OrderType

time_in_force

The expiration logic of the order.

Type:

TimeInForce

extended_hours

Whether the order can be executed during extended hours.

Type:

Optional[bool]

client_order_id

A string to identify which client submitted the order.

Type:

Optional[float]

order_class

The class of the order. Simple orders have no other legs.

Type:

Optional[OrderClass]

take_profit

For orders with multiple legs, an order to exit a profitable trade.

Type:

Optional[TakeProfitRequest]

stop_loss

For orders with multiple legs, an order to exit a losing trade.

Type:

Optional[StopLossRequest]

trail_price

The absolute price difference by which the trailing stop will trail.

Type:

Optional[float]

trail_percent

The percent price difference by which the trailing stop will trail.

Type:

Optional[float]

commission

The dollar value commission you want to charge the end user.

Type:

Optional[float]

CreateJournalRequest

class alpaca.broker.requests.CreateJournalRequest(*, from_account: UUID, entry_type: JournalEntryType, to_account: UUID, amount: float | None = None, symbol: str | None = None, qty: float | None = None, description: str | None = None, transmitter_name: str | None = None, transmitter_account_number: str | None = None, transmitter_address: str | None = None, transmitter_financial_institution: str | None = None, transmitter_timestamp: str | None = None, currency: SupportedCurrencies | None = None)

Data for request to initiate a single journal.

to_account

The account ID that received the journal.

Type:

UUID

from_account

The account ID that initiates the journal.

Type:

UUID

entry_type

Whether the journal is a cash or security journal.

Type:

JournalEntryType

symbol

For security journals, the symbol identifier of the security being journaled.

Type:

Optional[str]

qty

For security journals, the quantity of the security being journaled.

Type:

Optional[float]

amount

For cash journals, the total cash amount journaled in USD.

Type:

Optional[float]

description

Journal description. It can include fixtures for sandbox API.

Type:

Optional[str]

transmitter_name

For cash journals, travel rule related name info.

Type:

Optional[str]

transmitter_account_number

For cash journals, travel rule account number info.

Type:

Optional[str]

transmitter_address

For cash journals, travel rule related address info.

Type:

Optional[str]

transmitter_financial_institution

For cash journals, travel rule related institution info.

Type:

Optional[str]

transmitter_timestamp

For cash journals, travel rule related timestamp info.

Type:

Optional[str]

CreateBatchJournalRequest

class alpaca.broker.requests.CreateBatchJournalRequest(*, entry_type: JournalEntryType, from_account: UUID, entries: List[BatchJournalRequestEntry], correspondent: str | None = None)

This model represents the fields you can specify when creating a request of many Journals out of one account to many others at once.

Currently, batch journals are only enabled on cash journals.

entry_type

The type of journal transfer. Batch journals remain JNLC.

Type:

JournalEntryType

from_account

The originator of funds. Most likely is your Sweep Firm Account

Type:

UUID

entries

List of journals to execute.

Type:

List[BatchJournalRequestEntry]

correspondent

The 4-character correspondent code.

Type:

Optional[str]

BatchJournalRequestEntry

class alpaca.broker.requests.BatchJournalRequestEntry(*, to_account: UUID, amount: str | float, currency: str | None = None, qty: str | None = None, symbol: str | None = None, description: str | None = None, transmitter_name: str | None = None, transmitter_account_number: str | None = None, transmitter_address: str | None = None, transmitter_financial_institution: str | None = None, transmitter_timestamp: str | None = None)

Entry in batch journal request.

to_account

Account to fund in batch journal request.

Type:

UUID

amount

The cash amount in USD to fund by.

Type:

Union[str, float]

currency

Currency code for the entry.

Type:

Optional[str]

qty

Security quantity as a decimal string. Allowed alongside amount.

Type:

Optional[str]

symbol

Security symbol. Allowed alongside amount.

Type:

Optional[str]

description

Journal description.

Type:

Optional[str]

transmitter_name

For cash journals, travel rule related name info.

Type:

Optional[str]

transmitter_account_number

For cash journals, travel rule account number info.

Type:

Optional[str]

transmitter_address

For cash journals, travel rule related address info.

Type:

Optional[str]

transmitter_financial_institution

For cash journals, travel rule related institution info.

Type:

Optional[str]

transmitter_timestamp

For cash journals, travel rule related timestamp info.

Type:

Optional[str]

CreateReverseBatchJournalRequest

class alpaca.broker.requests.ReverseBatchJournalRequestEntry(*, from_account: UUID, amount: str | float, description: str | None = None, transmitter_name: str | None = None, transmitter_account_number: str | None = None, transmitter_address: str | None = None, transmitter_financial_institution: str | None = None, transmitter_timestamp: str | None = None)

Entry in reverse batch journal request.

from_account

Account from fund in batch journal request.

Type:

UUID

amount

The cash amount in USD to fund by.

Type:

Union[str, float]

description

Journal description.

Type:

Optional[str]

transmitter_name

For cash journals, travel rule related name info.

Type:

Optional[str]

transmitter_account_number

For cash journals, travel rule account number info.

Type:

Optional[str]

transmitter_address

For cash journals, travel rule related address info.

Type:

Optional[str]

transmitter_financial_institution

For cash journals, travel rule related institution info.

Type:

Optional[str]

transmitter_timestamp

For cash journals, travel rule related timestamp info.

Type:

Optional[str]

GetJournalsRequest

class alpaca.broker.requests.GetJournalsRequest(*, after: date | None = None, before: date | None = None, status: JournalStatus | None = None, entry_type: JournalEntryType | None = None, to_account: UUID | None = None, from_account: UUID | None = None, limit: int | None = None)

This model represents the fields you can specify when querying from the list of all journals.

after

Journal creation dates after this date.

Type:

Optional[date]

before

Journal creation dates before this date.

Type:

Optional[date]

status

Only journals with this status.

Type:

Optional[JournalStatus]

entry_type

Only journals with this entry type.

Type:

Optional[JournalEntryType]

to_account

Only journals to this account.

Type:

Optional[UUID]

from_account

Only journals from this account.

Type:

Optional[UUID]

limit

Maximum number of journals to return.

Type:

Optional[int]