Add External ID to Order Fulfillment

Hello Shopify Community,

I’m currently facing an issue with order fulfillment management and I was wondering if someone could provide some guidance.

My use case involves associating an external ID (which is generated from a separate system) with each of my order fulfillments in Shopify. This external ID helps us track and manage our orders efficiently outside Shopify.

However, I am having difficulty figuring out how to add this new field to the order fulfillment. I have explored using metafields, but I’m not quite sure how to apply them in this context. Also, I haven’t been able to find a relevant app that suits my requirements.

Can someone guide me on how to add this new field (External ID) to an order fulfillment? Is it possible to do this using Shopify’s APIs? Any pointers to relevant documentation or example implementations would be highly appreciated.

If I’m unable to get add a new field to the order fulfillments, is there a way I can export the order fulfillment IDs.

Such as if the Order Number is TEST-001, I want to export the fulfillments: TEST-001-F1, TEST-001-F2, TEST-001-F3.

Thank you for your time and looking forward to your responses.

Hey @jonmossman ,

There’s no way to add a unique field like this to the FulfillmentOrder or a Fulfillment on the Order. The only way to add individual fields is using Metafields, which are associated with the Order and not the FulfillmentOrder or Fulfillment.

I’m sure you know this, but when an order is fulfilled, it transitions from a FulfillmentOrder to a Fulfillment on the Order. You can’t get the Fulfillment ID like you want; in your example, TEST-OO1-F1, TEST-001-F2, etc. However, if you pull the order data using the order number, you can get the fulfillment name from the Order. In your example, the fulfillments in the Order.fulfillments list will be TEST-001.1, TEST-002.2, etc. This isn’t exactly what you are looking for, but you could use the name field to match your external ID to the fulfillment on the Order.

As the previous comment mentioned, you can add a metafield to the Order with the fulfillment name and your external ID. This doesn’t add the external ID to the actual fulfillment, but you would have a way to match your external ID to the fulfillment on the Order.

Latest Version FulfillmentOrder docs: https://shopify.dev/docs/api/admin-rest/2023-07/resources/fulfillmentorder

Latest Version Fulfillment docs (you can see the name field here): https://shopify.dev/docs/api/admin-rest/2023-07/resources/fulfillment

Docs to get fulfillments by Order: https://shopify.dev/docs/api/admin-rest/2023-07/resources/fulfillment#get-orders-order-id-fulfillments

Latest Version Order docs: https://shopify.dev/docs/api/admin-rest/2023-07/resources/order

Hope this helps!

1 Like