Retry Logged In user data in custom app (Shopify Plus Store)

Hello there,

I have shopify plus store so where we need to extend some functionality regarding the shipping rates.

I wants to show the different shipping rates as per user role.

ie. B2B user will have $10 and Other customer have $15 shipping charge so have somw logic like that.

So everything works good and I returned the custom rates but stuck to get the logged in user role so I can return the rates as per role.

I am using following Rest Api to get user detail :
curl -X GET “https://your-development-store.myshopify.com/admin/api/2023-10/users/current.json
-H “X-Shopify-Access-Token: {access_token}”
(https://shopify.dev/docs/api/admin-rest/2023-10/resources/user#get-users-current) .
But this api gives error in response : {“errors”:“Not Found”}.

Can anyone suggest or help me how we can get the current loggedin user data in custom app?

Thanks in advance.

Hi Maheshgaur,

Just to confirm, does your app have the necessary permissions/scopes to access the user data? Your app might lack the necessary access scope for the User resource, specifically the “read_users*”* or *“*write_users” scope.

Also the User API returns information about the staff members of a Shopify store, not the customers. It sounds like you’re trying to get information about a logged-in customer, not a staff member. In this case, you would need to use the Customer API, not the User API.

Hope this helps,

Yes, I wants to get the loggedin Customer data to check it’s B2B or not in my custom app.

So you told me to use the customer API, but there is not endpoints to get the loggedin user data.. so can you suggest me how we can make it possible?

Thanks for your interest on this.

Hello,
Now I am updating note attribute from cart.js but note is not received in shipping rate callback url (https://shopify.dev/docs/api/admin-rest/2023-10/resources/carrierservice#post-carrier-services) .

Thanks in advance.