php-shopify
php-shopify copied to clipboard
Change scopes during the OAuth handshake
Hi,
i need to change the scopes that was set at the installation of the app. See the last message https://community.shopify.com/c/Shopify-APIs-SDKs/How-to-add-scope-for-already-exitsing-APP-in-Shopify-iam-getting/m-p/321533
I want to know if the correct code for change access scopes is:
$config = array('ShopUrl' => $shopurl, 'AccessToken' => $access_token, 'scopes' => 'read_products,write_products,read_product_listings,write_product_listings,read_orders,write_orders,read_fulfillments,write_fulfillments,read_shipping, write_shipping,read_script_tags,write_script_tags' ); PHPShopify\ShopifySDK::config($config); $shopify = new PHPShopify\ShopifySDK;
Thanks in advace Best
@W3b3r Updating scopes is very similar to the initial installation authentication, except that you don't need to collect and store the access token again because you already have it (and Shopify will return the same token anyways). So please see the first part here: https://github.com/phpclassic/php-shopify#how-to-get-the-permanent-access-token-for-a-shop (Step 1 and 2)
@tareqtms Thanks for answare. I'm goingo to have a try, i will post the code in this issue post
Thanks Again :)