frappe / frappe/ecommerce_integrations
Shopify Sync Error: BadRequest: expected String to be an id during Sales Order Sync
- Dominant language
- Python
- Stars
- 206
- Forks
- 275
- Avg merge
- 54m
- Merged PRs (30d)
- 1
Description
While attempting to sync a Shopify Sales Order, the following traceback was encountered, leading to a pyactiveresource.connection.BadRequest error:
```
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/order.py", line 52, in sync_sales_order
create_items_if_not_exist(order)
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/product.py", line 308, in create_items_if_not_exist
product.sync_product()
...
File "env/lib/python3.11/site-packages/pyactiveresource/connection.py", line 413, in _handle_error
raise BadRequest(err)
pyactiveresource.connection.BadRequest: Response(code=400, body="b'{"errors":{"id":"expected String to be a id"}}'", ...)
```
Error Message Summary:
`HTTP Error 400: Bad Request
{"errors":{"id":"expected String to be a id"}}
`
Possible Cause: The error seems to occur in Product.find(self.product_id) where self.product_id might not be a valid Shopify Product ID string. Shopify API expects the product ID to be a string representation of a valid ID, and passing an unexpected type (e.g., None, int, or improperly formatted value) could trigger this.
Environment:
Frappe Version: Version-15
ecommerce_integrations version = "1.20.1"
Python Version: 3.11
Shopify API Version: 2024-04
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with sync_sales_order in apps/ecommerce_integrations/ecommerce_integrations/shopify/order.py and create_items_if_not_exist in shopify/product.py, then inspect the Product.find(self.product_id) path around the reported line. Trace the product ID value during a Shopify Sales Order sync and verify that the completed sync no longer sends an invalid ID to Shopify.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100