You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not following guidelines may result in your bug being ignored and/or closed.
Description of Bug
client.get_transaction(acctId, txnId) returns not found although txnId is definitely valid.
Note, however client.get_transaction(acctId, '') works
Code to Reproduce
### Get valid txnIds from get_transactions - this function is working
r = client.get_transactions(config.account_number,
transaction_type= client.Transactions.TransactionType.ALL,
start_date= datetime.date(2020, 12, 29),
end_date= datetime.date(2020, 12, 29))
print(json.dumps(r.json(), indent=4))
### use a txnId to put into get_transaction
ID = r.json()[0]['transactionId']
# print(f'*'*20)
# print(f'ID = {ID}') # to make sure it got a valid transactionId
# print(f'*'*20)
r = client.get_transaction(config.account_number, ID)
print(r)
print(json.dumps(r.json(), indent=4))
### BEGIN REDACTED LOGS ###
[debug.py:163:_enable_bug_report_logging] tda-api version 1.3.2
[auth.py:37:load_token] Loading token from file token
[auth.py:153:from_loaded_token] Loaded metadata aware token with creation timestamp 1619697675
[auth.py:56:__normalize_api_key] Appending @AMER.OAUTHAP to API key
[auth.py:418:easy_client] Returning client loaded from token file 'token'
[auth.py:207:ensure_refresh_token_update] Updating refresh token:
- Current timestamp is 1622220982
- Token creation timestamp is 1619697675
- Update interval is 7344000 seconds
[auth.py:217:ensure_refresh_token_update] Skipping refresh token update
[synchronous.py:14:_get_request] Req 1: GET to https://api.tdameritrade.com/v1/accounts/<REDACTED 0-transactionItem-accountId>/transactions, params={
"apikey": "<REDACTED API_KEY>",
"type": "ALL",
"startDate": "2020-12-29",
"endDate": "2020-12-29"
}
[base.py:59:_log_response] Req 1: GET response: 200, content=[ {
"type" : "TRADE",
"subAccount" : "2",
"settlementDate" : "2020-12-31",
"orderId" : "<REDACTED 0-orderId>",
"netAmount" : ,REDACTED>,
"transactionDate" : "2020-12-29T15:13:35+0000",
"orderDate" : "2020-12-29T15:01:24+0000",
"transactionSubType" : "BY",
"transactionId" : <REDACTED 0-transactionId>,
"cashBalanceEffectFlag" : true,
"description" : "BUY TRADE",
"fees" : {
"rFee" : 0.0,
"additionalFee" : 0.0,
"cdscFee" : 0.0,
"regFee" : 0.0,
"otherCharges" : 0.0,
"commission" : 0.0,
"optRegFee" : 0.0,
"secFee" : 0.0
},
"transactionItem" : {
"accountId" : <REDACTED 0-transactionItem-accountId>,
"amount" : <REDACTED>,
"price" : <REDACTED>,
"cost" : <REDACTED>,
"instruction" : "BUY",
"instrument" : {
"symbol" : “REDACTED TICKER”,
"cusip" : “REDACTED”,
"assetType" : "EQUITY"
}
}
} ]
[auth.py:207:ensure_refresh_token_update] Updating refresh token:
- Current timestamp is 1622220983
- Token creation timestamp is 1619697675
- Update interval is 7344000 seconds
[auth.py:217:ensure_refresh_token_update] Skipping refresh token update
[synchronous.py:14:_get_request] Req 2: GET to https://api.tdameritrade.com/v1/accounts/<REDACTED 0-transactionItem-accountId>/transactions/<REDACTED 0-transactionId>, params={
"apikey": "<REDACTED API_KEY>"
}
[base.py:59:_log_response] Req 2: GET response: 404, content={
"error" : "Not Found"
}
Expected Behavior
Returns specific txn info of txnId
Actual Behavior
Error: Not found
Note that get_transaction(acctId, '') works. So, I suspect it may be the way a txnId is entered as an integer/ string that could be the problem. I've also tried typing int(txnId), str(txnId) - don't work
Please read the bug submission guidelines before submitting a bug.
Not following guidelines may result in your bug being ignored and/or closed.
Description of Bug
client.get_transaction(acctId, txnId)
returns not found although txnId is definitely valid.Note, however
client.get_transaction(acctId, '')
worksCode to Reproduce
Expected Behavior
Returns specific txn info of txnId
Actual Behavior
Error: Not found
Note that
get_transaction(acctId, '')
works. So, I suspect it may be the way a txnId is entered as an integer/ string that could be the problem. I've also tried typingint(txnId)
,str(txnId)
- don't workError/Exception Log, If Applicable
See here to learn how to turn on debug logging: https://tda-api.readthedocs.io/en/latest/help.html
The text was updated successfully, but these errors were encountered: