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!
Solved! Go to the solution
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.
I just tried it out with a merchant and it doesn't seem to be working:
with order_id 2687020335266 and fulfillment_id 2535651639458
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,
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"
This is an accepted solution.
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.