A private Shopify app can interact with the Shopify API on behalf of a single store. To authenticate with Shopify using a private app, you'll need to generate the credentials from the Shopify admin and provide these credentials in your request to Shopify.
Generate credentials from the Shopify admin
Before you can authenticate a private app to Shopify, you'll need to generate the required credentials from the Shopify admin of the store that you want to connect with your application. If you don't have a Shopify store, then you can log in to your Partner dashboard and click Development stores to create a test store.
After you've provisioned a test store, log in and then generate the required credentials from the test store admin:
From your Shopify admin, go to Apps.
Click Manage private apps, near the bottom of the page.
Click Create new private app.
In the Description section, enter a name for the private app and a contact email address.
Shopify uses the email address to contact the developer if there is an issue with the private app, such as when an API change might break it.
In the Admin API section, select the areas of your store that you want the app to be able to access.
If you want to use the Storefront API, then select Allow this app to access your storefront data using the Storefront API. This will generate a Storefront access token.
You'll see your API key and password in the Admin API section. You can use these credentials to make authenticated requests to the Shopify store that uses your application.
If you allowed the app to access your storefront data, then you'll see a Storefront access token in the Storefront API section.
Make authenticated requests
Private apps authenticate with Shopify through basic HTTP authorization, where the API key of the app is the username, and the Password is the password. You can generate these credentials from the Shopify admin of the store that you want to connect with your app.
Some HTTP clients support basic authentication by prepending
username:password@ to the hostname in the URL. For example:
If your HTTP client doesn't support basic authentication using this method, then you can provide the credentials in the
Authorization header field instead:
Join the API key and password with a single colon (
Encode the resulting string in base64 representation.
Prepend the base64-encoded string with
Basicand a space: