Hi Shopify Experts,
I was hoping you could help me understand the following:
I am looking to integrate a third party REST API that handles the printing and shipping of my customers items.
I am trying to understand how to set up the connection between Cloud Printer and my Shopify Store.
This is what I have figured out so far:
1) I need to connect the Shopify API with the Cloud Printer API
2) I can create a custom app in Shopify via Partners or private App via my own Storefront
3) Something with webhooks?
I don't understand how and where I need to actually put my code. Is it only webhooks, do I need to put the API .php code somewhere in my Shopify Code? How does this work?
Hope someone can give me some more detailed information, I am eager to learn/implement this.
Solved! Go to the solution
This is an accepted solution.
If you're looking to integrate a 3rd party API with the Shopify platform, you'll need to create an app to be installed on Shopify stores. Your app will act as a "middleware", making calls to the Cloud Printer API and the Shopify API in order to achieve your desired functionality. Here's a very high-level description of how this could work:
- Also on install, you can register a FulfillmentService and opt-in to FulfillmentOrders. Registering a FulfillmentService allows merchants to specify which products will be fulfilled by Cloud Printer.
- For your app to be notified of new orders, you can either subscribe to webhooks, poll the API every X minutes with a recurring job, or a combination of both. Opting-in to FulfillmentOrders allows you to poll the AssignedFulfillmentOrders endpoint, which will return only unshipped orders containing products your app is responsible for fulfilling.
- Once your app has been notified of an order to be fulfilled, it can make calls to the Cloud Printer API to create the fulfillment on that platform. Once the fulfillment has been created, you'll call the Shopify API again to pass back fulfillment details and mark the order as fulfilled in Shopify.
If you haven't already, I recommend having a look at our tutorials which have step by step guides for creating apps in different languages including JS or Ruby. Note that you can write your app in any language, as long as it allows you to make authenticated calls to Shopify REST or GraphQL APIs. That page also contains tutorials for achieving specific functionality, such as managing fulfillments using the FulfillmentOrder resource.
Hopefully that helps get you started.
JB | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution