I am receiving an error message when I try to send a simple product update with a metafield. Can anybody help?
The error is {“errors”:{“value”:[“is invalid JSON: unexpected token at ‘test’.”]}}
$response = $client->put("https://$storeUrl/admin/api/2024-07/products/$productId.json", [
'headers' => [
'X-Shopify-Access-Token' => $accessToken,
'Content-Type' => 'application/json',
],
'json' => [
'product' => [
'id' => $productId,
'title' => 'Another Updated Product Title',
'tags' => 'tag_one,tag_two',
'metafields' => [
[
'namespace' => 'custom',
'key' => 'summary',
'value' => "test",
'type' => 'rich_text_field'
]
]
]
]
]);