-
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
"inventory_quantity"=>"expected String to be a Integer"} on variant.save #969
Comments
Hello! Having the same issue here. Did you have any luck solving this?
Also tried to manually set inventory quantity to integer but same error
|
Did you manage to solve this? I am also having the same issue. |
One thought: What happens if you change the API version? |
Same here on API version "2022-07" -- EDIT-- Updating to 2022-07 results in the exact same error |
For anyone still stuck (like I am)...there is a workaround. Simply use the GraphQL Admin client instead of the REST one. I've found it to work when the REST API client is broken for each and every case. Including this one, but also deleting collections and variants. Not a great fix, but it works. |
Same issue here. Would be nice to have a fix, thanks in advance |
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
Bump to keep this open. Has Shopify said they’re depreciating the REST client? It’d be nice to get a clear “if you’re building new apps, don’t use this API”. |
having the same kind of errors as one described in the thread: ShopifyAPI::Errors::HttpResponseError ({"inventory_quantity"=>"expected Hash to be a Integer"}) Tried versions |
@benichu we've given up on the Shopify Gem, and just built our own wrapped for the REST API. |
Sorry for the late reply for anyone searching. I had to solve this by just using REST calls with anything new that I write. Kinda sucks because I had a ton of work set up using the gem. Gotta love the Shopify devex. |
You both confirmed what I thought. We can't have good and lasting tech anymore, it feels like big tech companies like Shopify and others are on a treadmill to change services and libraries for the sake of it. When I think that I only started that rabbit hole of a waste of time because of an All I want is to be able to integrate my application with Shopify and forget it. I don't care if it means locking a client library and API backend versions and foregoing some "new amazing" features. I honestly don't want to have to read every developer announcement and deprecation notice required by the "new" growth strategy... |
Yeah, tell me about it. In the end my business partner and I ended just writing our own ecommerce platform. The decision to do so was heavily influenced by the gem and the app store review! |
Anyone managed to resolve this? |
Also having this issue when trying to update a variant's fulfillment service. On save I get Like others, I've also had to revert to using the REST client directly: No reply from Shopify on this, eh? That's too bad. |
Yep, ended up removing the gem and writing a small REST client with zero useless abstractions to worry about. |
Bonus now, is that my client properly uses the |
This issue is stale because it has been open for 60 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! |
Deffo hasn't been fixed |
For anyone who has this issue, I go with this solution finally. test_session = ShopifyAPI::Auth::Session.new(
shop: your_shop,
access_token: your_access_token,
)
client = ShopifyAPI::Clients::Rest::Admin.new(session: test_session)
body = {
variant: {
cost: 4.50
}
}
response = client.put(path: "variants/#{variant_id}.json", body: body)
puts response.body |
Issue summary
Write a short description of the issue here ↓
When calling save on a product variant, it returns the error
'request': {"inventory_quantity"=>"expected String to be a Integer"} (ShopifyAPI::Errors::HttpResponseError)
despite not modifying inventory quantity at all.Here's my code block that the error is tracing to
Expected behavior
What do you think should happen?
So my code was previously working before upgrading to v10.x from gem version 9.5.1. I would assume it would just write and give a 200 status
Actual behavior
What actually happens?
Steps to reproduce the problem
Logs
If applicable, enable the logs as described in the README, and paste the relevant portion here.
So here's the output of product.variant.first.inspect where on option1 the
inventory_quantity
field is correctly set to 0 rather than a string as described in an errorSpecifications
shopify_api
version: v10.1.02022-01
and2022-04
The text was updated successfully, but these errors were encountered: