Shopify Api Variant Option Title Set On A Post

- 1 answer

According to the Shopify documentation you can post a product variant like so:

  "variant" => [
    "title" => "Guzman",
    "price" => "44.90",
    "sku" => "160011",
    "position" => 1,
    "inventory_policy" => "continue",
    "compare_at_price" => null,
    "fulfillment_service" => "manual",
    "inventory_management" => "shopify",
    "option1" => "Option1",

The above example is using Guzzle. The above code posts to the product I'm referencing. The problem is I can't find how to change or set the option title. In example the default one is title:

enter image description here

On the shopify admin this would be set by "Edit Options" but I don't find anywhere in the API documentation on how this could be set.



The solution for this was that the variant title is not actually in variant. It is in product api.

The correct way to modify the title would be like this:

$response = $shop->api()->rest('PUT', '/admin/products/{productId}.json' ,[
  "product" => [
    "option" => [
    "name" => "Size"

Further documentation here:

What threw me off was that I was in the variant api assuming variant would be where the title was.