ingestProductImage
Requires permission products:product:update.
Download an approved public image URL and store a hosted copy under the org prefix. Returns the hosted URL to add to the product imageUrls. Needs the products update permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation IngestProductImage($url: String!) {
ingestProductImage(url: $url) {
url
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation IngestProductImage($url: String!) {\n ingestProductImage(url: $url) {\n url\n }\n}",
"variables": {
"url": "string"
}
}
EOF
Variables:
{
"url": "string"
}
Response:
{
"data": {
"ingestProductImage": {
"url": "string"
}
}
}
ingestProductImage(
url: String!
): IngestedImage!
Arguments
ingestProductImage.url ● String! non-null scalar
The address of the image to fetch.
Type
IngestedImage object
An image saved for a product.