d
Topic
Posts:
35
6 months ago

public app php get products This post is outdated

Hey,

I have developed the app with reference code in php which will get the product listing of stores who will install the app

The problem is that the code which i have used is for session based.

If multiple merchants installs the app then how it will work the authenication process?

$shopify = shopify\client($_SESSION['shop'], SHOPIFY_APP_API_KEY, $_SESSION['oauth_token']);

$products = $shopify('GET /admin/products.json', array('published_status'=>'any'));

is $_SESSION['oauth_token'] is same always for that particular store?

 

 

i
Replies
Jamie D. Developer Experience
Posts:
513
6 months ago

Hi Santoor,

Yes, an OAuth access token has an unlimited lifespan and is only destroyed when the merchant uninstalls the application or you destroy the secret key that was used to generate that access token (from your partner dashboard).

Hope this helps!

Are you a Shopify app developer? We want your feedback! All respondents are eligible to win cool Shopify swag. https://shopifyapps.typeform.com/to/Jw3hQn