Get a commerce product
Use the externalItem GraphQL query get a single Magento Commerce product.
Example request
The first sample code block illustrates a request to retrieve a product based on its ECL URI.
{
externalItem(eclUri: "ecl:2-magento-TUgwMS1TLUJsYWNr!5F;
Y29udGVudA!25;3d!25;3d-MagentoProduct-file") {
... on MagentoProduct {
title
filename
summary
description
price {
currency
formattedValue
value
}
quantity
inStock
weight
images {
altText
contentType
imageReference
imageType
mediaType
}
thumbnail
}
}
}
Example response
The second code block illustrates the corresponding response with the requested product details.
{
"data": {
"externalItem": {
"title": "Chaz Kangeroo Hoodie-S-Black",
"filename": "TUgwMS1TLUJsYWNr_Y29udGVudA%3d%3d.mht",
"summary": "",
"description": "<p>Ideal for cold-weather training or work outdoors, the Chaz
Hoodie promises superior warmth with every wear. Thick material blocks out the wind
as ribbed cuffs and bottom band seal in body heat.</p> \n<p>• Two-tone gray heather
hoodie.<br />• Drawstring-adjustable hood. <br />• Machine wash/dry.</p>",
"price": {
"currency": "EUR",
"formattedValue": "€ 52",
"value": "52"
},
"quantity": 100,
"inStock": "In stock",
"weight": "1 lbs",
"images": [
{
"altText": "",
"contentType": "image/jpeg",
"imageReference": "http://10.111.32.21:8081/cd/api/external/binary/magento/
eyJDb250ZW50VHlwZSI6ImltYWdlL2pwZWciLCJFbnRpdHlUeXBlIjoiSW1hZ2UifQ%3d%3d/
NTc%253d_TUgwMS1TLUJsYWNr_YXNzZXQ%253d",
"imageType": "image",
"mediaType": "image"
},
{
"altText": "",
"contentType": "image/jpeg",
"imageReference": "http://10.111.32.21:8081/cd/api/external/binary/magento/
eyJDb250ZW50VHlwZSI6ImltYWdlL2pwZWciLCJFbnRpdHlUeXBlIjoiSW1hZ2UifQ%3d%3d/
NTc%253d_TUgwMS1TLUJsYWNr_YXNzZXQ%253d",
"imageType": "small_image",
"mediaType": "image"
},
{
"altText": "",
"contentType": "image/jpeg",
"imageReference": "http://10.111.32.21:8081/cd/api/external/binary/magento/
eyJDb250ZW50VHlwZSI6ImltYWdlL2pwZWciLCJFbnRpdHlUeXBlIjoiSW1hZ2UifQ%3d%3d/
NTc%253d_TUgwMS1TLUJsYWNr_YXNzZXQ%253d",
"imageType": "thumbnail",
"mediaType": "image"
}
],
"thumbnail": "http://10.111.32.21:8081/cd/api/external/binary/magento/
eyJDb250ZW50VHlwZSI6ImltYWdlL2pwZWciLCJFbnRpdHlUeXBlIjoiVGh1bWJuYWlsIn0%3d/
TUgwMS1TLUJsYWNr_Y29udGVudA%253d%253d"
}
}
}