go-shopify icon indicating copy to clipboard operation
go-shopify copied to clipboard

Any attempt to create or update variants fails with error

Open leighstillard opened this issue 2 years ago • 0 comments

Hi there,

I'm consistently getting the following error whenever I attempt to create or change a variant using this library:

Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API.

For reference, here is a snippet of code where I'm attempting the change:

	ok := YesNoPrompt("Update Shopify Price?", true)
		if ok {
			fmt.Println("Updating Shopify Price")
			currentVariant, err := client.Variant.Get(foundVariantID, nil)
			assertNoErr(err)
			// update price of local variant
			currentVariant.Price = &shopifyPrice
			// update remote variant
			newVar, err := client.Variant.Create(foundProductID, *currentVariant)
			assertNoErr(err)

			fmt.Printf("New variant price is: %v\n", newVar.Price.String())
			// verify update
		}```

leighstillard avatar Nov 08 '22 04:11 leighstillard