Development discussions around Shopify APIs
$url="https://{{domain}}.myshopify.com/admin/customers/4873003651.json";
$username='XXXXXXXXXXX';
$password= "XXXXXXXXXXXX";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code
$result=curl_exec ($ch);
curl_close ($ch);
print_r($result);
The Result iam getting this error
{"errors":"[API] This action requires read_customers scope."}
When you set up your private app you can give very specific read/write permissions. So presumably your app does not have read access for customers.
https://help.shopify.com/api/guides/authentication/oauth#scopes
If you can edit the private app settings then it should be easy enough to fix.
If you DO have that permission and are still getting that error then I'm sorry I have no idea!
For a private application, you can set the access scopes in the Private apps section of the shop's admin dashboard For public, partner-created apps, you'll need to request the additional scope during the OAuth handshake.
Jamie | 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 the Shopify Help Center or the Shopify Blog
User | RANK |
---|---|
50 | |
11 | |
6 | |
5 | |
5 |
Thanks to all who participated in our AMA with 2H Media on planning your 2023 marketing bu...
By Jacqui Mar 30, 2023Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023