add option to query account details including personal data
The API so far does not read the account data from Traderepublic. A lot of this data is not that interesting and pretty static (name, address, etc). But there is also the main account including IBAN.
I need this for my own asset management application where I aggregate all the current/saving accounts from all my banks. To achieve this I added modules for each bank, they send the account information to the main app. Thus only the balance is not enough, at least IBAN is needed to sort things out for the main app.
I'm aware that returning the dict and writing out the JSON is not that much of a processing. Please consider adding this "anyway", change the code or tell me what I should add.
Addmittedly I'm pretty new to Python.
This is roughly what you will get:
{
"phoneNumber":"+491xxxx",
"jurisdiction":"DE",
"name":{"first":"xxxx", "last":"xxx"},
"email":{"address":"[email protected]", "verified":true},
"duplicateTradingEmail":null,
"postalAddress":{"street":"SomeStreet", "houseNo":"4", "zip":"123456", "city":"Somecity", "country":"DE"},
"birthdate":"1902-01-01",
"birthplace":{"birthplace":"Somecity", "birthcountry":"DE"},
"mainNationality":"DE",
"additionalNationalities":[],
"mainTaxResidency":{"tin":"12345987", "countryCode":"DE"},
"usTaxResidency":false,
"additionalTaxResidencies":[],
"taxInformationSyncTimestamp":172177300000,
"taxExemptionOrder":{"minimum":0, "maximum":9900, "current":111, "applied":2131, "syncStatus":12414, "validFrom":1242, "validUntil":2312},
"registrationAccount":false,
"cashAccount":{"iban":"DE00000000000000000000", "bic":"TRBKDEBBXXX", "bankName":"J.P. Morgan SE", "logoUrl":null},
"referenceAccount":{"iban":"-", "bic":null},
"referenceAccountV2":null,
"referenceAccountList":[{"iban":"DE00012134874564878747", "bic":null, "bankName":"Bank", "logoUrl":"logos/bank_bank/v2"}],
"securitiesAccountNumber":"321354657",
"experience":{"stock":{"tradeCount":0, "level":"LOSER", "showsRiskWarning":true},
"fund":{"tradeCount":0, "level":"LOSER", "showsRiskWarning":true},
"derivative":{"tradeCount":0, "level":"LOSER", "showsRiskWarning":true},
"crypto":{"tradeCount":100, "level":"GODMODE", "showsRiskWarning":true},
"bond":{"level":"xxxx", "showsRiskWarning":true}},
"referralDetails":null,
"supportDocuments":{
"accountClosing":"https://assets.traderepublic.com/assets/files/foilename.pdf",
"imprint":"https://traderepublic.com/de-de/imprint",
"addressConfirmation":"https://support.traderepublic.com/de-de/102"},
"tinFormat":{"placeholder":"99999999999",
"keyboardLayout":"numerical"
},
"personId":"babdbddb-5441-23-124-423423542532112"
}
Thanks for your review! I'm completely fine with what you requested.
Actually for me TradeRepublicApi.get_account_details() is all I need. You are right of course, Accountdetails is not needed as it doesn't do much as is. I wasn't aware writing or didn't think hard enough regarding writing the json to a file without a class.
Thus: Should I remove Accountdetails altogether because it's useless?
Thus: Should I remove
Accountdetailsaltogether because it's useless?
Yes, I think that's okay! If you care to invest the time, it would be nice to have a TypedDict description of the account details as well. (Can probably pipe the output you passed through an LLM and double check the result if you want).
I added the TypedDict with 1ce3145. But I really not sure if that's what you had in mind :face_with_peeking_eye: