Trigger a product import done using the Product API

Highlighted
Tourist
7 0 0

Hi,

I am importing my products using the Product API (building an app that wil use the product api). How can I trigger the import? I am looking into triggers, conditions and actions. I want something like if the content editors are doing an action in shopify admin, like e.g. uploading an image, that should trigger the product import.

Have you had any expereince with such thing?

Thank you

0 Likes
Highlighted
Shopify Partner
520 38 109

Webhooks can be defined for triggers that fire off when a certain event happens. Described here --> https://help.shopify.com/en/manual/orders/notifications/webhooks. When products are created, edited, etc. are just some of the events. Your receiver then takes that webhook request and handles it however you'd define. Although if someone was editing a product in the Shopify web admin (e.g. - adding a product image), I'm not sure why you'd want to import that record into the same system. But at any rate, you'd need to look at these webhooks as they are the event triggers that provide the data!  

0 Likes
Highlighted
Tourist
7 0 0

I actually thought of webhooks first, but the URL section (the URL that will store data) when you create a webhook will need to be a publicly available service. I don't need that really. After we’ve just registered the webhook URL, we will receive an HTTP POST request sent by Shopify to the specified URL every time the event I choose happens.  This is not really the scenarios I need. I need something in admin UI to trigger the import api. Is there somethign I missunderstood about webhooks in shopify?

Thank you

 

0 Likes
Highlighted
Shopify Partner
520 38 109

I am a bit fuzzy about your goal. But if it's providing the Shopify shop web admin UI user a menu option to import in data then that's doable. You can utilize the Shopify embedded app SDK to build your own front-end functionality for this. And it's just wrapped inside of the Shopify shop web admin UI. Here's an article that's a good starting point --> https://www.shopify.com/partners/blog/75776707-how-to-make-the-most-of-the-shopify-embedded-app-sdk. Since this is deprecated, if you'd prefer you can use the newer Shopify App Bridge --> https://shopify.dev/tools/app-bridge

So you have to provide your own third party service to handle the requests that take place. The Shopify shop user has to authorize your app, you reference your API credentials that will then be valid in this particular shop, and then the Shopify shop admin UI user can choose this custom menu option that sits directly in the web admin. That menu option will import in your products as required. Your third party service can validate the API call is legitimate by evaluating the HMAC signature that's sent out with the request. Once it's verified then your routine can then push the products into the Shopify shop.

 

1 Like
Highlighted
Tourist
7 0 0

Hi,

 

I definitely need Embedded apps (bridge apps). I am now looking into them and try to understand the authentication.

Thank you for yor reply

0 Likes