Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Last active February 23, 2018 19:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudiosanches/5b9ec3f707e5e9fac405 to your computer and use it in GitHub Desktop.
Save claudiosanches/5b9ec3f707e5e9fac405 to your computer and use it in GitHub Desktop.
WooCommerce 2.4 - Example of how generate an URL for the API Auth endpoint
<?php
$store_url = 'http://example.com';
$endpoint = '/wc-auth/v1/authorize';
$params = array(
'app_name' => 'My App Name',
'scope' => 'write',
'user_id' => 123,
'return_url' => 'http://app.com',
'callback_url' => 'https://app.com'
);
echo $store_url . $endpoint . '?' . http_build_query( $params );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment