Skip to content

Instantly share code, notes, and snippets.

@jamiemtdwyer
Created January 19, 2018 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiemtdwyer/ed6cc09acf72c7e1d72f37094df4ff48 to your computer and use it in GitHub Desktop.
Save jamiemtdwyer/ed6cc09acf72c7e1d72f37094df4ff48 to your computer and use it in GitHub Desktop.
<?php
// Set variables for our request
$shop = $_GET['shop'];
$api_key = "1r30mrvCFMfq2DLGuIXyY2veEJVgTtDD";
$scopes = "read_orders,write_products";
$redirect_uri = "http://localhost/generate_token.php";
// Build install/approval URL to redirect to
$install_url = "https://" . $shop . ".myshopify.com/admin/oauth/authorize?client_id=" . $api_key . "&scope=" . $scopes . "&redirect_uri=" . urlencode($redirect_uri);
// Redirect
header("Location: " . $install_url);
die();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment