FulfillmentOrders not included in the Orders/created webhook's payload

FulfillmentOrders not included in the Orders/created webhook's payload

ferasWB
Shopify Partner
6 0 0

why are FulfillmentOrders not included in Orders/created webhook's payload? and is this planned to change in the future?

And what is the recommended way to fetch FulfillmentOrders once they are created? (unfortunately, there is noFulfillmentOrders/created webhook)

 

I'm following this Guide to implement the fulfillment orders based workflow and I'm following this Guide https://shopify.dev/docs/apps/fulfillment/fulfillment-service-apps/manage-fulfillments

 

my goal is to basically fetch/receive newly created FulfillmentOrders, so that I can start requesting fulfillment on them.

Replies 3 (3)

jdorsch
Tourist
9 2 5

The orders created webhook does not contain the fulfillment orders because they may not be created at the same time the order is created depending on how the store is setup (auto fulfillment set to off).   Secondly, you only want to be looking for order fulfillments that are assigned to your location.  For instance, if a store has multiple locations you don't necessarily need care about orders that have no items you need to fulfill.

 

This is the webhook that fires when a fulfillment order is created

 

fulfillment_orders/fulfillment_request_submitted

 

Make sure you carefully read and understand how the new fulfillment flow works and experiment with it.  Depending on what happens during the life of an order, you may end up with multiple order fulfillments/cancellations for the same order if it is edited.  You also want to handle order cancellation requests, need to be aware that the identical webhook for the same fulfillment request may fire multiple times, or not fire at all (you need to check for duplicates and have backup polling).

ferasWB
Shopify Partner
6 0 0

Hi @jdorsch

Thanks for your reply!

but unfortunately, you may have misunderstood my question. 

 

Yes, a fulfillment service (location) must only be aware of fulfillment orders that are assigned to it. However, my App handles multiple stores, and it should be aware of all FF Orders because I want to store them in my DB, and then based on some rules request a fulfillment from a specific FF service.

 

fulfillment_orders/fulfillment_request_submitted is not fired when a fulfillment order is created, but rather when a fulfillment is requested. Which is basically one step ahead of what I need.

 

The hook that will fire when FF orders for an order are created is this one:

 

fulfillment_orders/order_routing_complete

but for some reason, it only includes two fields (id and status); meaning I still have to fetch other fields over a GraphQL/REST API call.

 

Yeah, the new fulfillment flow is definitely interesting. However, my question doesn't concern the  FF requests and acting on them, but rather the step before that which is gathering all the data I need to start this workflow.

 

I can of course fetch newly created FF orders periodically (e.g. every 10min or so) or even shortly after I receive an order-created webhook, but this doesn't seem to be the optimal solution for me.

 

thanks again!

ferasWB
Shopify Partner
6 0 0

according to this Guide, there should be a new recommended webhook "fulfillment_orders/ready_to_fulfill" in the unstable version of the API. I've tried using the unstable version but the webhook doesn't exist. was it removed? is the Guide outdated?!

 

this is really frustrating...

 

https://shopify.dev/docs/apps/fulfillment/order-management-apps/third-party-marketplaces#best-practi...