Shopify API Configuration - shopify

When we created a API, I figured that I need to configure a new Shopify like this
const Shopify = require('shopify-api-node');
const shopify = new Shopify({
shopName: 'your-shop-name',
apiKey: 'your-api-key',
});
Is there any way to get the Shopify "your-shop-name" programmatically? So If I installed the app on another one it won't need to change. Or is there any other way to configure the API on Shopify?
I primarily need to update the product description using Admin REST API.

In your store, where you want to change descriptions using API calls, use the Admin App section to issue yourself an API key pair. You can give that key pair permission to edit products. And you're done! You have the store name obviously, and you have your access token. Nothing to it!

Related

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.

How to add script to the front side of the shopify app

As i am new to shopify app i created an app and installed over a store with script tag having read and write permission . How can i dynamically add the javascript to the front side of shopify app.
Use the Script Tag API to create the javascript you want to load dynamically.
# POST /admin/script_tags.json
{
"script_tag": {
"event": "onload",
"src": "https://djavaskripped.org/fancy.js"
}
}
Documentation: Link
When your App is installed in a Shop, the merchant usually gets two dialogs to confirm. One is if you are asking for a billing charge. The other is for the scopes access to their shop. Assuming they approve both, you will get an oAuth token allowing you to read/write ScriptTag endpoint.
So when you get that oAuth token, you save it along with the shop name, and that is finally when you can POST your script tag payload in the store.

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

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.

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

Get API key and secret key via Shopify API?

I'm a beginner Shopify developer. I would like to create my application for Shopify store (not private). I want to show api_key and secret_key after installation plugin by merchant. I viewed a lot of tutorials and all of them looks like get this values from nothing. That's why I want to know the answer on 1 question:
1) Is it possible to retrieve from Shopify API api_key and secret_key for application?
I'll be very appreciate, if someone helps me with this issue.
You cannot retrieve your App's App key and Secret through a Shopify API call.
Those keys are used for authorizing your app to be able to gain API access on a particular shop. They are something particular to your app and you don't need an API call for it.
You can find those keys on your App listing on your Shopify Partner account.
This is confirmed by the Shopify API documentation where it doesn't mention you can do this.