mbank-cli
mbank-cli copied to clipboard
New history view
In May, mBank announced that they would be phasing out the old history view: https://www.mbank.pl/mbank-news/co-nowego/pokazemy-nowa-historie-operacji.html
The new history view is not feature complete yet, but it would be prudent to start the porting work now. Hopefully they won't change API too much in the mean time.
The date of arrival in unknown, and apparently user-dependent!? They say:
We will change the history feature gradually; we will send a message to each of you with a specific date.
What the hell… FWIW, I haven't received such a message yet.
They haven't activated it for me too. Looks quite promising. If they added eksport to elixir compatible csv format, it would be great.
I've looked at the HTTP traffic, and it looks pretty good. I expect to have a working prototype in a few days.
Adventurous users can try the history2
command from the pu/84
branch.
There's no paging implemented yet, so you'll be shown at most 25 transactions.
I've just implemented paging.
I've got earlier mentioned url (https://www.mbank.pl/mbank-news/co-nowego/pokazemy-nowa-historie-operacji.html) in my mbank account panel. New history means the old one stops working? Is there csv export feature in new history implementation on mbank-cli side?
I've got a notice in the web UI about it today too. They say: as of October 21*, all the history features will be in one place.
* October 21 = next Monday
New history means the old one stops working?
I guess so.
Is there csv export feature in new history implementation on mbank-cli side?
No. I don't have this feature in the web UI yet.
I didn't include the "Category" column, as I don't find it useful. Let me know if you need it.
The output currently looks like this:
card-pending 2019-10-19 -11.53 PLN Apteka Prywatna
xfer 2019-10-18 -30.95 PLN mTransfer
xfer 2019-10-02 50.01 PLN JAKUB WILK, PRZELEW ŚRODKÓW
card 2019-09-25 -14.96 PLN SKLEP OGÓLNOSPOŻYWCZY
other 2019-09-01 -0.01 PLN PODATEK OD ODSETEK KAPITAŁOWYCH
other 2019-09-01 0.01 PLN KAPITALIZACJA ODSETEK
Yes, it says only mTransfer
. This is all that is available.
To get more details, we would need to make an extra request for each history item. ☹
They say: as of October 21*, all the history features will be in one place.
It's October 21 already, but it doesn't look like anything has changed.
Maybe they have postponed history changes?
They've changed history view on my account!
... and export to csv in mbank-cli still works so far ;-)
... and export to csv in mbank-cli still works so far ;-)
Probably they allow to use two history export mechanism for now, because it looks like it has completely changed.
History export conversation looks like below:
- Send request to https://online.mbank.pl/pl/Pfm/HistoryApi/GetHostInitialData.
- We get the following reply:
{"hostProducts":[{"id":"","contractNumber":"38114020040000380231502494","name":"mBiznes konto","productName":"mBiznes konto","subTitle":"","isSelected":false,"isInPfm":false,"isInHost":true,"contractCurrency":"PLN","contractAlias":"cZU0orqAq8WOzfK+hkvdUdKSYENb5p5N8TCjxILNMEYCcFGyVTJHU08KPT8ty1JtOnFamKb1kReoA0cptx7TlA==","productType":null},{"id":"","contractNumber":"43114020040000370300261970","name":"mBiznes Konto VAT","productName":"mBiznes Konto VAT","subTitle":"","isSelected":false,"isInPfm":false,"isInHost":true,"contractCurrency":"PLN","contractAlias":"E+kpebx0y7lOgMuTspLIWbnSFjHK0c6/rv9ewWlbC9Fn8k1qv2okyStPrW8CyFeUYvmKZgvjPKaNTakxbo3fsw==","productType":null},{"id":"","contractNumber":"82114020040000330231502529","name":"mBiznes max","productName":"mBiznes max","subTitle":"","isSelected":false,"isInPfm":false,"isInHost":true,"contractCurrency":"PLN","contractAlias":"oyVCsGnztUxVwgS6J1lXGNpUUwELeRCYgvdveS5xPm/ORV5nysJ5ytvspaOKL/tKBdUGxfSqVmsdt5V6PkxdCQ==","productType":null}],"hostTransactionTypes":[{"value":"ALL000000","label":"Wszystkie","isSelected":false,"subtypes":[]},{"value":"ABO000000","label":"Uznania rachunku","isSelected":false,"subtypes":[]},{"value":"CAR000000","label":"Obciążenia rachunku","isSelected":false,"subtypes":[]},{"value":"TRI111000","label":"Przelewy przychodzące","isSelected":false,"subtypes":[]},{"value":"TRO111000","label":"Przelewy wychodzące","isSelected":false,"subtypes":[]},{"value":"TIH111000","label":"Przelewy własne","isSelected":false,"subtypes":[]},{"value":"TUS111000","label":"Przelewy podatkowe","isSelected":false,"subtypes":[]},{"value":"TRZ101000","label":"Przelewy do ZUS","isSelected":false,"subtypes":[]},{"value":"LDS100000","label":"Operacje kartowe","isSelected":false,"subtypes":[]},{"value":"CRE100000","label":"Operacje na kredycie","isSelected":false,"subtypes":[]},{"value":"CAI100000","label":"Wpłaty gotówkowe","isSelected":false,"subtypes":[]},{"value":"INT000000","label":"Kapitalizacja odsetek","isSelected":false,"subtypes":[]},{"value":"COM100000","label":"Prowizje i opłaty","isSelected":false,"subtypes":[]},{"value":"TDI111000","label":"Przelew z/na r-ek brokerski","isSelected":false,"subtypes":[]},{"value":"TRS000000","label":"Regularne oszczędzanie","isSelected":false,"subtypes":[]}],"nmbDesktopOperationId":null,"redirectedOperationDataForDetails":null,"shouldOverWiteLocalStorage":false}
- We send export history request to https://online.mbank.pl/pl/Pfm/HistoryApi/GetHostTransactionsSummary with json encoded data:
{"accountNumber":"cZU0orqAq8WOzfK+hkvdUdKSYENb5p5N8TCjxILNMEYCcFGyVTJHU08KPT8ty1JtOnFamKb1kReoA0cptx7TlA==","dateFrom":"2019-07-20T22:00:00.000Z","dateTo":"2019-10-20T22:00:00.000Z","saveFileType":"CSV"}
- We get reply with csv history!
They've deployed the new thing for me too. It looks like they revamped it more than I anticipated, so the code I wrote so far won't be very useful.
"dateFrom":"2019-07-20T22:00:00.000Z"
What the hell. So this is UTC timestamp, but it points to midnight in the local time zone. I wonder what happens when the client's and server's local time zones don't match…
Curiously, both previous history views still work.
Perhaps they kept the old APIs around, because the new history view hasn't been enabled for everyone yet?
ETA: tomorrow morning
I've implemented new export. Check out branch pu/84
, command history2019
.
It took way more time than expected, so I'm unlikely to finish this up in the morning.
Wow - thanks a lot for great job! ;-)
For me `history2019' works as should!
I have now implemented the non-export parts for history2019
.
I've now merged the history2019
command into master.
I'm not sure how to proceed.
On one hand I feel nervous about using the old API, which is normally inaccessible in a web browser. On the other hand, the lack of mTransfer details is a deal breaker for me. ☹