How to create a new fulfillment for a previously cancelled fulfillment if fulfillment order closed?

Solved

How to create a new fulfillment for a previously cancelled fulfillment if fulfillment order closed?

jaydeeo
Visitor
3 1 1

Hi,

 

We are struggling to move our REST API from fulfillment related to orders to fulfillment related to fulfillment orders. Fulfillment orders may be great for large stores with many warehouses, but real cumbersome for smaller stores....

 

I got it working that the API picks out the fulfillment order id and fulfillment order line item id's at time of order creation. Then when we create fulfillments we reference these fulfillment order ids  and it creates the fulfillments via API.

 

I can then also cancel a fulfillment referencing the same ids. However what I cannot do after is re-create the fulfillment for an order line item of a previously cancelled fulfillment if no further items are unfulfilled. Because the associated fulfillment order was marked as status closed.

 

API response error message:

'Fulfillment order 123456 has an unfulfillable status= closed.'

 

I don't see an endpoint that allows to reset the status of the related fulfillment order to "in progress" again.

 

In Shopify upon fulfilling all items it archives the order, and when I cancel the last fulfillment it correctly said "un-archived order". However the associated fulfillment order remains closed.....

Accepted Solutions (2)

Shayne
Shopify Staff (Retired)
254 20 48

This is an accepted solution.

When a FullfillmentOrder is closed because it's reallocated, or specific line items are changed on the FulfillmentOrder, you'll see that there's another FulfillmentOrder created to reflect the fact that there is "something different that needs to be done." FulfillmentOrders don't evolve and change after they're already cancelled, new ones are created instead.

If you want to keep track of Fulfillment tasks that need to be completed, it's probably a better idea to subscribe to the relevant FulfillmentOrder webhook topics covered here!

Shayne | 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

View solution in original post

jaydeeo
Visitor
3 1 1

This is an accepted solution.

Thanks for your help, I got it working. So in the "new world" of fulfillment orders, upon cancelling a fulfillment on an "archived" order, one has to query again the GET fulfillment order for that specific order  again. In the response there are DIFFERENT fulfillment order ids (and fulfillment line item ids!), than at the time the order came in. Once the cancelled item is ready to be fulfilled again, both of these new ids have to be quoted in the POST fulfillment endpoint or it won't work.

 

This is structurally quite different to when fulfillments were directly linked to the orders. And I feel this could be made clearer in the documentation.

View solution in original post

Replies 2 (2)

Shayne
Shopify Staff (Retired)
254 20 48

This is an accepted solution.

When a FullfillmentOrder is closed because it's reallocated, or specific line items are changed on the FulfillmentOrder, you'll see that there's another FulfillmentOrder created to reflect the fact that there is "something different that needs to be done." FulfillmentOrders don't evolve and change after they're already cancelled, new ones are created instead.

If you want to keep track of Fulfillment tasks that need to be completed, it's probably a better idea to subscribe to the relevant FulfillmentOrder webhook topics covered here!

Shayne | 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

jaydeeo
Visitor
3 1 1

This is an accepted solution.

Thanks for your help, I got it working. So in the "new world" of fulfillment orders, upon cancelling a fulfillment on an "archived" order, one has to query again the GET fulfillment order for that specific order  again. In the response there are DIFFERENT fulfillment order ids (and fulfillment line item ids!), than at the time the order came in. Once the cancelled item is ready to be fulfilled again, both of these new ids have to be quoted in the POST fulfillment endpoint or it won't work.

 

This is structurally quite different to when fulfillments were directly linked to the orders. And I feel this could be made clearer in the documentation.