Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.
Solved

Cancelling "Closed" Fulfilment Orders is not possible

gabripaz
Shopify Partner
7 0 4

Hello,
As process to migrate the cancel endpoint on the Fulfillment API due to its deprecation on version 2022-10, it is necessary to adapt requests made from Cancel Fulfillment to Cancel Fulfillment Order. However, it is not possible to Cancel a "Closed" Fulfillment Order using the FulfillmentOrder resource.

The following response is received:

Error 422 - "Fulfillment order is not in cancelable request state and can't be cancelled.".

Furthermore, it is possible to cancel the fulfillment manually by going to the order and cancelling the desired fulfillment.


cancelFulfillmentInOrder.png

 

So, since "Cancel" it is not one of supported actions for Fulfillment Order and Cancel Fulfillment is deprecated in version 2022-10, what should we do cancel an fulfillment successfully?


Thank you!

Accepted Solution (1)
RobZone
Shopify Staff
69 10 22

This is an accepted solution.

Yes, only the "/orders/{order_id}/fulfillments/{fulfillment_id}/cancel.json" endpoint is deprecated.  Use "/fulfillments/{fulfillment_id}/cancel.json" instead. 👍

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 4 (4)

gabripaz
Shopify Partner
7 0 4

[Update]

In 2020-10 release notes it is mentioned that the cancel fulfilment would be deprecated.

gabripaz_0-1671806617599.jpeg

 

In Fulfilment page after checking the changes between 2022-04 and 2022-10, we can verify the the cancel request that the release notes might be referring is the one that goes through order id.
So, will the endpoint "/admin/api/2022-10/fulfillments/{fulfillment_id}/cancel.json" be deprecated?

gabripaz_1-1671806617601.jpeg

 

 

gabripaz_2-1671806617601.jpeg

 

Thomotron
Shopify Partner
6 0 2

I've run across this recently as well while trying to cancel fulfilments akin to what's available in the web UI. Glad to see I haven't gone crazy searching through the API!

 

For what it's worth, this seems to make it impossible to programmatically cancel a partially fulfiled order via the REST API. In my instance, I have an order with three fulfilment orders: one completed, and one more open and unfulfiled at either location. Until that completed fulfilment is cancelled, the order will complain with a 422: "Cannot cancel a paid and fulfilled order". The GraphQL API does not provide any relief either.

RobZone
Shopify Staff
69 10 22

This is an accepted solution.

Yes, only the "/orders/{order_id}/fulfillments/{fulfillment_id}/cancel.json" endpoint is deprecated.  Use "/fulfillments/{fulfillment_id}/cancel.json" instead. 👍

To learn more visit the Shopify Help Center or the Community Blog.

Thomotron
Shopify Partner
6 0 2

Ah, thanks for pointing that one out! I feel a bit dumb for not looking harder at the API docs.