Qluxzz / avanza

A Python library for the unofficial Avanza API
https://qluxzz.github.io/avanza/
MIT License
85 stars 40 forks source link

Update API endpoint for order place path #48

Closed tux2000 closed 2 years ago

tux2000 commented 2 years ago

Fixes #47

Return of this new endpoint is different from before:

{'orderRequestStatus': 'SUCCESS', 'message': '', 'orderId': 'NNNNNN'}
Qluxzz commented 2 years ago

Can you update the return model in the comment for place_order as well so it matches the new return type?

Qluxzz commented 2 years ago

Thank you both very much!

AmirEghbali commented 2 years ago

I just came across one thing. If place an order where "priset avviker bla bla" then there is no orderId returned. Worth checking so bad orders do not pile up.

Qluxzz commented 2 years ago

I just came across one thing. If place an order where "priset avviker bla bla" then there is no orderId returned. Worth checking so bad orders do not pile up.

So the different return models are

{'orderRequestStatus': 'SUCCESS', 'message': '', 'orderId': 'NNNNNN'}

and in the case that orderRequestStatus is not SUCCESS, the orderid field is not included?

{'orderRequestStatus': ''WHATEVER_NOT_SUCCESS_STATUS_IS", 'message': '' }

AmirEghbali commented 2 years ago

Yes You either get this if order has error

{'orderRequestStatus': 'ERROR', 'message': 'Du kan inte sälja ett större antal än du har. Kontrollera att du inte redan har en befintlig säljorder och att du försöker lägga din order på rätt konto.'}

or this if order does not have error

{'orderRequestStatus': 'SUCCESS', 'message': '', 'orderId': 'xxxxxxxx'}

On Fri, Feb 18, 2022 at 12:23 PM André Andersson @.***> wrote:

I just came across one thing. If place an order where "priset avviker bla bla" then there is no orderId returned. Worth checking so bad orders do not pile up.

So the different return models are

{'orderRequestStatus': 'SUCCESS', 'message': '', 'orderId': 'NNNNNN'}

and in the case that orderRequestStatus is not SUCCESS, the orderid field is not included?

{'orderRequestStatus': ''WHATEVER_NOT_SUCCESS_STATUS_IS", 'message': '' }

— Reply to this email directly, view it on GitHub https://github.com/Qluxzz/avanza/pull/48#issuecomment-1044366627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUD4ZL7ONTTESXXJQJBU4L3U3YTZTANCNFSM5OXB5UMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>