App reviews, troubleshooting, and recommendations
Hello I am trying to retrieve the data from the marchant account by using the partners account with the below python code. I am not getting any Authorization code. Please resolve this or suggest how to do that.
import shopify
import binascii
import os
# Set up the Shopify API session
API_KEY = '22434e0c8d10dcd3f72f187c1d7149e5'
API_SECRET = 'b725127b7309553d0489f40a35d27138'
APP_NAME = 'Online Store'
SHOP_NAME = '58402c.myshopify.com'
API_VERSION = '2023-04'
REDIRECT_URI = 'https://58402c.myshopify.com/oauth/callback'
# Set up the session with your API Key and Secret Key
shopify.Session.setup(api_key=API_KEY, secret=API_SECRET)
# Set up the authentication URL
session = shopify.Session(SHOP_NAME, API_VERSION)
pos = binascii.b2a_hex(os.urandom(15)).decode("utf-8")
scopes = ['read_products', 'read_orders']
auth_url = session.create_permission_url(scopes, REDIRECT_URI, pos)
if 'state' in auth_url:
auth_url=auth_url.replace('state','fstate')
# Redirect the user to the authentication URL and prompt them to accept the permissions
print(f"Please go to this URL to authenticate with Shopify:\n{auth_url}\n")
# Wait for the user to authenticate and then enter the code parameter provided in the redirected URL
code = input("Please enter the code parameter from the redirected URL: ")
# Request an access token using the code parameter
session.request_token({'code': code})
# Activate the session and access the products table
shopify.ShopifyResource.activate_session(session)
products = shopify.Product.find()
# Print out the list of products
for product in products:
print(product.title)
# Clear the session
shopify.ShopifyResource.clear_session()
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025