Skip to content

Instantly share code, notes, and snippets.

@claudiosanches

claudiosanches/index.php

Last active Feb 23, 2018
Embed
What would you like to do?
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