-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit product raise error: Bad Request (Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API.) #702
Comments
I tried to update to latest shopify_app and shopify_api version, and change shopify api_version too but nothing works |
I get the same - it is regardless if I changed those values |
Yes, we had this yesterday: I don't know what Shopify API change caused it, but it just kicked in yesterday. The
Same with the
Hope that helps. |
@EmmaB Excellent! Thanks a bunch, that really helps. I'll try that. Didn't even know could do that |
Yes, it took a bit of looking through the docs, in the Endpoints section here: https://shopify.dev/docs/admin-api/rest/reference/products/product |
Just want to add my experience using the
Eventually, I dug this out:
This will give a 404 if not found, and the product if found returning the fields I want. If I use Thanks again @EmmaB for pointing me in the right direction |
I'm currently creating a new product using the ShopifyAPI::Product.new method: new_shopify_product = ShopifyAPI::Product.new
new_shopify_product.title = product.title
new_shopify_product.body_html = full_description
new_shopify_product.vendor = product.designer.name
new_shopify_product.product_type = product.classification_category
new_shopify_product.published = product.published
new_shopify_product.tags = tags
new_shopify_product.save The above is working just fine. Then, in the same file under this block of code, I have another block of code that edits the newly created product's options and variants like so: new_shopify_product.options[0].name = "Size"
new_shopify_product.options[0].values[0] = combined_size
new_shopify_product.variants[0].price = product.price
new_shopify_product.variants[0].sku = product.generated_id
new_shopify_product.variants[0].compare_at_price = product.estimated_retail_price
new_shopify_product.variants[0].option1 = combined_size
new_shopify_product.save I get this 400 error thrown when attempting to call EDIT: Saibotx answer below solved this issue for me. I had to do the following: new_shopify_product.variants[0].inventory_management = "shopify"
new_shopify_product.variants[0].attributes = new_shopify_product.variants[0].attributes.except("inventory_quantity", "old_inventory_quantity")
new_shopify_product.save |
This will be fixed in this PR #655 |
@alex-espinoza I learned that when I call save - the api reloads the full object with all fields. Pretty annoying |
@iamkristian ive found even with the new update (v9.0.3) this is still happening. I'm now doing the following
adding that extra line |
@Saibotx what api version are you on? |
It seems like there was an issue in the PR deploy in #655, the team is working on a fix right now for it. |
@tanema is there any update on this issue? We've paused an API migration until this issue was fixed. If the fix is not released in the following weeks we'll have to resort to implementing the workaround ourselves, so I'd love to have an update so we can plan accordingly. Thanks! |
@tanema I only ran into this after migrating to 2019-10. Will try the variant.attributes.except approach noted above. |
@tanema for what it's worth we just upgraded to 2021-01 and this problem was still persisting. I need to explicity remove Worse now though, that the Is there any way to get more detailed response information from shopify to debug issues like these? Thanks. |
This is really annoying especially when you work with variant through product object and don't have control over fields
And actually it gives record without those fields but if you do some sort of:
it return 2 deprecated fields, workaround is:
|
This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days. |
We are closing this issue because it has been inactive for a few months. If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines Thank you! |
I can't edit any exist products. Everytime I save one, it raise error:
ActiveResource::BadRequest (Failed. Response code = 400. Response message = Bad Request (Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API.).):
Note that I tested by load random product, then edit it's title only. this issue only appear today, my application still works fine a couple of days ago.
Here my gemfile config:
API version:
The text was updated successfully, but these errors were encountered: