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

Unable to set Product Variant Images #905

Open
A-Fairooz opened this issue Jul 27, 2023 · 2 comments
Open

Unable to set Product Variant Images #905

A-Fairooz opened this issue Jul 27, 2023 · 2 comments
Labels
bug missing or invalid properties object updating Bugs and strange behavior around updating objects, primarly related to #284

Comments

@A-Fairooz
Copy link

A-Fairooz commented Jul 27, 2023

Updating a product variant's image by setting the ImageId equal to the Id of an existing image throws this exception:

"(400 Bad Request) Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API."

ImageId is the only field I'm making any changes to, and I'm updating the variants using this:

   try
            {
                var service = new ProductVariantService(Properties.Settings.Default.ShopifyUrl, Properties.Settings.Default.APIKey);
                var variant = await service.UpdateAsync(variantId, productVariant);
                return variant;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }
@nozzlegear
Copy link
Owner

Thanks @A-Fairooz, looks like we'll need to remove those properties when serializing post/put requests to Shopify. Which version of ShopifySharp are you using?

@nozzlegear nozzlegear added bug missing or invalid properties object updating Bugs and strange behavior around updating objects, primarly related to #284 labels Aug 4, 2023
@A-Fairooz
Copy link
Author

No probs, I was using version 6.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug missing or invalid properties object updating Bugs and strange behavior around updating objects, primarly related to #284
Projects
None yet
Development

No branches or pull requests

2 participants