We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

how to get admin user name who create order using graphql

how to get admin user name who create order using graphql

pramod1222
Shopify Partner
5 0 0

$query = <<<'GRAPHQL'
query {
order(id: "gid://shopify/Order/11111") {
id
name
staffMember {
id
name
}

 

I am getting this error

{"errors":[{"message":"Access denied for staffMember field. Required access: `read_users` access scope. Also: The app must be a finance embedded app or installed on a Shopify Plus or Advanced store. Contact Shopify Support to enable this scope for your app.","locations":[{"line":5,"column":5}],"path":["order","staffMember"],"extensions":{"code":"ACCESS_DENIED","documentation":"https://shopify.dev/api/usage/access-scopes","requiredAccess":"`read_users` access scope. Also: The app must be a finance embedded app or installed on a Shopify Plus or Advanced store. Contact Shopify Support to enable this scope for your app."}}],"data":{"order":{"id":"gid://shopify/Order/4480361398401","name":"CM49733","staffMember":null}},"extensions":{"cost":{"requestedQueryCost":2,"actualQueryCost":2,"throttleStatus":{"maximumAvailable":20000.0,"currentlyAvailable":19998,"restoreRate":1000.0}}}}
}
}
GRAPHQL;

i need using this query get admin username

Replies 4 (4)

CodingFifty
Shopify Partner
1102 161 190

Hey @pramod1222,

 

You are seeing this error because the `staffMember` field in the Shopify GraphQL API requires special permissions. To access it, your app must have the `read_users` scope and be either a finance embedded app or installed on a Shopify Plus or Advanced plan. If your store doesn't meet these conditions, the field will return `null`, and there’s no alternative way to programmatically retrieve the admin username through this query.

Coding Fifty || Shopify Partner
For any custom section queries, please visit: Fiverr Profile
Found my response useful? Like it and mark as Accepted Solution!
For additional discussions, reach out via: Email ID: codingfifty@gmail.com
pramod1222
Shopify Partner
5 0 0

Hey,

how we can get that read_users permission? also who can provide access

pramod1222
Shopify Partner
5 0 0

Hi

i need to grant read_users permission but in my store it not visible how can i give this scope permisssion?

pramod1222
Shopify Partner
5 0 0

Hi,

Requires read_users access scope. Also: The app must be a finance embedded app or installed on a Shopify Plus or Advanced store. Contact Shopify Support to enable this scope for your app. So please enable this scope its urgent