Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to add app url

How to add app url

apatuka
Shopify Partner
3 0 1

Hello, i creatd an app but i dont know where to add Api URL because i have this error:

 

Oauth error invalid_request: The redirect_uri and application url must have matching hosts
 
And this is my code:
 

<?php
require('vendor/autoload.php');

$config = array(
'ShopUrl' => '*******',
'ApiKey' => '*******',
'Password' => '*******',
'Curl' => array(
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true
)
);

PHPShopify\ShopifySDK::config($config);

$scopes = 'read_products,write_products';
$redirectUrl = 'http://localhost:81/shopify/app.php';
\PHPShopify\AuthHelper::createAuthRequest($scopes, $redirectUrl);
?>

 

Can you provide me help or a detailed tutorial how to achieve this ?

 

Thank you

Reply 1 (1)

garyrgilbert
Shopify Partner
432 41 190

You can't use localhost as your redirectURL.  If you are developing on your local machine you need to either use NGROK or Localtunnel to act as a passthrough to your local host.

 

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution