Shopify API update inventory results in "Required parameter missing or invalid"
<p>following the official Shopify API example, I've created the following request to update inventory:</p>

<pre><code>[method] =&gt; PUT

[url] =&gt; https://&lt;withheld&gt;:&lt;withheld&gt;@test-shop-422.myshopify.com/admin/variants/1234567890.json

[headers] =&gt; Array (
     [0] =&gt; Accept: application/json
     [1] =&gt; Content-Type: application/json
     [2] =&gt; X-HTTP-Method-Override: PUT
)

[params] =&gt; {"variant":{"id":1234567890,"inventory_quantity":2,"old_inventory_quantity":1}}

[response] =&gt; {"errors":{"variant":"Required parameter missing or invalid"}}
</code></pre>

<p>On the forums I've found this answer, but it didn't help: <a href="https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/what-does-errors-variant-required-parameter-missing-or-invalid-mean-270461" rel="nofollow">https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/what-does-errors-variant-required-parameter-missing-or-invalid-mean-270461</a></p>

<p>What am I doing wrong?</p>

<p>Thanks.</p>

<p>EDIT: here's the final request CURL opts and raw response (&lt;...> - withheld):</p>

<pre><code>Array
(
    [CURLOPT_AUTOREFERER] =&gt; 1
    [CURLOPT_CAINFO] =&gt; &lt;...&gt;/cacert.pem
    [CURLOPT_CONNECTTIMEOUT] =&gt; 5
    [CURLOPT_FOLLOWLOCATION] =&gt; 1
    [CURLOPT_HEADER] =&gt; 1
    [CURLOPT_HTTPHEADER] =&gt; Array
        (
            [0] =&gt; Accept: application/json
            [1] =&gt; Content-Type: application/json
            [2] =&gt; X-HTTP-Method-Override: PUT
            [3] =&gt; Expect: 
            [4] =&gt; Referer: &lt;...&gt;/process_queue
            [5] =&gt; Content-Length: 47
        )

    [CURLOPT_MAXREDIRS] =&gt; 10
    [CURLOPT_POSTFIELDS] =&gt; {"variant":{"inventory_quantity_adjustment":1}}
    [CURLOPT_PUT] =&gt; 1
    [CURLOPT_RETURNTRANSFER] =&gt; 1
    [CURLOPT_SSL_VERIFYHOST] =&gt; 2
    [CURLOPT_SSL_VERIFYPEER] =&gt; 1
    [CURLOPT_TIMEOUT] =&gt; 5
    [CURLOPT_URL] =&gt; https://&lt;...&gt;:&lt;...&gt;@test-shop-422.myshopify.com/admin/variants/26020635016.json
    [CURLOPT_USERAGENT] =&gt; Mozilla/5.0
)
</code></pre>

<p>Raw response:</p>

<pre><code>HTTP/1.1 400 Bad Request
Server: nginx
Date: Wed, 12 Oct 2016 01:23:05 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Frame-Options: DENY
X-ShopId: 9690230
X-ShardId: 7
X-Shopify-Shop-Api-Call-Limit: 1/40
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
X-Stats-UserId: 0
X-Stats-ApiClientId: 1444946
X-Stats-ApiPermissionId: 31937062
X-XSS-Protection: 1; mode=block; report=/xss-report/&lt;...&gt;?source%5Baction%5D=update&amp;source%5Bcontroller%5D=admin%2Fproduct_variants&amp;source%5Bsection%5D=admin
X-Request-Id: &lt;...&gt;
X-Dc: chi2
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-Content-Type-Options: nosniff

{"errors":{"variant":"Required parameter missing or invalid"}}
</code></pre>