how to access shopify Products via API without api-key and password? - shopify

i want to develop a chrome extension to see stats for any store which develop in shopify, can i access any store products without API-Key and Password in shopify?

No, you cant access products json without using api-key or permanent token of the store.
But still you want to access the product details you atleast needs the handler of the product.
Lets say your store is "abc.myshopify.com" and handler of your product is "xyz", then you can product json of xyz by HTTP GET call in following url
https://www.abc.myshopify.com/products/xyz.json
in general
https://www.[storename]/products/[product-handle].json

You could try using the Shopify StoreFront API.
It allows to get information of your shop from from your own website or custom app. Although it doesn't need a API Password, it needs a Api Key that doesn't need to be a secret.
The documentation says this (the first point is the important):
Using the Storefront API, you can:
Fetch data about a single product or a collection of products to
display on any website or device.
Create unique checkout experiences
with full control over the shopping cart.
Create new customers or
modify existing ones, including address information.
Allow customers
to select unique product options.

There is no way shopify will provide store details (product list) without api authentication.
For your requirement, I would suggest to create a shopify app which will sync all product details to your storage and you can access data from there.

Related

Add product from external catalog and Spartacus cart

I have a scenario where we have an external web product catalog and user wants to Add the product from this external catalog to Spartacus cart.
The biggest constraint is the ext catalog (another software which cannot be customized) can only do a HTTP POST the payload containing multiple product ids, quantities, and other attributes through a callback URL. Since we are using Spartacus store-front, I don't think we can do a POST to a frontend endpoint like in accelerator. So that only gives us the option to POST to OCC API, which also brings troublesome for authentication, identify cart, etc. Is there any better solution/pattern?
If we can only update records via OCC, is there also a way to stream event to Spartacus to do cart refresh in UI?
Thanks for any suggestion!

Connect API to Shopify

I have searched for tons of threads here in Stack Overflow but I can't seem to find the fitting or direct answers.
So we would like to fetch products from API of external (outside Shopify) source then upload them to Shopify. Is there a way to do this without creating an app? This external source API provides already data in Shopify format.
Thanks!
In the Shopify store you wish to add these products to, you can create an access token with permission to create products. Using that token, you are free to make API calls to the Shopify store, with the data representing products, to create products in the Shopify store. Very simple pattern. Takes about 30 seconds of your time to create the access token in the Shopify store admin.
No you have to create APP for it.
As per latest updates from Shopify, you need to create "Custom App" atleast to get the Access Tokens and API keys, because Shopify has depreciated "Private apps" They work like Private apps, as those apps are specific to only one store, but these apps can give you all the needed permission to Create and Fetch Products.
You can create new apps from admin panel here: [YourStoreDomain]/admin/settings/apps/development
Documentations realated to it is: https://help.shopify.com/en/manual/apps/custom-apps
From Shopify: https://help.shopify.com/en/manual/apps/private-apps
Note Private apps are deprecated and can't be created as of January
2022. Ask your app developer to create a custom app. Like private apps, custom apps are built exclusively for your shop, but they don't
require open API access to your store or access to your Shopify admin.

Shopify Liquid / API: Accessing another customers' metafield data in liquid

I'm working with a client that wants to build some custom rudimentary affiliate functionality. The requirement includes two types of users: "owners" who are technically the affiliates and "customers". We are planning to use metafields to assign owners to customers (simply an integer metafield in the customer object that holds the owners userid, managed by a site admin). We would like to create a liquid template, accessible by the owners, that show a list of their customers and some customer and order metafield data. This requires one user (the owners) to be able to each into another user's (customers) metafield data. Is this possible in liquid without creating an externally hosted app?
If not, I assume this is possible via the API. In that case, is it possible to use the API right in liquid without creating an externally hosted app?
Thanks!
No, Shopify does not allow you to access customer objects (and by extension, metafields on other customer objects) other than the customer that is currently logged in.
To access arbitrary customer information, you will need to set up an app with admin permissions to access customers. While technically you could make admin API calls through the front-end, doing so would require exposing admin-level API credentials and would be a Very Bad Idea.
You will definitely want an externally-hosted app to run this code on, as the app you are describing will have access to PII and other sensitive data.

Building a shopify private or public app

I am trying to make a plan to update my client's shopify stores by building Shopify app or using external library. Basically, I want to provide my clients with some convenience by automating the inventory update, order process and extra stuff.
For now, I have only two scenarios.
Whenever my wholesale inventory changes, i want to update my client's shopify product list to be updated (quantity, price and product description) accordingly.
Whenever my client(shopify store owner) receives an order from his/her customer, i want the order information to be automatically transferred to my server.
If possible, I want my clients to be able to integrate with my application without any tech knowledge. I have looked into the Shopify app (public/private) and some external API(java), because I am a java developer.
I checked Shopify Java library which requires api key and password to be able to access shopify owner's store for product/order access, but I am not sure how user-friendly this approach is in terms of Shopify owner's side.
For Shopify public app, I am not familiar with it, so I am not sure how much I can do with it.
Could somebody provide some details about pros/cons about these approaches?
Thanks.
All you need to know is that with Shopify, you can connect to their shop using standard HTTPS. Even better, it's all GraphQL now. As for credentials, Shopify is fully modern and offers you two methods of getting credentials.
Your merchant client can create credentials with permissions right inside their Shopify Admin -> Apps. They give you the keys, you're in business
You get them (or you) to simply click install your App running at some HTTPS address, and you use oAuth to get the credentials.
Either way, makes no difference to the actual code you write to interact with their shop and deal with inventory, sales etc. You do not need to make your App public in the sense of App store, so you can use your partner dashboard to create an App and oAuth install, or like I said, use the private App way.

Bigcommerce API where to fine client ID

I have a store on bigcommerce and i need to access the customers registered on our store using there api.
I havent created any app over there. I need to access the customers registering on our store.
According to api i need to use client id which we get by creating an app.
https://developer.bigcommerce.com/api/#request-headers
But actually i dont need to create a app i just want to use the store and fetch the customer details using the api into another application, can anyone please tell me how to get client id from the dashboard login.
You can use the legacy API (non-oAuth) credentials instead.
Guide: https://support.bigcommerce.com/articles/Public/Legacy-API-Accounts