Cannot cancel fulfillment

Solved
Highlighted
Shopify Partner
11 0 1

Hi there,

I am having trouble cancelling a fulfillment.

I am using the REST API specifically this one https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillment#cancel-2020-0...

With order_id: 2332565700678, fulfillment id: 2209730494534

This is the error I get: `ActiveResource::ResourceInvalid (Failed. Response code = 422. Response message = Unprocessable Entity (An error occurred, please try again).)`

Is there a reason why I can't cancel this fulfillment? The error message is a little vague. I have successfully cancelled other fulfillments so I suspect there is something special with this one. Thanks you!

0 Likes
Highlighted
Shopify Partner
11 0 1

Request ID, for when I did the request on Wed Sep 16 13:51:56 EDT 2020

X-Request-ID: 919cb362-32ad-45e5-b4c7-93c37e785a25

0 Likes
Highlighted
Shopify Staff
Shopify Staff
619 76 139

Hey @sengming,

I checked the logs for that request, and it looks like your app doesn't have the write_fulfillments scope. Once you have that scope your call should work as expected.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
11 0 1

Thanks! I can't wait to try it out!

0 Likes
Highlighted
Shopify Partner
11 0 1

Hi there,

I just tried it out with a merchant and it doesn't seem to be working:

with order_id  2687020335266  and fulfillment_id 2535651639458

X-Request-ID: 70d3c50e-9070-4d24-976c-faedeb0b7d75

can you have another look at it please?

I am still getting the same error. Apologies for using using a different merchant, the merchant from the original post still has not had a change to update their permissions yet.

 

```

{
"errors": "An error occurred, please try again"
}

```

 

One more thing, according to the access scopes page,

https://shopify.dev/docs/admin-api/access-scopes

the `write_fulfillments` scope accesses fulfillment services. I'm not sure how this relates to this problem? I'm trying to cancel a "fulfillment" not a "fulfillment service"

Thanks!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
619 76 139

This is an accepted solution.

Hey @sengming,

You're correct about the scope, my apologies on that. The correct scope is write_merchant_managed_fulfillment_orders. This scope allows you to make changes to fulfillments which are fulfilled from locations managed by the merchant (as opposed to a fulfillment service). I've double checked and confirmed your app doesn't currently have this scope, and I've tested to ensure that granting this scope allows fulfillments to be cancelled as expected. 

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like
Highlighted
Shopify Partner
11 0 1

thanks for the update @_JB ! Lemme try it out and I'll let you know if it works. Crossing my fingers!

0 Likes
Highlighted
Shopify Partner
11 0 1

Thanks for the help @_JB ! It looks like this is working now.

0 Likes
Highlighted
Pathfinder
309 1 30

Was this change announced to the developers?

I make apps and can help you in setting up payment gateways..
0 Likes