Send Order to API if Warehouse can Fulfill

Send Order to API if Warehouse can Fulfill

saintnick
Shopify Partner
2 0 2

There is a 3rd party Warehouse my site will use and they have some of the products we sell.

If we run out of a product, we want to send the Order information to them and have them fulfill it (and potentially send an Order Fulfilled!) back to us.

Our store has Plus, and the Plus team referred me to Shopify Functions. 

 

An ideal flow would be:
User send order in Shopify -> We check if the warehouse can fulfill the order -> If so, API send the order to them (if not, process normally) -> Warehouse sends done/error back

 

The only thing that needs to match up from our system to theirs is the product ID, and we will use metafields to make them match. 

 

What would be the best way to make this happen?

Replies 3 (3)

Liam
Shopify Staff
2807 310 805

Hi Saintnick,

 

To achieve this, you can use the Fulfillment API to implement a third-party fulfillment process in your Shopify store. However, you would need to build a custom application or script to handle the communication between your Shopify store and the warehouse. Here's a generalized flow:

  1. Create a Webhook for new orders: Set up a webhook in your store to trigger when a new order is created. This webhook will send all the necessary order information (like product IDs, customer information, etc.) to a specific URL you control (for example, your custom app or script).

  2. Check Warehouse Inventory: Once your app or script receives the webhook data, extract the product IDs and check with the warehouse if they can fulfill the order. This would typically involve calling the warehouse's API.

  3. Send Order to Warehouse: If the warehouse has the necessary inventory, your app or script would then send the order details to the warehouse for fulfillment. This again would typically involve calling the warehouse's API.

  4. Receive Fulfillment Confirmation: Once the warehouse fulfills the order, they should send a confirmation back to your app or script. This would require the warehouse to have the capability to send such a confirmation via their API.

  5. Update Order Status in Shopify: Upon receiving the fulfillment confirmation from the warehouse, your app or script use the Admin API to update the order status to "fulfilled".

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

saintnick
Shopify Partner
2 0 2

This sounds very straightforward compared to the length I was doing with a Shopify app and extensions, thank you!

 

When I want to update the order status, how can I authenticate the request to send it to Shopify?

Kalen_Jordan
Shopify Partner
521 17 76

If you're open to using a 3rd party app, I should be able to build out an automated workflow to handle this.