studerw/td-ameritrade-client

New issue with retrieving transaction history

karthik134 opened this issue · 5 comments

For me, Transaction API history is failing with the below error.

try { transactions = client.fetchTransactions(accountId, request); } catch (Exception e) { e.printStackTrace();}

LoggingInterceptor.intercept INFO - REQUEST GET: https://api.tdameritrade.com/v1/accounts/accountId/transactions?startDate=2021-01-30&endDate=2021-05-10
LoggingInterceptor.intercept INFO - RESPONSE [200 - OK]: https://api.tdameritrade.com/v1/accounts/accountId/transactions?startDate=2021-01-30&endDate=2021-05-10 in 488.0 ms
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type com.studerw.tda.model.transaction.Transaction$AchStatus from String "Approved": not one of the values accepted for Enum class: [ERROR, CANCEL, REJECTED, APPROVED]
at [Source: (BufferedInputStream); line: 6696, column: 17] (through reference chain: java.util.ArrayList[206]->com.studerw.tda.model.transaction.Transaction["achStatus"])
at com.studerw.tda.parse.DefaultMapper.fromJson(DefaultMapper.java:91)

@karthik134 What version are you using?

@studerw Version is 2.4.0. Also, I just noticed that it works for one account but does not work for another account.

By the way, thank you for putting together this API. This is a great library and gives a good headstart for implementing in Java.

@karthik134 I pushed a fix that I hope works. You will have to checkout the source yourself and build it, e.g. mvn clean install. This will install version 2.4.1-SNAPSHOT into your local maven / gradle repo. Then in your own project, change to this version ,e.g.

<dependency>
   <groupId>com.studerw.tda</groupId>
   <artifactId>td-ameritrade-client</artifactId>
   <version>2.4.1-SNAPSHOT</version>
 </dependency>

I will eventually release this as 2.4.1 if it works.

Thanks @studerw , I will checkout and test today and confirm. Appreciate the quick turnaround.

@studerw , sorry for the delay, I just tested the 2.4.1 release and it fixed the issue. Thanks again for the quick fix.