Skip to content

Instantly share code, notes, and snippets.

View ajay399's full-sized avatar

Ajay Rabari ajay399

View GitHub Profile
@fmtarif
fmtarif / shopify-oauth.php
Created November 28, 2019 12:01
#php #shopify example app showing Shopify app oAuth flow
<?php
$apiKey = 'your-app-key'; //from partner account app settings
$secret = 'your-secret-key'; //from partner account app settings
$scope = 'read_products,write_products,write_script_tags,read_price_rules,write_price_rules,read_customers,write_draft_orders'; //required permissions
$redirectUri = 'https://app-url'; //this URL has to be in "Whitelisted redirection URL(s)" in shopify partner account app setting
$access_token_url_format = "https://%s/admin/oauth/access_token";
$auth_url_format = "https://%s/admin/oauth/authorize?client_id=%s&scope=%s&redirect_uri=%s";