Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

API showing order fulfillment as not in an open state, when it is

API showing order fulfillment as not in an open state, when it is

Brady-Agranoff
Shopify Partner
7 0 1

Hi! 

I'm creating a custom shopify fulfillment app, and am trying to handle the rejection of cancellation requests.

When I go to create a new cancellation request, I find an open order (by going to my orders page in my development store, and adding the open filter), and then request cancellation. 

I reject the request and the response body I get is the following:

{"errors":["The fulfillment order is not in an open state."]}

When I refresh the orders page, it is still showing the order as open. 

this is the URL (including the fulfillment order ID) for my order I'm testing with. 

https://hoopswagg-fulfillment-test-store.myshopify.com/admin/api/2021-10/fulfillment_orders/49676085...

I have also tried accepting it to test, and I get the same error. 

 

Thanks everyone!

 

Replies 2 (2)

Luke_K
Shopify Staff
402 66 102

Hey @Brady-Agranoff 

I managed to have a dig into this - one thing I noted in the logs for the F/order ID on your store, is that the it transitions to a closed state at 14/11/2021
22:42:17 (UTC) when an Auto job for Order Fulfillment runs. The f/order that belongs on the order IID transitioned to a closed state at that timestamp.

I checked out the checkout settings of the store, and the toggle to 'Auto fulfill an order's line items after an order is paid' is set to checked. That auto fulfill job I mention, won't run unless the toggle is switched on - which looks to be why you're getting the receipt of the message about it not being in an open state. Is it part of your workflow to have it set to Auto fulfill? Thanks!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
Brady-Agranoff
Shopify Partner
7 0 1
Hi! I noticed this was a wrong description of my error, and I learned more
about what's going on.

If you could try to help on this thread it would be much appreciated!

https://community.shopify.com/c/shopify-discussions/cannot-figure-out-how-to-handle-fulfillment-canc...