I am trying to add a file definition to a custom field, then I need to upload an image that I will only use for a specific purpose and I do not want to show this image on Products page.
I managed to get something closer to it, I upload the image to
$response = $api->rest("POST", "/admin/products/123/images.json", $imagePayload);
then I get the response and save into custom field
$response = $api->rest('POST', '/admin/products/123/metafields.json', [
"metafield" => [
"namespace" => "product",
"key" => "description_image",
"value" => trim($image['src']),
"type" => "url"
]
]);
The issue is that this shows the image on the products page along with other images.