Updating product and product metafields with single PUT request

I would have given up were it not for this thread, which seems to indicate updating product metafields with PUT is possible: https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/product-variant-metafields-are-not-being-updated-on-a-put-193577 (see image for pullquote).


Below is a copy of the failing JSON (which succeeds if the metafields are removed). Again this works on POST, but not PUT.

{
    "title": "Second Track",
    "body_html": "Second Track by Jonathan Coulton. From the album Test Album. Released in 2009.",
    "product_type": "Parallel Testing",
    "vendor": "Jonathan Coulton",
    "tags": "Test_Album",
    "variants": [
        {
            "title": "MP3",
            "price": 1,
            "sku": "11610:MP3",
            "option1": "MP3",
            "taxable": true,
            "id": 33351292870
        },
        {
            "title": "MP4",
            "price": 1,
            "sku": "11610:MP4",
            "option1": "MP4",
            "taxable": true,
            "id": 33351292934
        },
        {
            "title": "FLAC",
            "price": 1,
            "sku": "11610:FLAC",
            "option1": "FLAC",
            "taxable": true,
            "id": 33351292998
        },
        {
            "title": "ALAC",
            "price": 1,
            "sku": "11610:ALAC",
            "option1": "ALAC",
            "taxable": true,
            "id": 33351293062
        }
    ],
    "options": [
        {
            "name": "Format"
        }
    ],
    "images": [
        {
            "src": "http:\/\/[www.jonathancoulton.com\/images\/jc-face-blog-thumb.jpg](http://www.jonathancoulton.com\/images\/jc-face-blog-thumb.jpg)",
            "id": 21235301510
        }
    ],
    "metafields": [
        {
            "namespace": "global",
            "key": "wiki_link",
            "value": "http:\/\/apple.com",
            "value_type": "string",
            "id": 30591209990
        }
    ],
    "image": {
        "src": "http:\/\/[www.jonathancoulton.com\/images\/jc-face-blog-thumb.jpg](http://www.jonathancoulton.com\/images\/jc-face-blog-thumb.jpg)",
        "id": 21235301510
    },
    "id": 9143746566
}
2 Likes