Webhook for product/create doesn't retrieve images

Shopify Partner
4 0 0

Hi,

I'm trying to get data from products creation through webhooks.

I successfully created and authenticated the "Create product" webhook with my PHP backend but, when I receive the json, it misses the images info.

If I register the webhook for the "Edit product" it gives me correctly the images info.

Here is an example of what i get from the create product webhook:

{
    "id": XXXXXXXXXXXXXXXX,
    "title": "Title",
    "body_html": "",
    "vendor": "Vendor",
    "product_type": "",
    "created_at": "2018-10-15T12:27:57+02:00",
    "handle": "handle",
    "updated_at": "2018-10-15T12:27:58+02:00",
    "published_at": "2018-04-16T14:14:24+02:00",
    "template_suffix": null,
    "tags": "tags",
    "published_scope": "web",
    "variants": [
    {
        "id": XXXXXXXXXXXXXXXX,
        "product_id": XXXXXXXXXXXXXXXX,
        "title": "Default Title",
        "price": "98.00",
        "sku": null,
        "position": 1,
        "inventory_policy": "continue",
        "compare_at_price": "0.00",
        "fulfillment_service": "manual",
        "inventory_management": null,
        "option1": "Default Title",
        "option2": null,
        "option3": null,
        "created_at": "2018-10-15T12:27:57+02:00",
        "updated_at": "2018-10-15T12:27:57+02:00",
        "taxable": true,
        "barcode": "barcode",
        "grams": 17000,
        "image_id": null,
        "inventory_quantity": 0,
        "weight": 17.0,
        "weight_unit": "kg",
        "inventory_item_id": XXXXXXXXXXXXX,
        "old_inventory_quantity": 0,
        "requires_shipping": true
    }],
    "options": [
    {
        "id": XXXXXXXXXXXXXXXX,
        "product_id": XXXXXXXXXXXXXXXX,
        "name": "Title",
        "position": 1,
        "values": ["Default Title"]
    }],
    "images": [],
    "image": null
}

 

I atleast need to know the urls of the images...

Can anyone help me?

Thank you

 

 

 

 

0 Likes
Shopify Staff
Shopify Staff
296 32 59

Hey there,

Thanks for bringing this to our attention. It looks as though this is a bug with the products/create webhook that our platform engineers are now investigating. 

I will keep you updated with any fixes that get implemented!

0 Likes
Shopify Partner
4 0 0

Thank you for your quick response!

I hope the resolution will also be this quick because I'm stuck for my project...

0 Likes
Highlighted
Shopify Staff
Shopify Staff
296 32 59

Hey @Alessio1,

 

Just wanted to circle back on this. The reason the `products/create` webhook sometimes doesn't include the product images info is because it takes longer for the image data to process than it does for the webhook to fire.

 

To remedy this, you should also subscribe to the `products/update` webhook which will fire when the product images have processed and have been properly tied to the Product object.

0 Likes