fhqvst / avanza

A JavaScript client for the unofficial Avanza API
MIT License
229 stars 59 forks source link

Can't place orders #77

Closed bellbrant closed 1 year ago

bellbrant commented 2 years ago

After avanzas update i can't place any orders anymore. "Method is unallowed"

Is there something we need to add regarding placing orders?

dichai1983 commented 2 years ago

Screenshot_2022-05-25-22-02-44-96_320a9a695de7cdce83ed5281148d6f19.jpg

According to the latest commit of the python version, there seems to be 2 things that need to be fixed.

dichai1983 commented 2 years ago
  1. Create a new constant ORDER_PLACE_PATH = '/_cqbe/trading/order/new'
  2. Create a new constant ORDER_DELETE_PATH = '/_api/order'
  3. When you do placeOrder, the key of the orderType option should be side instead of orderType

I'll test the above things this Friday.

dichai1983 commented 2 years ago

Tested, and it worked. BTW, the status key in the response object has been changed to orderRequestStatus.

dichai1983 commented 2 years ago

Check out my fork: https://github.com/dichai1983/avanza-lib

dichai1983 commented 1 year ago

Avanza changed their order placing servlet URI again today :( I will look into it.

dichai1983 commented 1 year ago

Testing the new URI...

dichai1983 commented 1 year ago

It's been fixed in my fork.

fhqvst commented 1 year ago

Awesome @dichai1983! Feel free to submit a PR

bellbrant commented 1 year ago

Late response but awesome work!!