tastytrade.session¶
-
pydantic model tastytrade.session.Address(*, city: str, country: str, is_domestic: bool, is_foreign: bool, postal_code: str, state_region: str, street_one: str, street_two: str | None =
None, street_three: str | None =None)¶ Bases:
TastytradeDataDataclass containing customer address information.
Show JSON schema
{ "title": "Address", "description": "Dataclass containing customer address information.", "type": "object", "properties": { "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "is-domestic": { "title": "Is-Domestic", "type": "boolean" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "postal-code": { "title": "Postal-Code", "type": "string" }, "state-region": { "title": "State-Region", "type": "string" }, "street-one": { "title": "Street-One", "type": "string" }, "street-two": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Two" }, "street-three": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Three" } }, "required": [ "city", "country", "is-domestic", "is-foreign", "postal-code", "state-region", "street-one" ] }- Fields:¶
-
pydantic model tastytrade.session.Customer(*, id: str, first_name: str, last_name: str, address: Address, mailing_address: Address, is_foreign: bool, usa_citizenship_type: str, mobile_phone_number: str, birth_date: date, email: str, tax_number_type: str, subject_to_tax_withholding: bool, has_industry_affiliation: bool, has_listed_affiliation: bool, has_political_affiliation: bool, has_delayed_quotes: bool, has_pending_or_approved_application: bool, is_professional: bool, permitted_account_types: list[CustomerAccountType], created_at: datetime, first_surname: str | None =
None, customer_suitability: CustomerSuitability | None =None, regulatory_domain: str | None =None, home_phone_number: str | None =None, work_phone_number: str | None =None, external_id: str | None =None, tax_number: str | None =None, citizenship_country: str | None =None, agreed_to_margining: bool | None =None, agreed_to_terms: bool | None =None, ext_crm_id: str | None =None, identifiable_type: str | None =None, person: CustomerPerson | None =None, gender: str | None =None, middle_name: str | None =None, prefix_name: str | None =None, second_surname: str | None =None, suffix_name: str | None =None, foreign_tax_number: str | None =None, birth_country: str | None =None, visa_expiration_date: date | None =None, visa_type: str | None =None, signature_of_agreement: bool | None =None, desk_customer_id: str | None =None, entity: CustomerEntity | None =None, family_member_names: str | None =None, has_institutional_assets: str | bool | None =None, industry_affiliation_firm: str | None =None, is_investment_adviser: bool | None =None, listed_affiliation_symbol: str | None =None, political_organization: str | None =None, user_id: str | None =None)¶ Bases:
TastytradeDataDataclass containing customer information.
Show JSON schema
{ "title": "Customer", "description": "Dataclass containing customer information.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "first-name": { "title": "First-Name", "type": "string" }, "last-name": { "title": "Last-Name", "type": "string" }, "address": { "$ref": "#/$defs/Address" }, "mailing-address": { "$ref": "#/$defs/Address" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "usa-citizenship-type": { "title": "Usa-Citizenship-Type", "type": "string" }, "mobile-phone-number": { "title": "Mobile-Phone-Number", "type": "string" }, "birth-date": { "format": "date", "title": "Birth-Date", "type": "string" }, "email": { "title": "Email", "type": "string" }, "tax-number-type": { "title": "Tax-Number-Type", "type": "string" }, "subject-to-tax-withholding": { "title": "Subject-To-Tax-Withholding", "type": "boolean" }, "has-industry-affiliation": { "title": "Has-Industry-Affiliation", "type": "boolean" }, "has-listed-affiliation": { "title": "Has-Listed-Affiliation", "type": "boolean" }, "has-political-affiliation": { "title": "Has-Political-Affiliation", "type": "boolean" }, "has-delayed-quotes": { "title": "Has-Delayed-Quotes", "type": "boolean" }, "has-pending-or-approved-application": { "title": "Has-Pending-Or-Approved-Application", "type": "boolean" }, "is-professional": { "title": "Is-Professional", "type": "boolean" }, "permitted-account-types": { "items": { "$ref": "#/$defs/CustomerAccountType" }, "title": "Permitted-Account-Types", "type": "array" }, "created-at": { "format": "date-time", "title": "Created-At", "type": "string" }, "first-surname": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "First-Surname" }, "customer-suitability": { "anyOf": [ { "$ref": "#/$defs/CustomerSuitability" }, { "type": "null" } ], "default": null }, "regulatory-domain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Regulatory-Domain" }, "home-phone-number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Home-Phone-Number" }, "work-phone-number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Work-Phone-Number" }, "external-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "External-Id" }, "tax-number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tax-Number" }, "citizenship-country": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Citizenship-Country" }, "agreed-to-margining": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Agreed-To-Margining" }, "agreed-to-terms": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Agreed-To-Terms" }, "ext-crm-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ext-Crm-Id" }, "identifiable-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Identifiable-Type" }, "person": { "anyOf": [ { "$ref": "#/$defs/CustomerPerson" }, { "type": "null" } ], "default": null }, "gender": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Gender" }, "middle-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Middle-Name" }, "prefix-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix-Name" }, "second-surname": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Second-Surname" }, "suffix-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Suffix-Name" }, "foreign-tax-number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Foreign-Tax-Number" }, "birth-country": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Birth-Country" }, "visa-expiration-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Visa-Expiration-Date" }, "visa-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Visa-Type" }, "signature-of-agreement": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Signature-Of-Agreement" }, "desk-customer-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Desk-Customer-Id" }, "entity": { "anyOf": [ { "$ref": "#/$defs/CustomerEntity" }, { "type": "null" } ], "default": null }, "family-member-names": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Family-Member-Names" }, "has-institutional-assets": { "anyOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Has-Institutional-Assets" }, "industry-affiliation-firm": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Industry-Affiliation-Firm" }, "is-investment-adviser": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Is-Investment-Adviser" }, "listed-affiliation-symbol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Listed-Affiliation-Symbol" }, "political-organization": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Political-Organization" }, "user-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "User-Id" } }, "$defs": { "Address": { "description": "Dataclass containing customer address information.", "properties": { "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "is-domestic": { "title": "Is-Domestic", "type": "boolean" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "postal-code": { "title": "Postal-Code", "type": "string" }, "state-region": { "title": "State-Region", "type": "string" }, "street-one": { "title": "Street-One", "type": "string" }, "street-two": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Two" }, "street-three": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Three" } }, "required": [ "city", "country", "is-domestic", "is-foreign", "postal-code", "state-region", "street-one" ], "title": "Address", "type": "object" }, "CustomerAccountMarginType": { "description": "Dataclass containing margin information for a customer account type.", "properties": { "name": { "title": "Name", "type": "string" }, "is-margin": { "title": "Is-Margin", "type": "boolean" } }, "required": [ "name", "is-margin" ], "title": "CustomerAccountMarginType", "type": "object" }, "CustomerAccountType": { "description": "Dataclass containing information for a type of customer account.", "properties": { "name": { "title": "Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "is-tax-advantaged": { "title": "Is-Tax-Advantaged", "type": "boolean" }, "is-publicly-available": { "title": "Is-Publicly-Available", "type": "boolean" }, "has-multiple-owners": { "title": "Has-Multiple-Owners", "type": "boolean" }, "margin-types": { "items": { "$ref": "#/$defs/CustomerAccountMarginType" }, "title": "Margin-Types", "type": "array" } }, "required": [ "name", "description", "is-tax-advantaged", "is-publicly-available", "has-multiple-owners", "margin-types" ], "title": "CustomerAccountType", "type": "object" }, "CustomerEntity": { "description": "Dataclass containing customer entity information.", "properties": { "id": { "title": "Id", "type": "string" }, "address": { "$ref": "#/$defs/Address" }, "business-nature": { "title": "Business-Nature", "type": "string" }, "email": { "title": "Email", "type": "string" }, "entity-officers": { "items": { "$ref": "#/$defs/EntityOfficer" }, "title": "Entity-Officers", "type": "array" }, "entity-suitability": { "$ref": "#/$defs/EntitySuitability" }, "entity-type": { "title": "Entity-Type", "type": "string" }, "foreign-institution": { "title": "Foreign-Institution", "type": "string" }, "grantor-birth-date": { "title": "Grantor-Birth-Date", "type": "string" }, "grantor-email": { "title": "Grantor-Email", "type": "string" }, "grantor-first-name": { "title": "Grantor-First-Name", "type": "string" }, "grantor-last-name": { "title": "Grantor-Last-Name", "type": "string" }, "grantor-middle-name": { "title": "Grantor-Middle-Name", "type": "string" }, "grantor-tax-number": { "title": "Grantor-Tax-Number", "type": "string" }, "has-foreign-bank-affiliation": { "title": "Has-Foreign-Bank-Affiliation", "type": "string" }, "has-foreign-institution-affiliation": { "title": "Has-Foreign-Institution-Affiliation", "type": "string" }, "is-domestic": { "title": "Is-Domestic", "type": "boolean" }, "legal-name": { "title": "Legal-Name", "type": "string" }, "phone-number": { "title": "Phone-Number", "type": "string" }, "tax-number": { "title": "Tax-Number", "type": "string" } }, "required": [ "id", "address", "business-nature", "email", "entity-officers", "entity-suitability", "entity-type", "foreign-institution", "grantor-birth-date", "grantor-email", "grantor-first-name", "grantor-last-name", "grantor-middle-name", "grantor-tax-number", "has-foreign-bank-affiliation", "has-foreign-institution-affiliation", "is-domestic", "legal-name", "phone-number", "tax-number" ], "title": "CustomerEntity", "type": "object" }, "CustomerPerson": { "description": "Dataclass containing customer person information.", "properties": { "external-id": { "title": "External-Id", "type": "string" }, "first-name": { "title": "First-Name", "type": "string" }, "last-name": { "title": "Last-Name", "type": "string" }, "citizenship-country": { "title": "Citizenship-Country", "type": "string" }, "usa-citizenship-type": { "title": "Usa-Citizenship-Type", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "occupation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Occupation" }, "middle-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Middle-Name" }, "prefix-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix-Name" }, "suffix-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Suffix-Name" }, "birth-country": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Birth-Country" }, "birth-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "string" }, { "type": "null" } ], "default": null, "title": "Birth-Date" }, "visa-expiration-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Visa-Expiration-Date" }, "visa-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Visa-Type" }, "employer-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Employer-Name" }, "job-title": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Job-Title" } }, "required": [ "external-id", "first-name", "last-name", "citizenship-country", "usa-citizenship-type", "employment-status", "marital-status", "number-of-dependents" ], "title": "CustomerPerson", "type": "object" }, "CustomerSuitability": { "description": "Dataclass containing customer suitability information.", "properties": { "id": { "title": "Id", "type": "integer" }, "annual-net-income": { "title": "Annual-Net-Income", "type": "integer" }, "covered-options-trading-experience": { "title": "Covered-Options-Trading-Experience", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "futures-trading-experience": { "title": "Futures-Trading-Experience", "type": "string" }, "liquid-net-worth": { "title": "Liquid-Net-Worth", "type": "integer" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "net-worth": { "title": "Net-Worth", "type": "integer" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "stock-trading-experience": { "title": "Stock-Trading-Experience", "type": "string" }, "uncovered-options-trading-experience": { "title": "Uncovered-Options-Trading-Experience", "type": "string" }, "customer-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Customer-Id" }, "employer-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Employer-Name" }, "job-title": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Job-Title" }, "occupation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Occupation" }, "tax-bracket": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tax-Bracket" } }, "required": [ "id", "annual-net-income", "covered-options-trading-experience", "employment-status", "futures-trading-experience", "liquid-net-worth", "marital-status", "net-worth", "number-of-dependents", "stock-trading-experience", "uncovered-options-trading-experience" ], "title": "CustomerSuitability", "type": "object" }, "EntityOfficer": { "description": "Dataclass containing entity officer information.", "properties": { "id": { "title": "Id", "type": "string" }, "external-id": { "title": "External-Id", "type": "string" }, "first-name": { "title": "First-Name", "type": "string" }, "last-name": { "title": "Last-Name", "type": "string" }, "middle-name": { "title": "Middle-Name", "type": "string" }, "prefix-name": { "title": "Prefix-Name", "type": "string" }, "suffix-name": { "title": "Suffix-Name", "type": "string" }, "address": { "$ref": "#/$defs/Address" }, "birth-country": { "title": "Birth-Country", "type": "string" }, "birth-date": { "format": "date", "title": "Birth-Date", "type": "string" }, "citizenship-country": { "title": "Citizenship-Country", "type": "string" }, "email": { "title": "Email", "type": "string" }, "employer-name": { "title": "Employer-Name", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "home-phone-number": { "title": "Home-Phone-Number", "type": "string" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "job-title": { "title": "Job-Title", "type": "string" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "mobile-phone-number": { "title": "Mobile-Phone-Number", "type": "string" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "occupation": { "title": "Occupation", "type": "string" }, "owner-of-record": { "title": "Owner-Of-Record", "type": "boolean" }, "relationship-to-entity": { "title": "Relationship-To-Entity", "type": "string" }, "tax-number": { "title": "Tax-Number", "type": "string" }, "tax-number-type": { "title": "Tax-Number-Type", "type": "string" }, "usa-citizenship-type": { "title": "Usa-Citizenship-Type", "type": "string" }, "visa-expiration-date": { "format": "date", "title": "Visa-Expiration-Date", "type": "string" }, "visa-type": { "title": "Visa-Type", "type": "string" }, "work-phone-number": { "title": "Work-Phone-Number", "type": "string" } }, "required": [ "id", "external-id", "first-name", "last-name", "middle-name", "prefix-name", "suffix-name", "address", "birth-country", "birth-date", "citizenship-country", "email", "employer-name", "employment-status", "home-phone-number", "is-foreign", "job-title", "marital-status", "mobile-phone-number", "number-of-dependents", "occupation", "owner-of-record", "relationship-to-entity", "tax-number", "tax-number-type", "usa-citizenship-type", "visa-expiration-date", "visa-type", "work-phone-number" ], "title": "EntityOfficer", "type": "object" }, "EntitySuitability": { "description": "Dataclass containing entity suitability information.", "properties": { "id": { "title": "Id", "type": "string" }, "annual-net-income": { "title": "Annual-Net-Income", "type": "integer" }, "covered-options-trading-experience": { "title": "Covered-Options-Trading-Experience", "type": "string" }, "entity-id": { "title": "Entity-Id", "type": "integer" }, "futures-trading-experience": { "title": "Futures-Trading-Experience", "type": "string" }, "liquid-net-worth": { "title": "Liquid-Net-Worth", "type": "integer" }, "net-worth": { "title": "Net-Worth", "type": "integer" }, "stock-trading-experience": { "title": "Stock-Trading-Experience", "type": "string" }, "tax-bracket": { "title": "Tax-Bracket", "type": "string" }, "uncovered-options-trading-experience": { "title": "Uncovered-Options-Trading-Experience", "type": "string" } }, "required": [ "id", "annual-net-income", "covered-options-trading-experience", "entity-id", "futures-trading-experience", "liquid-net-worth", "net-worth", "stock-trading-experience", "tax-bracket", "uncovered-options-trading-experience" ], "title": "EntitySuitability", "type": "object" } }, "required": [ "id", "first-name", "last-name", "address", "mailing-address", "is-foreign", "usa-citizenship-type", "mobile-phone-number", "birth-date", "email", "tax-number-type", "subject-to-tax-withholding", "has-industry-affiliation", "has-listed-affiliation", "has-political-affiliation", "has-delayed-quotes", "has-pending-or-approved-application", "is-professional", "permitted-account-types", "created-at" ] }- Fields:¶
- field birth_date : date [Required] (alias 'birth-date')¶
- field created_at : datetime [Required] (alias 'created-at')¶
-
field customer_suitability : CustomerSuitability | None =
None(alias 'customer-suitability')¶
-
field entity : CustomerEntity | None =
None¶
- field has_pending_or_approved_application : bool [Required] (alias 'has-pending-or-approved-application')¶
- field permitted_account_types : list[CustomerAccountType] [Required] (alias 'permitted-account-types')¶
-
field person : CustomerPerson | None =
None¶
- pydantic model tastytrade.session.CustomerAccountMarginType(*, name: str, is_margin: bool)¶
Bases:
TastytradeDataDataclass containing margin information for a customer account type.
Show JSON schema
{ "title": "CustomerAccountMarginType", "description": "Dataclass containing margin information for a customer account type.", "type": "object", "properties": { "name": { "title": "Name", "type": "string" }, "is-margin": { "title": "Is-Margin", "type": "boolean" } }, "required": [ "name", "is-margin" ] }- Fields:¶
- pydantic model tastytrade.session.CustomerAccountType(*, name: str, description: str, is_tax_advantaged: bool, is_publicly_available: bool, has_multiple_owners: bool, margin_types: list[CustomerAccountMarginType])¶
Bases:
TastytradeDataDataclass containing information for a type of customer account.
Show JSON schema
{ "title": "CustomerAccountType", "description": "Dataclass containing information for a type of customer account.", "type": "object", "properties": { "name": { "title": "Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "is-tax-advantaged": { "title": "Is-Tax-Advantaged", "type": "boolean" }, "is-publicly-available": { "title": "Is-Publicly-Available", "type": "boolean" }, "has-multiple-owners": { "title": "Has-Multiple-Owners", "type": "boolean" }, "margin-types": { "items": { "$ref": "#/$defs/CustomerAccountMarginType" }, "title": "Margin-Types", "type": "array" } }, "$defs": { "CustomerAccountMarginType": { "description": "Dataclass containing margin information for a customer account type.", "properties": { "name": { "title": "Name", "type": "string" }, "is-margin": { "title": "Is-Margin", "type": "boolean" } }, "required": [ "name", "is-margin" ], "title": "CustomerAccountMarginType", "type": "object" } }, "required": [ "name", "description", "is-tax-advantaged", "is-publicly-available", "has-multiple-owners", "margin-types" ] }- Fields:¶
- field margin_types : list[CustomerAccountMarginType] [Required] (alias 'margin-types')¶
- pydantic model tastytrade.session.CustomerEntity(*, id: str, address: Address, business_nature: str, email: str, entity_officers: list[EntityOfficer], entity_suitability: EntitySuitability, entity_type: str, foreign_institution: str, grantor_birth_date: str, grantor_email: str, grantor_first_name: str, grantor_last_name: str, grantor_middle_name: str, grantor_tax_number: str, has_foreign_bank_affiliation: str, has_foreign_institution_affiliation: str, is_domestic: bool, legal_name: str, phone_number: str, tax_number: str)¶
Bases:
TastytradeDataDataclass containing customer entity information.
Show JSON schema
{ "title": "CustomerEntity", "description": "Dataclass containing customer entity information.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "address": { "$ref": "#/$defs/Address" }, "business-nature": { "title": "Business-Nature", "type": "string" }, "email": { "title": "Email", "type": "string" }, "entity-officers": { "items": { "$ref": "#/$defs/EntityOfficer" }, "title": "Entity-Officers", "type": "array" }, "entity-suitability": { "$ref": "#/$defs/EntitySuitability" }, "entity-type": { "title": "Entity-Type", "type": "string" }, "foreign-institution": { "title": "Foreign-Institution", "type": "string" }, "grantor-birth-date": { "title": "Grantor-Birth-Date", "type": "string" }, "grantor-email": { "title": "Grantor-Email", "type": "string" }, "grantor-first-name": { "title": "Grantor-First-Name", "type": "string" }, "grantor-last-name": { "title": "Grantor-Last-Name", "type": "string" }, "grantor-middle-name": { "title": "Grantor-Middle-Name", "type": "string" }, "grantor-tax-number": { "title": "Grantor-Tax-Number", "type": "string" }, "has-foreign-bank-affiliation": { "title": "Has-Foreign-Bank-Affiliation", "type": "string" }, "has-foreign-institution-affiliation": { "title": "Has-Foreign-Institution-Affiliation", "type": "string" }, "is-domestic": { "title": "Is-Domestic", "type": "boolean" }, "legal-name": { "title": "Legal-Name", "type": "string" }, "phone-number": { "title": "Phone-Number", "type": "string" }, "tax-number": { "title": "Tax-Number", "type": "string" } }, "$defs": { "Address": { "description": "Dataclass containing customer address information.", "properties": { "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "is-domestic": { "title": "Is-Domestic", "type": "boolean" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "postal-code": { "title": "Postal-Code", "type": "string" }, "state-region": { "title": "State-Region", "type": "string" }, "street-one": { "title": "Street-One", "type": "string" }, "street-two": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Two" }, "street-three": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Three" } }, "required": [ "city", "country", "is-domestic", "is-foreign", "postal-code", "state-region", "street-one" ], "title": "Address", "type": "object" }, "EntityOfficer": { "description": "Dataclass containing entity officer information.", "properties": { "id": { "title": "Id", "type": "string" }, "external-id": { "title": "External-Id", "type": "string" }, "first-name": { "title": "First-Name", "type": "string" }, "last-name": { "title": "Last-Name", "type": "string" }, "middle-name": { "title": "Middle-Name", "type": "string" }, "prefix-name": { "title": "Prefix-Name", "type": "string" }, "suffix-name": { "title": "Suffix-Name", "type": "string" }, "address": { "$ref": "#/$defs/Address" }, "birth-country": { "title": "Birth-Country", "type": "string" }, "birth-date": { "format": "date", "title": "Birth-Date", "type": "string" }, "citizenship-country": { "title": "Citizenship-Country", "type": "string" }, "email": { "title": "Email", "type": "string" }, "employer-name": { "title": "Employer-Name", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "home-phone-number": { "title": "Home-Phone-Number", "type": "string" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "job-title": { "title": "Job-Title", "type": "string" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "mobile-phone-number": { "title": "Mobile-Phone-Number", "type": "string" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "occupation": { "title": "Occupation", "type": "string" }, "owner-of-record": { "title": "Owner-Of-Record", "type": "boolean" }, "relationship-to-entity": { "title": "Relationship-To-Entity", "type": "string" }, "tax-number": { "title": "Tax-Number", "type": "string" }, "tax-number-type": { "title": "Tax-Number-Type", "type": "string" }, "usa-citizenship-type": { "title": "Usa-Citizenship-Type", "type": "string" }, "visa-expiration-date": { "format": "date", "title": "Visa-Expiration-Date", "type": "string" }, "visa-type": { "title": "Visa-Type", "type": "string" }, "work-phone-number": { "title": "Work-Phone-Number", "type": "string" } }, "required": [ "id", "external-id", "first-name", "last-name", "middle-name", "prefix-name", "suffix-name", "address", "birth-country", "birth-date", "citizenship-country", "email", "employer-name", "employment-status", "home-phone-number", "is-foreign", "job-title", "marital-status", "mobile-phone-number", "number-of-dependents", "occupation", "owner-of-record", "relationship-to-entity", "tax-number", "tax-number-type", "usa-citizenship-type", "visa-expiration-date", "visa-type", "work-phone-number" ], "title": "EntityOfficer", "type": "object" }, "EntitySuitability": { "description": "Dataclass containing entity suitability information.", "properties": { "id": { "title": "Id", "type": "string" }, "annual-net-income": { "title": "Annual-Net-Income", "type": "integer" }, "covered-options-trading-experience": { "title": "Covered-Options-Trading-Experience", "type": "string" }, "entity-id": { "title": "Entity-Id", "type": "integer" }, "futures-trading-experience": { "title": "Futures-Trading-Experience", "type": "string" }, "liquid-net-worth": { "title": "Liquid-Net-Worth", "type": "integer" }, "net-worth": { "title": "Net-Worth", "type": "integer" }, "stock-trading-experience": { "title": "Stock-Trading-Experience", "type": "string" }, "tax-bracket": { "title": "Tax-Bracket", "type": "string" }, "uncovered-options-trading-experience": { "title": "Uncovered-Options-Trading-Experience", "type": "string" } }, "required": [ "id", "annual-net-income", "covered-options-trading-experience", "entity-id", "futures-trading-experience", "liquid-net-worth", "net-worth", "stock-trading-experience", "tax-bracket", "uncovered-options-trading-experience" ], "title": "EntitySuitability", "type": "object" } }, "required": [ "id", "address", "business-nature", "email", "entity-officers", "entity-suitability", "entity-type", "foreign-institution", "grantor-birth-date", "grantor-email", "grantor-first-name", "grantor-last-name", "grantor-middle-name", "grantor-tax-number", "has-foreign-bank-affiliation", "has-foreign-institution-affiliation", "is-domestic", "legal-name", "phone-number", "tax-number" ] }- Fields:¶
- field entity_officers : list[EntityOfficer] [Required] (alias 'entity-officers')¶
- field entity_suitability : EntitySuitability [Required] (alias 'entity-suitability')¶
-
pydantic model tastytrade.session.CustomerPerson(*, external_id: str, first_name: str, last_name: str, citizenship_country: str, usa_citizenship_type: str, employment_status: str, marital_status: str, number_of_dependents: int, occupation: str | None =
None, middle_name: str | None =None, prefix_name: str | None =None, suffix_name: str | None =None, birth_country: str | None =None, birth_date: date | str | None =None, visa_expiration_date: date | None =None, visa_type: str | None =None, employer_name: str | None =None, job_title: str | None =None)¶ Bases:
TastytradeDataDataclass containing customer person information.
Show JSON schema
{ "title": "CustomerPerson", "description": "Dataclass containing customer person information.", "type": "object", "properties": { "external-id": { "title": "External-Id", "type": "string" }, "first-name": { "title": "First-Name", "type": "string" }, "last-name": { "title": "Last-Name", "type": "string" }, "citizenship-country": { "title": "Citizenship-Country", "type": "string" }, "usa-citizenship-type": { "title": "Usa-Citizenship-Type", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "occupation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Occupation" }, "middle-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Middle-Name" }, "prefix-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix-Name" }, "suffix-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Suffix-Name" }, "birth-country": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Birth-Country" }, "birth-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "string" }, { "type": "null" } ], "default": null, "title": "Birth-Date" }, "visa-expiration-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Visa-Expiration-Date" }, "visa-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Visa-Type" }, "employer-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Employer-Name" }, "job-title": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Job-Title" } }, "required": [ "external-id", "first-name", "last-name", "citizenship-country", "usa-citizenship-type", "employment-status", "marital-status", "number-of-dependents" ] }- Fields:¶
-
pydantic model tastytrade.session.CustomerSuitability(*, id: int, annual_net_income: int, covered_options_trading_experience: str, employment_status: str, futures_trading_experience: str, liquid_net_worth: int, marital_status: str, net_worth: int, number_of_dependents: int, stock_trading_experience: str, uncovered_options_trading_experience: str, customer_id: str | None =
None, employer_name: str | None =None, job_title: str | None =None, occupation: str | None =None, tax_bracket: str | None =None)¶ Bases:
TastytradeDataDataclass containing customer suitability information.
Show JSON schema
{ "title": "CustomerSuitability", "description": "Dataclass containing customer suitability information.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "annual-net-income": { "title": "Annual-Net-Income", "type": "integer" }, "covered-options-trading-experience": { "title": "Covered-Options-Trading-Experience", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "futures-trading-experience": { "title": "Futures-Trading-Experience", "type": "string" }, "liquid-net-worth": { "title": "Liquid-Net-Worth", "type": "integer" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "net-worth": { "title": "Net-Worth", "type": "integer" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "stock-trading-experience": { "title": "Stock-Trading-Experience", "type": "string" }, "uncovered-options-trading-experience": { "title": "Uncovered-Options-Trading-Experience", "type": "string" }, "customer-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Customer-Id" }, "employer-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Employer-Name" }, "job-title": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Job-Title" }, "occupation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Occupation" }, "tax-bracket": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tax-Bracket" } }, "required": [ "id", "annual-net-income", "covered-options-trading-experience", "employment-status", "futures-trading-experience", "liquid-net-worth", "marital-status", "net-worth", "number-of-dependents", "stock-trading-experience", "uncovered-options-trading-experience" ] }- Fields:¶
- pydantic model tastytrade.session.EntityOfficer(*, id: str, external_id: str, first_name: str, last_name: str, middle_name: str, prefix_name: str, suffix_name: str, address: Address, birth_country: str, birth_date: date, citizenship_country: str, email: str, employer_name: str, employment_status: str, home_phone_number: str, is_foreign: bool, job_title: str, marital_status: str, mobile_phone_number: str, number_of_dependents: int, occupation: str, owner_of_record: bool, relationship_to_entity: str, tax_number: str, tax_number_type: str, usa_citizenship_type: str, visa_expiration_date: date, visa_type: str, work_phone_number: str)¶
Bases:
TastytradeDataDataclass containing entity officer information.
Show JSON schema
{ "title": "EntityOfficer", "description": "Dataclass containing entity officer information.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "external-id": { "title": "External-Id", "type": "string" }, "first-name": { "title": "First-Name", "type": "string" }, "last-name": { "title": "Last-Name", "type": "string" }, "middle-name": { "title": "Middle-Name", "type": "string" }, "prefix-name": { "title": "Prefix-Name", "type": "string" }, "suffix-name": { "title": "Suffix-Name", "type": "string" }, "address": { "$ref": "#/$defs/Address" }, "birth-country": { "title": "Birth-Country", "type": "string" }, "birth-date": { "format": "date", "title": "Birth-Date", "type": "string" }, "citizenship-country": { "title": "Citizenship-Country", "type": "string" }, "email": { "title": "Email", "type": "string" }, "employer-name": { "title": "Employer-Name", "type": "string" }, "employment-status": { "title": "Employment-Status", "type": "string" }, "home-phone-number": { "title": "Home-Phone-Number", "type": "string" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "job-title": { "title": "Job-Title", "type": "string" }, "marital-status": { "title": "Marital-Status", "type": "string" }, "mobile-phone-number": { "title": "Mobile-Phone-Number", "type": "string" }, "number-of-dependents": { "title": "Number-Of-Dependents", "type": "integer" }, "occupation": { "title": "Occupation", "type": "string" }, "owner-of-record": { "title": "Owner-Of-Record", "type": "boolean" }, "relationship-to-entity": { "title": "Relationship-To-Entity", "type": "string" }, "tax-number": { "title": "Tax-Number", "type": "string" }, "tax-number-type": { "title": "Tax-Number-Type", "type": "string" }, "usa-citizenship-type": { "title": "Usa-Citizenship-Type", "type": "string" }, "visa-expiration-date": { "format": "date", "title": "Visa-Expiration-Date", "type": "string" }, "visa-type": { "title": "Visa-Type", "type": "string" }, "work-phone-number": { "title": "Work-Phone-Number", "type": "string" } }, "$defs": { "Address": { "description": "Dataclass containing customer address information.", "properties": { "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "is-domestic": { "title": "Is-Domestic", "type": "boolean" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "postal-code": { "title": "Postal-Code", "type": "string" }, "state-region": { "title": "State-Region", "type": "string" }, "street-one": { "title": "Street-One", "type": "string" }, "street-two": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Two" }, "street-three": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Street-Three" } }, "required": [ "city", "country", "is-domestic", "is-foreign", "postal-code", "state-region", "street-one" ], "title": "Address", "type": "object" } }, "required": [ "id", "external-id", "first-name", "last-name", "middle-name", "prefix-name", "suffix-name", "address", "birth-country", "birth-date", "citizenship-country", "email", "employer-name", "employment-status", "home-phone-number", "is-foreign", "job-title", "marital-status", "mobile-phone-number", "number-of-dependents", "occupation", "owner-of-record", "relationship-to-entity", "tax-number", "tax-number-type", "usa-citizenship-type", "visa-expiration-date", "visa-type", "work-phone-number" ] }- Fields:¶
- field birth_date : date [Required] (alias 'birth-date')¶
- field visa_expiration_date : date [Required] (alias 'visa-expiration-date')¶
- pydantic model tastytrade.session.EntitySuitability(*, id: str, annual_net_income: int, covered_options_trading_experience: str, entity_id: int, futures_trading_experience: str, liquid_net_worth: int, net_worth: int, stock_trading_experience: str, tax_bracket: str, uncovered_options_trading_experience: str)¶
Bases:
TastytradeDataDataclass containing entity suitability information.
Show JSON schema
{ "title": "EntitySuitability", "description": "Dataclass containing entity suitability information.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "annual-net-income": { "title": "Annual-Net-Income", "type": "integer" }, "covered-options-trading-experience": { "title": "Covered-Options-Trading-Experience", "type": "string" }, "entity-id": { "title": "Entity-Id", "type": "integer" }, "futures-trading-experience": { "title": "Futures-Trading-Experience", "type": "string" }, "liquid-net-worth": { "title": "Liquid-Net-Worth", "type": "integer" }, "net-worth": { "title": "Net-Worth", "type": "integer" }, "stock-trading-experience": { "title": "Stock-Trading-Experience", "type": "string" }, "tax-bracket": { "title": "Tax-Bracket", "type": "string" }, "uncovered-options-trading-experience": { "title": "Uncovered-Options-Trading-Experience", "type": "string" } }, "required": [ "id", "annual-net-income", "covered-options-trading-experience", "entity-id", "futures-trading-experience", "liquid-net-worth", "net-worth", "stock-trading-experience", "tax-bracket", "uncovered-options-trading-experience" ] }- Fields:¶
-
class tastytrade.session.Session(provider_secret: str | None =
None, refresh_token: str | None =None, is_test: bool =False, **client_kwargs: Any)¶ Bases:
AsyncContextManagerMixinContains a managed user login which can then be used to interact with the remote API.
Prefer using with its async context manager to ensure proper cleanup.
- Parameters:¶
- provider_secret: str | None =
None¶ OAuth secret for your provider; defaults to the $TT_SECRET environment variable
- refresh_token: str | None =
None¶ refresh token for the user; defaults to the $TT_REFRESH environment variable
- is_test: bool =
False¶ whether to use the test API endpoints, default False
- **client_kwargs: Any¶
additional keyword arguments to pass to the httpx AsyncClient, such as
timeout
- provider_secret: str | None =
- classmethod deserialize(serialized: str) Self¶
Create a new Session object from a serialized string.
- is_test¶
Whether this is a cert or real session
- provider_secret¶
OAuth secret for your provider
-
async refresh(force: bool =
False) None¶ Manually trigger a refresh of the session token.
Usually unnecessary, unless you want to make sure sessions are “pre-warmed” prior to making a request for improved latency.
- refresh_token¶
Refresh token for the user
- serialize() str¶
Serializes the session to a string, useful for storing a session for later use. Could be used with pickle, Redis, etc. Only sessions with JSON serializable client_kwargs can be serialized.
- session_expiration¶
timestamp that the session will expire
- session_token¶
token used for authentication