fulfillment orders returning {"errors":"The api_client does not have the required permission(s)."}

browntaped
Tourist
7 0 4

When trying to use the fulfillment orders API, we are getting the following error message.

{"errors":"The api_client does not have the required permission(s)."}

browntaped_0-1595821316303.png

What permissions are needed for this?

Replies 28 (28)
Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @browntaped 

Check out our scopes documentation here. You will likely need one of "read_assigned_fulfillment_orders", "read_merchant_managed_fulfillment_orders", or "read_third_party_fulfillment_orders".

Kevin_A | Solutions Engineer @ 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

Paul_McWhinnie
Shopify Partner
18 0 4

Hi, I am running into the same issue (after setting up permissions). 

I am using a private app.

Thanks,

Verona4869
New Member
1 0 0

May I ask, if you figured it out?
I have the same problem. All permissions are set, but I keep getting the message that my api_client doesn't have the authorization to access fullfillment orders.

Paul_McWhinnie
Shopify Partner
18 0 4

No luck. I have all permissions set and I am still getting {"errors":"The api_client does not have the required permission(s)."}

Does anyone know how to make this work. I really need to get location info for unfulfilled orders. 

TIA.

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Paul_McWhinnie 

Can you post your request ID header? 

Kevin_A | Solutions Engineer @ 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

Paul_McWhinnie
Shopify Partner
18 0 4

Hey back! 🙂

I have been testing from chrome (after logging in to my site)

https://smart-ho-omni-channel-qa.myshopify.com/admin/api/2020-10/orders/2915562619038/fulfillment_or...

All associated/relevant private app credentials are set to read.

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Paul_McWhinnie 

Try making the call from an API client using a private app secret that has permission for fulfillment orders. You might also be able to try from in chrome using the https://<key>:<secret>@store.myshopify.com/admin/api/2010-10/..... format. 

Kevin_A | Solutions Engineer @ 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

Paul_McWhinnie
Shopify Partner
18 0 4

Hi Kevin_A,

Already tried that.. same result.

Can you talk to the developers and see if this is a bug in Shopify?


Thanks,

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Paul_McWhinnie 

When using an API client, you should be able to see the response headers. If you could pass me the request id response header, I can take a look in our logs for you. 

Kevin_A | Solutions Engineer @ 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

API_Dev
Tourist
4 0 1
Gabe8
Shopify Partner
10 0 0

This is ridiculous! I am getting the same issue in multiple accounts, and whenever I contact Shopify Partner Support, all they do is direct me to these forums, where these issues remain unresolved.

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Gabe8 

Can you provide me with an x-request-id from the response headers so I can take a look?

Kevin_A | Solutions Engineer @ 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

Gabe8
Shopify Partner
10 0 0

Hi Kevin,

68cb1475-8b7e-4ff3-8635-aa276fee36cb

BTW, I tried it with all permissions set to at least Read.

 

Thank you!

Gabe

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Gabe8 

Looks like the request is originating from your browser and is inheriting permissions from what appears to be an authenticated staff account (normally we should see the request attached to an api key, but in this case it looks like there is a browser user agent). If you run this in a dedicated API client (I recommend against using one of the web based ones) you should be able to pull the fulfillment order details. 

Kevin_A | Solutions Engineer @ 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

Gabe8
Shopify Partner
10 0 0

Ok, that is indeed the cause of this particular message! You can't imagine how grateful I am for finally making some progress on this!

I actually tried it in a different browser instance, one where I am not logged in anywhere, and it worked.

 

Now, trying to access fulfillment orders in our client's LIVE website. Would you be able to tell me what the reason is for getting an empty list back for the same request? Example request IDs :1f479634-bd03-40a1-8653-0cfe81c145a5,  225109f6-a6a2-4994-ac52-d99616995ee9.

Are there other permissions that we need than what we already have?

{
"access_scopes": [
{
"handle": "write_orders"
},
{
"handle": "write_products"
},
{
"handle": "write_inventory"
},
{
"handle": "write_fulfillments"
},
{
"handle": "read_assigned_fulfillment_orders"
},
{
"handle": "read_orders"
},
{
"handle": "read_products"
},
{
"handle": "read_inventory"
},
{
"handle": "read_fulfillments"
}
]
}

Thank you!

Gabe

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Gabe8 

I don't think this is a permissions issue. Is it only for these 2 orders that you are seeing this or are you able to reproduce this for other orders as well? 

Kevin_A | Solutions Engineer @ 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

Gabe8
Shopify Partner
10 0 0

It never worked. I tried it with at least 5 or 6 orders today, 2 of them definitely in financial_status:paid, fulfillment_status:null, and canceled_at:null.

Throughout the last couple of months, I tried it with many more. Of course, back then from the wrong browser session (where I was logged into the our dev account).

Should it work on orders that have been fulfilled already, or which have been refunded?

Right now, they only have one refunded order, when querying orders.json, without "status=any". Just tried it on that one, and here's the request ID: 17b6954e-5242-4f31-af05-3dc7b0357d37

Here's the request id for a random recent fulfilled order: 17cbd53b-988a-4dec-a08a-6a492cc7405c

Thanks,

Gabe

 

Gabe8
Shopify Partner
10 0 0

Hi @Kevin_A ,

 

So right now the account where we need access to fulfillment_orders is the one where I made the following requests that I already sent you yesterday:

1f479634-bd03-40a1-8653-0cfe81c145a5

225109f6-a6a2-4994-ac52-d99616995ee9

 

I also made other requests to other accounts where:

- we have the read_fulfillments and read_assigned_fulfillment_orders permissions  - not sure which one we really need

- there are multiple active locations - is this one of the necessary criteria?

- there is an order that fits this criteria: ?status=open&financial_status=paid&fulfillment_status=unfulfilled

 

I got no data for fulfillment_orders.json - empty array in the response

Are the above the necessary criteria? What else should I check for?

 

These are the request IDs in case it helps looking at other examples:

b261d868-cf63-446b-aa8e-aef680add206

1192bf9f-3eb6-4796-b44b-265d61959a62

6ef342cd-00a9-49fd-8288-47b5f5054adc

c47a52d3-242d-41bb-81b0-e5f9071e3467

41de4d99-6a85-4ae8-9729-52bb7a73d21e

2c02e4e7-dcbb-41d7-9047-dc11baa7a8e4

 

Thank you,

Gabe

 

Kevin_A
Shopify Staff
Shopify Staff
318 42 61

Hey @Gabe8 

I know that there are certain situations where fulfillment orders won't be created (such as if all items are managed by a fulfillment service) but I will need to look into this further to confirm everything is working as expected here. 

Kevin_A | Solutions Engineer @ 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