Skip to content
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

Cannot update any product/variant attribute on latest API version #632

Closed
jeffblake opened this issue Oct 20, 2019 · 4 comments · Fixed by #655
Closed

Cannot update any product/variant attribute on latest API version #632

jeffblake opened this issue Oct 20, 2019 · 4 comments · Fixed by #655

Comments

@jeffblake
Copy link

For a simple update like this:

    api_variant = ShopifyAPI::Variant.find(shopify_variant.identifier)
    api_variant.price = correct_price
    api_variant.save!

I receive error:

Failed. Response code = 400. Response message = Bad Request.: {"error":"Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API."}

On API version 2019-10

@tanema
Copy link
Contributor

tanema commented Oct 28, 2019

Same issue as Shopify/shopify_python_api#347 both have the same issue. This will hopefully be fixed soon

@dav
Copy link

dav commented Nov 21, 2019

FYI, to get around this in ruby:

variant.attributes.delete(:inventory_quantity)
variant.attributes.delete(:old_inventory_quantity)

See https://community.shopify.com/c/Shopify-APIs-SDKs/400-BadRequest-on-variant-save/m-p/602230/highlight/true#M40797

Note that when you save after deleting, those attributes come back again so need to be deleted again before another save...

@EmmaB
Copy link

EmmaB commented Mar 18, 2020

We also did a workaround.

@spadae22
Copy link

I just changed the call to use 2019-07, all works for now. 2019-10, 2020-01 does not, the world is closed so we need the site working..... and 2019-07 ends April 1st

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants