Fulfilment order line item location changes

I’m using the fulfillment_orders/moved webhook to detect when fulfilment order line items have their location changed in the Shopify UI.

I’m seeing a strange issue with the fulfillment_order_line_items_requested section in the webhook payload:

  • Sometimes this is just an empty array, so I have no idea which fulfilment order line items had their locations changed.
  • Sometimes it contains a fulfilment order line item id that no longer exists in Shopify, so again, I can’t know what was changed.
  • Other times it will return the correct id of the fulfilment order line item which had it’s location changed, which is fine.

The behaviour of missing/invalid ids appears to be random. Is this perhaps due to a data propagation issue/race condition within the Shopify platform?

I’m currently unable to consistently track fulfilment order line item location changes at this point.

Thanks.

1 Like

Hey @Wayne_Martin1, thanks for the detailed report. I’m going to take a look in to this.

A few follow up questions to help us determine if it’s specific to the webhook (maybe one of those scenarios you listed), or if it’s more of a fulfillment data issue:

When you receive a webhook with empty or invalid fulfillment_order_line_items_requested, do the line items show correctly if you immediately query the fulfillment order via the API?
Do you have the webhook ID from one of these webhooks within the last few days? I may be able to find some additonal data from our logs if needed as well.

Hi @KyleG-Shopify,

Thanks for looking at this.

“When you receive a webhook with empty or invalid fulfillment_order_line_items_requested, do the line items show correctly if you immediately query the fulfillment order via the API?”
Yes, they do.

“Do you have the webhook ID from one of these webhooks within the last few days? I may be able to find some additonal data from our logs if needed as well.”
This webhook payload is a demonstration of where the fulfillment_order_line_items_requested array is empty - “x-shopify-webhook-id”: “aae9f4e3-efe1-52bc-b245-be614cc13324”

Things appear to work fine when changing a partial quantity from one fulfilment line item location to another. The blank/invalid ids occur when changing the full line item quantity from one location to another.

I’m guessing that internally the Shopify platform is deleting the fulfilment line item if the full quantity is relocated, and based on when the webhook is raised, the line item might still be available when building the webhook payload (thus giving me an invalid id), or the removal takes place just before the payload data is built, thus giving me an empty array. The timing and order of these events might explain the random results that I’m observing? But this is just speculation on my part.

Hi. Is there any news on this?

Thanks.

Hey Wayne, I have been looking in to this. I don’t yet have an answer for you, but I will update you here as soon as I know more. Thanks for checking in!

1 Like