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
{{ message }}
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
Thank you for creating this IKEA api client, I find it very useful for a project that I am currently working on. I am having an issue with the "order capture" api in Sweden, which seems to result in the same error as #33. The latest version (0.7.0) does not solve this issue for me. See error below:
Traceback (most recent call last):
File "d:\Filer\Utveckling\Projekt\Python\IKEA-notifier\src\app.py", line 8, in <module>
File "d:\Filer\Utveckling\Projekt\Python\IKEA-notifier\src\api\ikea_availability_api.py", line 17, in getAvailability
availabilities = self.__IKEA_API.OrderCapture(
File "C:\Users\Erik\AppData\Local\Programs\Python\Python39\lib\site-packages\ikea_api\core.py", line 64, in OrderCapture
return OrderCapture(self._token, zip_code, state_code)()
File "C:\Users\Erik\AppData\Local\Programs\Python\Python39\lib\site-packages\ikea_api\endpoints\order_capture\__init__.py", line 32, in __call__
return self.get_delivery_services()
File "C:\Users\Erik\AppData\Local\Programs\Python\Python39\lib\site-packages\ikea_api\endpoints\order_capture\__init__.py", line 97, in get_delivery_services
checkout: str | None = self._get_checkout()
File "C:\Users\Erik\AppData\Local\Programs\Python\Python39\lib\site-packages\ikea_api\endpoints\order_capture\__init__.py", line 71, in _get_checkout
response: dict[str, str] = self._call_api(
File "C:\Users\Erik\AppData\Local\Programs\Python\Python39\lib\site-packages\ikea_api\api.py", line 70, in _call_api
self._error_handler(response.status_code, response_dict)
File "C:\Users\Erik\AppData\Local\Programs\Python\Python39\lib\site-packages\ikea_api\endpoints\order_capture\__init__.py", line 36, in _error_handler
raise OrderCaptureError(response)
if response["message"] == response["details"]
KeyError: 'details'
The error can be reproduced by running the following code:
api=IkeaApi(country_code='se', language_code='sv')
api.login_as_guest()
api.Cart.clear()
api.Cart.add_items({"20512245": 1})
cart_show=api.Cart.show() # The show method works as expected, showing the added item in the cartapi.OrderCapture(zip_code="12345") # Mock zip-code here, but it does not work with a valid zip code either
I have debugged the issue myself and have traced it down to the hard coded "ru" language code in the file "src/ikea_api/endpoints/order_capture/__init__.py" (line 66):
the issue is solved for me. I do not think that this change would create any further issues for other regions and languages, so I will go ahead and create a PR to fix this.
If there is any potential issue with this change, please let me know.
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for contribution! Just merged the PR.
Tested with se/sv, ru/ru and us/en — everything works fine.
Just curious, can you share for what project you are using this package? 😃
Thank you for accepting the change, and for the quick response!
So far it is just the beginning of a private project with the goal of being a website where users can track the online availability for certain IKEA products, and get email notifications when products that are out of stock get restocked! I figured that I can use the CaptureOrder class for this, to see whether or not a product can be delivered to a specific zip code! I'll make sure to post the project on Github eventually. I'll keep you posted! 😄
Hello,
Thank you for creating this IKEA api client, I find it very useful for a project that I am currently working on. I am having an issue with the "order capture" api in Sweden, which seems to result in the same error as #33. The latest version (0.7.0) does not solve this issue for me. See error below:
The error can be reproduced by running the following code:
I have debugged the issue myself and have traced it down to the hard coded "ru" language code in the file "src/ikea_api/endpoints/order_capture/__init__.py" (line 66):
ikea-api-client/src/ikea_api/endpoints/order_capture/__init__.py
Lines 62 to 69 in bb11472
By changing this to:
the issue is solved for me. I do not think that this change would create any further issues for other regions and languages, so I will go ahead and create a PR to fix this.
If there is any potential issue with this change, please let me know.
Thanks!
The text was updated successfully, but these errors were encountered: