I am attempting to migrate to the new fulfillment_orders api using a callback on the fulfillment_service instead of the fulfillments/create webhook.
However when the fulfillment_order_notification callback is called the request does not include the ID of the new fulfillment order anywhere in the params or headers. Without this it is not possible to associate the call to the newly created fulfillment_order.
Is there anyway to receive the ID of the fulfillment_order in the fulfillment_order_notification callback?
I can confirm that the fulfillment_order_notification doesn't contain the id of the fulfillment_order, and instead acts as a notification simply informing that a new request has been submitted. Once you receive a fulfillment_order notification, it's expected that you query
assignedFulfillmentOrders on the shop object to determine what needs to be actioned.
Thanks for letting us know. Unfortunately this is a blocker for us in using this feature.
When using the old fulfillments API we were able to receive the fulfillment id and order id via the fulfillments/create webhook. We could then filter out the items needed to fulfill and create the needed fulfillment with a single API call.
With the Fulfillment orders api, to fulfill the items we would need to query all pending assigned fulfillment orders, then accept each fulfillment order and then create the fulfillment.
The new API is much cleaner and easier to understand, however we cannot afford to make 3 API calls to create these fulfillment instead of just the one previously required, this would triple our API Rate limit usage for every single order that we need to mark as fulfilled.
Is there anyway we could get the fulfillment_order id or details in the fulfillment_order_notification. Additionally would it be possible to accept the fulfillment order and create the fulfillment in a single API call?
It's not currently possible to get these ids in the fulfillment_request_notification, but I'll submit feedback to our product teams about this.