Models#
Account#
- class alpaca.broker.models.accounts.Account(*, id: UUID, account_number: str, status: AccountStatus, crypto_status: AccountStatus = None, currency: str, last_equity: str, created_at: str, contact: Contact = None, identity: Identity = None, disclosures: Disclosures = None, agreements: List[Agreement] = None, documents: List[AccountDocument] = None, trusted_contact: TrustedContact = None)#
Contains information pertaining to a specific brokerage account
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
The fields contact, identity, disclosures, agreements, documents, trusted_contact, and trading_configurations are all optional and won’t always be provided by the api depending on what endpoint you use and what options you pass
- id#
The account uuid used to reference this account
- Type
str
- account_number#
A more human friendly identifier for this account
- Type
str
- status#
The approval status of this account
- Type
- crypto_status#
The crypto trading status. Only present if crypto trading is enabled.
- Type
Optional[AccountStatus]
- currency#
The currency the account’s values are returned in
- Type
str
- last_equity#
The total equity value stored in the account
- Type
str
- created_at#
The timestamp when the account was created
- Type
str
- disclosures#
The account holder’s political disclosures
- Type
Optional[Disclosures]
- documents#
The documents the account holder has submitted
- Type
Optional[List[AccountDocument]]
- trusted_contact#
The account holder’s trusted contact details
- Type
Optional[TrustedContact]
Contact#
- class alpaca.broker.models.accounts.Contact(*, email_address: str, phone_number: str, street_address: List[str], unit: str = None, city: str, state: str = None, postal_code: str = None, country: str = None)#
User contact details within Account Model
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
- email_address#
The user’s email address
- Type
str
- phone_number#
The user’s phone number. It should include the country code.
- Type
str
- street_address#
The user’s street address lines.
- Type
List[str]
- unit#
The user’s apartment unit, if any.
- Type
Optional[str]
- city#
The city the user resides in.
- Type
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
str
- country#
The country the user resides in. 3 letter country code is permissible.
- Type
str
Identity#
- class alpaca.broker.models.accounts.Identity(*, given_name: str, middle_name: str = None, family_name: str, date_of_birth: str, tax_id: str = None, tax_id_type: TaxIdType = None, country_of_citizenship: str = None, country_of_birth: str = None, country_of_tax_residence: str, visa_type: VisaType = None, visa_expiration_date: str = None, date_of_departure_from_usa: str = None, permanent_resident: bool = None, funding_source: List[FundingSource] = None, annual_income_min: float = None, annual_income_max: float = None, liquid_net_worth_min: float = None, liquid_net_worth_max: float = None, total_net_worth_min: float = None, total_net_worth_max: float = None)#
User identity details within Account Model
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
- given_name#
The user’s first name
- Type
str
- middle_name#
The user’s middle name, if any
- Type
Optional[str]
- family_name#
The user’s last name
- Type
str
- date_of_birth#
The user’s date of birth
- Type
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
str
- 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]
Disclosures#
- class alpaca.broker.models.accounts.Disclosures(*, is_control_person: bool, is_affiliated_exchange_or_finra: bool, is_politically_exposed: bool, immediate_family_exposed: bool, employment_status: EmploymentStatus = None, employer_name: str = None, employer_address: str = None, employment_position: str = None)#
User disclosures within Account Model
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
- is_control_person#
Whether user holds a controlling position in a publicly traded company
- Type
bool
- is_affiliated_exchange_or_finra#
If user is affiliated with any exchanges or FINRA
- Type
bool
- is_politically_exposed#
If user is politically exposed
- Type
bool
- immediate_family_exposed#
If user’s immediate family member is either politically exposed or holds a control position.
- Type
bool
- employment_status#
The employment status of the user
- Type
- employer_name#
The user’s employer’s name, if any
- Type
str
- employer_address#
The user’s employer’s address, if any
- Type
str
- employment_position#
The user’s employment position, if any
- Type
str
Agreement#
- class alpaca.broker.models.accounts.Agreement(*, agreement: AgreementType, signed_at: str, ip_address: str, revision: str = None)#
User agreements signed within Account Model
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
- signed_at#
The timestamp the agreement was signed
- Type
str
- ip_address#
The ip_address the signed agreements were sent from by the user
- Type
str
- revision#
The revision date
- Type
str
TrustedContact#
- class alpaca.broker.models.accounts.TrustedContact(*, given_name: str, family_name: str, email_address: str = None, phone_number: str = None, street_address: str = None, city: str = None, state: str = None, postal_code: str = None, country: str = None)#
User’s trusted contact details within Account Model
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
- Attributes:given_name
given_name (str): The first name of the user’s trusted contact family_name (str): The last name of the user’s trusted contact email_address (Optional[str]): The email address of the user’s trusted contact phone_number (Optional[str]): The email address of the user’s trusted contact city (Optional[str]): The email address of the user’s trusted contact state (Optional[str]): The email address of the user’s trusted contact postal_code (Optional[str]): The email address of the user’s trusted contact country (Optional[str]): The email address of the user’s trusted contact
AccountDocument#
- class alpaca.broker.models.documents.AccountDocument(*, id: UUID, document_type: DocumentType, document_sub_type: str = None, content: str, mime_type: str = None)#
User documents provided within Account Model.
This model is different from the TradeDocument model in that this model represents documents having to do with a brokerage Account.
see https://alpaca.markets/docs/broker/api-references/accounts/accounts/#the-account-model
- id#
ID of the Document
- Type
UUID
- document_type#
The type of document uploaded
- Type
- document_sub_type#
The specific type of document, e.g. passport
- Type
Optional[str]
- name#
Name of the document if present
- Type
Optional(str)
- content#
Base64 string representing the document
- Type
str
- mime_type#
The format of content encoded by the string
- Type
str
TradeAccount#
- class alpaca.broker.models.accounts.TradeAccount(*, id: UUID, account_number: str, status: AccountStatus, crypto_status: AccountStatus = None, currency: str = None, buying_power: str, regt_buying_power: str, daytrading_buying_power: str, non_marginable_buying_power: str, cash: str, accrued_fees: str, pending_transfer_out: str = None, pending_transfer_in: str = None, portfolio_value: str, pattern_day_trader: bool, trading_blocked: bool, transfers_blocked: bool, account_blocked: bool, created_at: datetime, trade_suspended_by_user: bool, multiplier: str, shorting_enabled: bool, equity: str, last_equity: str, long_market_value: str, short_market_value: str, initial_margin: str, maintenance_margin: str, last_maintenance_margin: str, sma: str, daytrade_count: int, cash_withdrawable: str = None, cash_transferable: str = None, previous_close: datetime = None, last_long_market_value: str = None, last_short_market_value: str = None, last_cash: str = None, last_initial_margin: str = None, last_regt_buying_power: str = None, last_daytrading_buying_power: str = None, last_daytrade_count: int = None, last_buying_power: str = None, clearing_broker: ClearingBroker = None)#
See Base TradeAccount model in common for full details on available fields. Represents trading account information for an Account.
- cash_withdrawable#
Cash available for withdrawal from the account
- Type
Optional[str]
- cash_transferable#
Cash available for transfer (JNLC) from the account
- Type
Optional[str]
- previous_close#
Previous sessions close time
- Type
Optional[datetime]
- last_long_market_value#
Value of all long positions as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- last_short_market_value#
Value of all short positions as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- last_cash#
Value of all cash as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- last_initial_margin#
Value of initial_margin as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- last_regt_buying_power#
Value of regt_buying_power as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- last_daytrading_buying_power#
Value of daytrading_buying_power as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- last_daytrade_count#
Value of daytrade_count as of previous trading day at 16:00:00 ET
- Type
Optional[int]
- last_buying_power#
Value of buying_power as of previous trading day at 16:00:00 ET
- Type
Optional[str]
- clearing_broker#
The Clearing broker for this account
- Type
Optional[ClearingBroker]
TradeAccountConfiguration#
- class alpaca.broker.models.accounts.TradeAccountConfiguration(*, dtbp_check: DTBPCheck, fractional_trading: bool, max_margin_multiplier: str, no_shorting: bool, pdt_check: PDTCheck, suspend_trade: bool, trade_confirm_email: TradeConfirmationEmail)#
Represents configuration options for a TradeAccount.
- dtbp_check#
Day Trade Buying Power Check. Controls Day Trading Margin Call (DTMC) checks.
- Type
- fractional_trading#
If true, account is able to participate in fractional trading
- Type
bool
- max_margin_multiplier#
A number between 1-4 that represents your max margin multiplier
- Type
str
- no_shorting#
If true then Account becomes long-only mode.
- Type
bool
- suspend_trade#
If true Account becomes unable to submit new orders
- Type
bool
- trade_confirm_email#
Controls whether Trade confirmation emails are sent.
TradeDocument#
- class alpaca.broker.models.documents.TradeDocument(*, id: UUID, name: str, type: TradeDocumentType, sub_type: TradeDocumentSubType = None, date: date)#
Similar to the AccountDocument model but this represents documents having to do with a TradeAccount not a regular Account.
IE: Account Monthly Statements or Trade Confirmations.
- id#
Unique id of the TradeDocument
- Type
UUID
- name#
Name of the document
- Type
str
- type#
The kind of TradeDocument this is
- Type
- sub_type#
The subtype of the document. The API returns “” in the case of this not being specified, however we transform this case into None for convenience.
- Type
Optional[TradeDocumentSubType]
- date#
Date on when this TradeDocument was generated
- Type
date
W8BenDocument#
- class alpaca.broker.models.documents.W8BenDocument(*, country_citizen: str, date: date, date_of_birth: date, full_name: str, ip_address: Union[IPv4Address, IPv6Address], permanent_address_city_state: str, permanent_address_country: str, permanent_address_street: str, revision: str, signer_full_name: str, timestamp: datetime, additional_conditions: str = None, foreign_tax_id: str = None, ftin_not_required: bool = None, income_type: str = None, mailing_address_city_state: str = None, mailing_address_country: str = None, mailing_address_street: str = None, paragraph_number: str = None, percent_rate_withholding: str = None, reference_number: str = None, residency: str = None, tax_id_ssn: str = None)#
Represents the information normally contained in a W8BEN document as fields for convenience if you don’t want to upload a file.
Please see https://alpaca.markets/docs/api-references/broker-api/accounts/accounts/#international-accounts for more information.
- TODO: None of the docs or code explain what any of these fields mean. Guessing based on name alone for
all of them; but we really need the docs updated.
- additional_conditions#
Any additional conditions to specify
- Type
Optional[str]
- country_citizen#
The Country that the applicant is a citizen of
- Type
str
- date#
date signed
- Type
date
- date_of_birth#
DOB of applicant
- Type
date
- foreign_tax_id#
Applicant’s tax id in their home country
- Type
Optional[str]
- ftin_not_required#
Required if foreign_tax_id and tax_id_ssn are empty.
- Type
Optional[bool]
- full_name#
Full name of applicant
- Type
str
- income_type#
income type of applicant
- Type
Optional[str]
- ip_address#
ip address of applicant when signed
- Type
IPAddress
- mailing_address_city_state#
mailing city/state of applicant
- Type
Optional[str]
- mailing_address_country#
mailing country for applicant
- Type
Optional[str]
- mailing_address_street#
mailing street address for applicant
- Type
Optional[str]
- paragraph_number#
TODO: get documentation for this field
- Type
Optional[str]
- percent_rate_withholding#
TODO: get documentation for this field
- Type
Optional[str]
- permanent_address_city_state#
permanent city/state of applicant
- Type
str
- permanent_address_country#
permanent country of residence of applicant
- Type
str
- permanent_address_street#
permanent street address of applicant
- Type
str
- reference_number#
TODO: Get documentation for this field
- Type
Optional[str]
- residency#
Country of residency of applicant TODO: get real documentation for this field. current is just guess based on example
- Type
Optional[str]
- revision#
Revision of the W8BEN form
- Type
str
- signer_full_name#
Full name of signing user
- Type
str
- tax_id_ssn#
TaxID/SSN of applicant
- Type
Optional[str]
- timestamp#
timestamp when form data was gathered
- Type
datetime
CIPKYCInfo#
- class alpaca.broker.models.cip.CIPKYCInfo(*, id: str, risk_score: int = None, risk_level: str = None, risk_categories: List[str] = None, applicant_name: str = None, email_address: str = None, nationality: str = None, date_of_birth: datetime = None, address: str = None, postal_code: str = None, country_of_residency: str = None, kyc_completed_at: datetime = None, ip_address: str = None, check_initiated_at: datetime = None, check_completed_at: datetime = None, approval_status: CIPApprovalStatus = None, approved_by: str = None, approved_reason: str = None, approved_at: datetime = None)#
Represents Know Your Customer (KYC) info for a CIPInfo
- id#
Your internal ID of check
- Type
str
- risk_score#
Overall risk score returned by KYC provider or assessed
- Type
Optional[int]
- risk_level#
Overall risk level returned by KYC provider or assessed
- Type
Optional[str]
- risk_categories#
The list of risk categories returned by the KYC provider or assessed
- Type
Optional[List[str]]
- applicant_name#
Given and family name of applicant
- Type
Optional[str]
- email_address#
email address of applicant
- Type
Optional[str]
- nationality#
nationality of applicant
- Type
Optional[str]
- date_of_birth#
DOB of applicant
- Type
Optional[datetime]
- address#
Concatenated street address, city, state and country of applicant
- Type
Optional[str]
- postal_code#
postal code for address field
- Type
Optional[str]
- country_of_residency#
country for address field
- Type
Optional[str]
- kyc_completed_at#
Datetime that KYC check was completed at
- Type
Optional[datetime]
- ip_address#
ip address of applicant at time of KYC check
- Type
Optional[str]
- check_initiated_at#
start datetime of KYC check
- Type
Optional[datetime]
- check_completed_at#
completion datetime of KYC check
- Type
Optional[datetime]
- approval_status#
Approval status of KYC check
- Type
Optional[CIPApprovalStatus]
- approved_by#
Identifier of who approved KYC check
- Type
Optional[str]
- approved_reason#
Reason for approving this KYC check
- Type
Optional[str]
- approved_at#
Datetime that this KYC check was approved
- Type
Optional[datetime]
CIPDocument#
- class alpaca.broker.models.cip.CIPDocument(*, id: str, result: CIPResult = None, status: CIPStatus = None, created_at: datetime = None, date_of_birth: datetime = None, date_of_expiry: datetime = None, document_numbers: List[str] = None, document_type: str = None, first_name: str = None, last_name: str = None, gender: str = None, issuing_country: str = None, nationality: str = None, age_validation: CIPResult = None, compromised_document: CIPResult = None, police_record: CIPStatus = None, data_comparison: CIPResult = None, data_comparison_breakdown: str = None, image_integrity: CIPResult = None, image_integrity_breakdown: str = None, visual_authenticity: str = None)#
Represents results of checking a document for CIPInfo
- id#
Your internal ID of check
- Type
str
- created_at#
Datetime for when this check was done
- Type
Optional[datetime]
- date_of_birth#
DOB for applicant if found on document
- Type
Optional[datetime]
- date_of_expiry#
date of expiry for the checked document
- Type
Optional[datetime]
- document_numbers#
Number of the document that was checked
- Type
Optional[List[str]]
- document_type#
Type of the document that was checked
- Type
Optional[str]
- first_name#
First name extracted from the document
- Type
Optional[str]
- last_name#
Last name extracted from the document
- Type
Optional[str]
- gender#
Gender info extracted from the document
- Type
Optional[str]
- issuing_country#
Country for which issued the document
- Type
Optional[str]
- nationality#
Nationality extracted from the document
- Type
Optional[str]
- age_validation#
Result of checks on whether the age calculated from the document’s date of birth data point is greater than or equal to the minimum accepted age set at account level
- Type
Optional[CIPResult]
- compromised_document#
Result of check on whether the image of the document has been found in our internal database of compromised documents
- Type
Optional[CIPResult]
- police_record#
Result of check on whether the document has been identified as lost, stolen or otherwise compromised
- Type
Optional[CIPStatus]
- data_comparison#
Result of check on whether data on the document is consistent with data provided when creating an applicant through the API
- Type
Optional[CIPResult]
- data_comparison_breakdown#
json object representing the results of the various sub-checks done when calculating the result on data_comparison. Example: {“date_of_birth”: “clear”, “date_of_expiry”: “clear” “document_numbers”: “clear”, “document_type”: “clear”, “first_name”: “clear”, “gender”: “clear”, “issuing_country”: “clear”, “last_name”: “clear”}
- Type
Optional[str]
- image_integrity#
Result of checks on whether the document was of sufficient quality to verify
- Type
Optional[CIPResult]
- image_integrity_breakdown#
json object representing the results of the various sub-checks done when calculating the result on image_integrity. Example: example: {“colour_picture”: “clear”, “conclusive_document_quality”: “clear”, “image_quality”: “clear”, “supported_document”: “clear”}
- Type
Optional[str]
- visual_authenticity#
json object representing the the various sub-checks done when determening whether visual (non-textual) elements are correct given the document type. Example: { “digital_tampering”: “clear”, “face_detection”: “clear”, “fonts”: “clear”, “original_document_present”: “clear”, “picture_face_integrity”: “clear”, “security_features”: “clear”, “template”: “clear”}
- Type
Optional[str]
CIPPhoto#
- class alpaca.broker.models.cip.CIPPhoto(*, id: str, result: CIPResult = None, status: CIPStatus = None, created_at: datetime = None, face_comparision: CIPResult = None, face_comparison_breakdown: str = None, image_integrity: CIPResult = None, image_integrity_breakdown: str = None, visual_authenticity: CIPResult = None, visual_authenticity_breakdown: str = None)#
Represents the results of checking a Photo for CIPInfo
- id#
Your internal ID of check
- Type
str
- created_at#
datetime of when check happened
- Type
Optional[datetime]
- face_comparision#
Checks whether the face in the document matches the face in the live photo
- Type
Optional[CIPResult]
- face_comparison_breakdown#
a json object representing the breakdown of sub-checks done in face_comparison. Example: {“face_match”:{“result”: “clear”,“properties”:{“score”: “80”}}}
- Type
Optional[str]
- image_integrity#
Checks whether the quality and integrity of the uploaded files were sufficient to perform a face comparison
- Type
Optional[CIPResult]
- image_integrity_breakdown#
a json object representing the breakdown of sub-checks done in image_integrity. Example {“face_detected”:{“result”: “clear”},“source_integrity”: {“result”: “clear”}}
- Type
Optional[str]
- visual_authenticity#
Checks whether the person in the live photo is real (not a spoof)
- Type
Optional[CIPResult]
- visual_authenticity_breakdown#
a json object representing the breakdown of sub-checks don in visual_authenticity. Example {“spoofing_detection”: {“result”: “clear”,“properties”: {“score”: “26”}}}}
- Type
Optional[str]
CIPIdentity#
- class alpaca.broker.models.cip.CIPIdentity(*, id: str, result: CIPResult = None, status: CIPStatus = None, created_at: datetime = None, matched_address: CIPResult = None, matched_addresses: str = None, sources: CIPResult = None, sources_breakdown: str = None, address: CIPResult = None, address_breakdown: str = None, date_of_birth: CIPResult = None, date_of_birth_breakdown: str = None, tax_id: CIPResult = None, tax_id_breakdown: str = None)#
Represents the results of running an identity check for a CIPInfo
- id#
Your internal ID of check
- Type
str
- created_at#
datetime when identity check happened
- Type
Optional[datetime]
- matched_addresses#
a json object representing the results of the check done in matched_address Example: [{“id”: “19099121”,“match_types”:[“credit_agencies”,“voting_register”]}]
- Type
Optional[str]
- sources#
Shows the total number of sources found for applicant’s identity. (TODO: What? This doesnt make any sense its a CIPResult not a number but that’s whats in the docs)
- Type
Optional[CIPResult]
- sources_breakdown#
a json object representing the breakdown of sources field. For example: {“total_sources”: {“result”: “clear”,“properties”: {“total_number_of_sources”: “3”}}}
- Type
Optional[str]
- address_breakdown#
a json object representing the breakdown of the address field. For example: {“credit_agencies”: {“result”: “clear”,“properties”:{“number_of_matches”:“1”}}
- Type
Optional[str]
- date_of_birth_breakdown#
a json object representing the breakdown of the date_of_birth field. For example: example: {“credit_agencies”:{“result”: “clear”,“properties”: {“number_of_matches”: “1”}}
- Type
Optional[str]
- tax_id_breakdown#
a json object representing the breakdown of the tax_id field
- Type
Optional[str]
CIPWatchlist#
- class alpaca.broker.models.cip.CIPWatchlist(*, id: str, result: CIPResult = None, status: CIPStatus = None, created_at: datetime = None, records: str = None, politically_exposed_person: CIPResult = None, sanction: CIPResult = None, adverse_media: CIPResult = None, monitored_lists: CIPResult = None)#
Represents the result of checking to see if the applicant is in any watchlists for a CIPInfo
- TODO: We’re missing almost entirely documentation in prod for this as well as even internal documentation
no clue what these fields are supposed to be or if they’re even close to correct.
- id#
Your internal ID of check
- Type
str
- created_at#
datetime when check happened
- Type
Optional[datetime]
- records#
a json object. Example [{“text”: “Record info”}]
- Type
Optional[str]
CIPInfo#
- class alpaca.broker.models.cip.CIPInfo(*args, id: UUID, account_id: UUID, provider_name: List[CIPProvider], created_at: datetime, updated_at: datetime, kyc: CIPKYCInfo = None, document: CIPDocument = None, photo: CIPPhoto = None, identity: CIPIdentity = None, watchlist: CIPWatchlist = None)#
The Customer Identification Program (CIP) API allows you to submit the CIP results received from your KYC provider.
This model is how to represent that information when talking to Alpaca
- Parameters
id (UUID) – ID of this CIPInfo
account_id (UUID) – UUID of the Account instance this CIPInfo is for
provider_name (List[CIPProvider]) – List of KYC providers this information came from
created_at (datetime) – date and time this CIPInfo was first uploaded to Alpaca
updated_at (datetime) – date and time that this CIPInfo was last update
kyc (Optional[CIPKYCInfo]) – KYC info for this Account if any
document (Optional[CIPDocument]) – Any CIP documents uploaded for this Account
photo (Optional[CIPPhoto]) – Any photos attached for CIP
identity (Optional[CIPIdentity]) – Any CIP Identity information
watchlist (Optional[CIPWatchlist]) – Any CIP watchlist information
ACHRelationship#
- class alpaca.broker.models.funding.ACHRelationship(*, id: UUID, account_id: UUID, created_at: datetime, updated_at: datetime, status: ACHRelationshipStatus, account_owner_name: str, bank_account_type: BankAccountType, bank_account_number: str, bank_routing_number: str, nickname: str = None, processor_token: str = None)#
- id#
ID of Relationship
- Type
UUID
- account_id#
ID of the Account this ACHRelationship is tied to
- Type
UUID
- created_at#
Date and time this relationship was created
- Type
datetime
- updated_at#
Date and time of when this relationship was last updated
- Type
datetime
- status#
Current status of the relationship
- account_owner_name#
Full name of the account owner
- Type
str
- bank_account_type#
The kind of bank account this relationship points to
- Type
- bank_account_number#
The number of bank account that the relationship points to
- Type
str
- bank_routing_number#
Routing number for the bank account
- Type
str
- nickname#
User provided name for account
- Type
str
- processor_token#
If you are using Plaid, then this is a Plaid processor token.
- Type
Optional[str]
Bank#
- class alpaca.broker.models.funding.Bank(*, id: UUID, account_id: UUID, created_at: datetime, updated_at: datetime, name: str, status: BankStatus, country: str, state_province: str, postal_code: str, city: str, street_address: str, account_number: str, bank_code: str, bank_code_type: IdentifierType)#
- id#
ID of Bank.
- Type
UUID
- account_id#
ID of the Account this Bank is tied to.
- Type
UUID
- created_at#
Date and time this Bank was created.
- Type
datetime
- updated_at#
Date and time of when this Bank was last updated.
- Type
datetime
- name#
Name of the bank.
- Type
str
- status#
The status of the bank connection.
- Type
- country#
Country where bank account is located.
- Type
str
- state_province#
State/Province where bank is located.
- Type
str
- postal_code#
Postal code where bank is located.
- Type
str
- city#
City where bank is located.
- Type
str
- street_address#
Street address where bank is located.
- Type
str
- account_number#
The bank account number.
- Type
str
- bank_code#
The bank account code.
- Type
str
- bank_code_type#
The bank identifier.
- Type
Transfer#
- class alpaca.broker.models.funding.Transfer(*, id: UUID, account_id: UUID, created_at: datetime, updated_at: datetime, expires_at: datetime, relationship_id: UUID, amount: str, type: TransferType, status: TransferStatus, direction: TransferDirection, reason: str = None, requested_amount: str, fee: str, fee_payment_method: FeePaymentMethod, additional_information: str = None)#
- id#
ID of Transfer.
- Type
UUID
- account_id#
ID of the Account this Transfer is tied to.
- Type
UUID
- created_at#
Date and time when this Transfer was created.
- Type
datetime
- updated_at#
Date and time of when this Transfer was last updated.
- Type
datetime
- expires_at#
Date and time of when this Transfer will expire.
- Type
datetime
- relationship_id#
ID of the funding relationship used to make the transfer.
- Type
UUID
- amount#
The amount the recipient will receive after any applicable fees are deducted.
- Type
str
- type#
The type of transfer.
- Type
- status#
The status of the transfer.
- Type
- direction#
The direction of the transfer.
- Type
- reason#
Reasoning associated with the current status.
- Type
Optional[str]
- requested_amount#
Amount entered upon creation of a transfer entity.
- Type
str
- fee#
Dollar amount of any applicable fees.
- Type
str
- fee_payment_method#
Denotes how any applicable fees will be paid.
- Type
- additional_information#
Additional information provided with wire transfers.
- Type
Optional[str]
Journal#
- class alpaca.broker.models.journals.Journal(*, id: UUID, to_account: UUID, from_account: UUID, entry_type: JournalEntryType, status: JournalStatus, net_amount: float = None, symbol: str = None, qty: float = None, price: float = None, description: str = None, settle_date: date = None, system_date: date = None, transmitter_name: str = None, transmitter_account_number: str = None, transmitter_address: str = None, transmitter_financial_institution: str = None, transmitter_timestamp: str = None)#
Represents a transfer of cash or securities from one account to another.
There are two types of journals Cash Journals and Security Journals.
Travel Rule In an effort to fight the criminal financial transactions, FinCEN enacted the Travel Rule that applies to fund transfers of more than $3,000. When you use Journal API to bundle a bulk of transfers for the end-users, you will need to tell about the breakdown and each transmitter information using the optional fields of the POST request.
Learn more about journals here: https://alpaca.markets/docs/api-references/broker-api/journals/
- id#
The journal ID
- Type
UUID
- 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
- status#
The lifecycle status of the journal.
- Type
- 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]
- price#
For security journals, the price at which the security is being journaled at.
- Type
Optional[float]
- net_amount#
For cash journals, the total cash amount journaled
- Type
Optional[float]
- description#
Journal description. It can include fixtures for sandbox API.
- Type
Optional[str]
- settle_date#
- Type
Optional[date]
- system_date#
- Type
Optional[date]
- 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]
BatchJournalResponse#
- class alpaca.broker.models.journals.BatchJournalResponse(*, id: UUID, to_account: UUID, from_account: UUID, entry_type: JournalEntryType, status: JournalStatus, net_amount: float = None, symbol: str = None, qty: float = None, price: float = None, description: str = None, settle_date: date = None, system_date: date = None, transmitter_name: str = None, transmitter_account_number: str = None, transmitter_address: str = None, transmitter_financial_institution: str = None, transmitter_timestamp: str = None, error_message: str = None)#
Represents a journal response from a batch journal request.
- error_message#
An message that contains error details for failed journals.
- Type
Optional[str]