Completely new and looking for guidance on which APIs to use.

rl_bam
Visitor
2 0 0

Hi guys, completely new here and on a tight deadline, looking for guidance in where to start. 

 

I need to make a few API calls upon certain actions being performed on the site, to integrate Shopify data with a third party system.

 

I need to make an API call upon a product being edited, to update the data on the third party system. Which API would I use for that? 

 

I also need to make a call upon order creation, that will send the data to the third party system and allow the products to begin being prepared for shipment. Which API would I use for that?

 

I would read through the documentation in detail to figure this out but as I'm on a deadline for this, I was hoping I could ask for some guidance here so I can focus my search on the appropriate content to read.

 

Thank you.

Replies 3 (3)

cdarne
Shopify Staff
30 5 14

Hi,

 

From what you're describing, executing code after a specific event occurs in a shop, it seems like your best option is to use webhooks. For example registering a webhook for the "products/update" topic will then trigger a webhook from Shopify to the endpoint URL (your server) that you've setup in the webhook registration with the updated product information so that the 3rd party server will be kept be up to date.

 

For a general doc about the webhooks, you can look here: https://shopify.dev/apps/webhooks. And for a more example on how to register a HTTPS webhook, you can look here: https://shopify.dev/apps/webhooks/https.

 

Cheers,

 

Cédric | Developer @ Shopify

To learn more visit the Shopify Help Center or the Community Blog.

rl_bam
Visitor
2 0 0

Ah, perfect. And can webhooks work both ways? Like if we get a response from the third party system, can I set up a webhook that would process their request?

cdarne
Shopify Staff
30 5 14

From the Shopify perspective, webhooks are working one way Shopfiy => external server (yours or third party).

Depending on what you want to achieve:

 

1. Make Shopify communicate directly to a 3rd party system using webhooks: that 3rd party system should then have a way to accept webhooks (https endpoint) and do the logic you need (business logic) and communicate back to Shopify using an API calls (REST or GraphQL). It means that system has to be already well integrated to Shopify. That's something you need to check with that 3rd party system.

 

2. Or have your own system (server) as a middleman: this is usually the most common and flexible setup for you. Having your own system receiving webhooks, then interacting with the 3rd party system (API) and finally interacting back with Shopify using the REST/GraphQL API.

 

Cheers,

 

Cédric | Developer @ Shopify

To learn more visit the Shopify Help Center or the Community Blog.