storedevguide logo

Shopify Admin API: The Complete Beginner to Advanced Guide (2026)

Deepak KharwareDeepak Kharware
December 2, 2025
17 min read
403 views
Shopify Admin API: The Complete Beginner to Advanced Guide (2026)

n this guide, we’ll walk through what the Shopify Admin API is, how GraphQL works, and how you can start writing your first queries. We’ll also touch on the latest updates and features, so this will be a fun and practical introduction. Let’s get started.


Understanding the Shopify API Structure

Most of us are already familiar with how Shopify stores are structured.

At the first layer, we have the storefront, which is the front end of the website where products are displayed to customers.
Next, there’s the admin area, which acts as the store’s back end. This is where merchants manage products, collections, customers, and orders.

Behind all of this, Shopify maintains a database that stores every product, order, collection, and customer account. This data layer is not directly accessible to developers.

The Ultimate Shopify API Guide


Why the Shopify Admin API Exists

When you want to extend Shopify’s functionality—such as automatically printing an invoice for every incoming order—you can’t directly modify Shopify’s back-end code. That part of the platform is locked down.

Instead, developers build external apps. These apps rely on the Shopify Admin API to communicate with the store’s data.
For example, if you want to print invoices, your app needs access to order data. That information is retrieved through Shopify APIs.

In simple terms, the Admin API Shopify provides a secure programming interface that allows developers to read and modify store data stored in Shopify’s database.


What Is GraphQL and Why Shopify Uses It

Admin GraphQL API

Now that we understand what the Shopify API does, let’s talk about GraphQL, the query language used to interact with it.

GraphQL allows you to precisely define what data you want from the API. For example, you can request the IDs of the five most recent orders, and Shopify will return exactly that—nothing more, nothing less.

This makes GraphQL efficient, predictable, and well suited for modern Shopify app development.


Queries vs Mutations in Shopify GraphQL

When working with the Shopify Developer API, there are two core GraphQL operations you should know about:

1. Queries (Read Data)

Queries are used to fetch data from the Shopify Admin API.
They do not modify anything. Queries are strictly for reading information such as:

  • Products

  • Orders

  • Customers

  • Shop details

In GraphQL, queries often start with the query keyword, although this keyword can be omitted because queries are the default operation.

Shopify GraphQL Query Example

In a typical query, you might request specific fields—such as a product’s title—while passing a product ID as an argument.
This allows you to retrieve only the data you actually need, which is a major advantage over traditional Shopify REST API calls.

2. Mutations (Modify Data)

Mutations are used to create, update, or delete data.
With mutations, you can:

  • Update a product title

  • Create a new order

  • Modify customer information

Mutations always start with the mutation keyword.

Shopify GraphQL Mutation Example

A mutation begins with the mutation keyword, followed by the mutation name, such as productUpdate.
You provide input data, including the product ID and the fields you want to change—like updating a product title.

At the end of the mutation, you’ll see the selection set. This defines the data Shopify returns after the mutation runs successfully. This is useful for:

  • Error handling

  • Updating the user interface

  • Confirming that changes were applied correctly


How to Get Started with the Shopify Admin API

The fastest way to start writing and testing your first GraphQL queries is by using GraphiQL.

GraphiQL is a graphical GraphQL interface that allows you to:

  • Write queries and mutations

  • Test Shopify API responses

  • Explore Shopify API docs interactively

You can install the GraphiQL app directly on any Shopify store by following Shopify’s official installation link. Once installed, you’re ready to start experimenting with the Admin API right away.

Shopify Admin API vs Storefront API

During installation, you’ll be asked to enter your shop URL. Just below that, you can configure the access scopes for the app.
If you’re practicing with the Admin API Shopify for the first time, the easiest approach is to select the Admin API and enable all available scopes. This removes permission-related roadblocks while learning. Once selected, simply click Install.

You’ll then be redirected to your development store, where you can complete the app installation. When everything is set up, you’ll land on the GraphiQL welcome screen.


Choosing the Shopify Admin API and Version

By default, GraphiQL loads with a sample query. At the top of the interface, you can choose:

  • Which Shopify API you want to target

  • The API version

For learning and new projects, it’s best to use the latest available API version, as it includes the newest fields, improvements, and performance updates in the Shopify Developer API.

Make sure the Admin API is selected before running any queries.


Using the GraphiQL Explorer (Your Best Learning Tool)

GraphiQL Explorer

One of the most useful features when working with Shopify APIs is the GraphQL Explorer, located on the left side of the interface.

This explorer shows:

  • All available objects

  • Every field you can request

  • Arguments you can pass to queries

For example, the default query often includes:


{ shop { name } }

If you scroll through the explorer, you’ll find the shop object and its available fields listed underneath.
If you deselect the name field, it immediately disappears from the query.
If you remove the entire shop object, it also disappears from the query.

This live syncing makes GraphiQL extremely helpful when learning the Shopify API docs structure.


Example: Fetch the 5 Most Recent Orders (Admin API Shopify)

For this demonstration, let’s say we want to fetch the five most recent orders from the store.

In the GraphQL Explorer:

  1. Scroll to the orders object

  2. Open it

  3. Set first: 5

  4. Enable reverse: true (to get the newest orders first)

  5. Under nodes, select id

Your query will look like this:


{ orders(first: 5, reverse: true) { nodes { id } } }

This query tells the Shopify Admin API:

  • Fetch only five orders

  • Sort them so the most recent order appears first

  • Return only the order IDs


Executing the Query and Understanding the Response

To execute the query, simply click the Play ▶ button.

GraphiQL Explorer play button

The response is returned inside a data object:


{ "data": { "orders": { "nodes": [ { "id": "gid://shopify/Order/123456386" }, { "id": "gid://shopify/Order/123456385" } ] } } }

Under orders, you’ll see the exact IDs you requested.
You can verify these by navigating to Orders in your Shopify admin and checking the most recent order. You’ll notice the ID matches perfectly, confirming the query worked as expected.


Understanding Shopify API Rate Limits (GraphQL Cost System)

There’s a second part of the response that’s especially important when working with the Admin API Shopify: the cost object.

Shopify enforces API rate limits to prevent:

  • Infinite requests

  • Overly complex queries

  • Performance degradation

Each GraphQL query has a cost, measured in points.

On this store:

  • Maximum available points: 2,000

  • Restore rate: 100 points per second

This limit depends on your Shopify plan:

  • Standard Shopify plans: ~100 points/second

  • Shopify Plus: up to 1,000 points/second

This is documented clearly in the Shopify API docs, and it’s something every developer should understand when building production apps.


Latest Shopify Update: Higher GraphQL Admin API Limits

One of the most notable recent updates from Shopify Editions is that GraphQL Admin API rate limits were doubled.

Higher GraphQL Admin API Limits

This is a major improvement, especially when you consider:

  • The scale of Shopify’s ecosystem

  • The number of active stores

  • The volume of API requests happening every second

Higher rate limits mean:

  • Better performance

  • Fewer throttling issues

  • More flexibility for complex Shopify apps

It’s a significant bandwidth increase—and a big win for developers working with the Shopify REST API or GraphQL-based workflows.

Webhooks Explained: Shopify, Zapier, Slack & Discord Automation Made Simple (2026 Guide)

Beyond the maximum points available on your store and the restore rate, Shopify also shows how many credits are currently available immediately after a query is executed.

In many cases, you’ll notice that your available points refill almost instantly. Alongside that, Shopify displays:

  • Requested Query Cost

  • Actual Query Cost

Why Requested and Actual Costs Can Differ

There can be a difference between the estimated and actual costs.
For example, you might request the first 10 products that have a stock level lower than five. However, if only two products actually match that condition, Shopify only processes and returns those two.

In this case:

  • The requested estimate is higher

  • Only the actual query cost is deducted from your available points

Most of the time, you won’t need to worry about this difference. However, it becomes important when:

  • Looping through very large product catalogs

  • Running multiple queries in quick succession

  • Building background jobs or bulk operations

To stay safe, always include timeouts, batching, or throttling logic so your app never runs out of available credits when using the Admin API Shopify.


Moving Closer to Production: Using Shopify CLI

Now that we have the fundamentals down, the next step is running GraphQL queries inside a real app environment.

Shopify CLI

With the latest Shopify CLI and Remix-based app templates, creating a Shopify app takes only a couple of minutes.

Create a New Shopify App

Open your terminal and run:


npm init shopify app latest

Then follow the prompts:

  • Enter an app name (for example: test-app)

  • Choose Remix

  • Select JavaScript

  • Wait for the setup to complete

Once finished, you’ll see a new project folder containing all the required app files.


Running the App Locally

Navigate into your app directory and start the development server:


cd test-app npm run dev

During setup, you’ll be asked to:

  • Select your Shopify Partner account

  • Choose the development store where the app should be installed

After the setup completes, Shopify provides a preview URL. Opening this link lets you install the app on your development store.

Once installed, you’ll see the default Remix starter UI with:

  • Helpful resource links

  • Sample UI components

  • Buttons to generate random products

At this point, your Shopify app is successfully running.


Using the GraphQL Preview Link Inside Your App

One very useful feature is the GraphQL preview link generated for your app.

This interface looks similar to GraphiQL, but with one critical difference:
It uses the same access scopes as your app.

This allows you to:

  • Test GraphQL queries in a real app context

  • Verify permissions before writing production code

  • Catch scope-related errors early

Many professional Shopify agencies rely heavily on this preview tool when building apps with the Shopify Developer API.


Example: Scope Error When Access Is Missing

Let’s reuse the previous query that fetches the five most recent orders:


{ orders(first: 5, reverse: true) { nodes { id } } }

If your app does not have permission to read orders and you execute this query, Shopify will return an error similar to:

Access denied for orders field

This means the query itself is valid, but your app lacks the required Access scope.

https://shopify.dev/docs/api/usage/access-scopes

Fixing Access Scope Errors in Shopify Apps

To resolve this, open your app’s configuration file:


shopify.app.toml

Under access_scopes, you might see something like this:


access_scopes = "write_products,read_products"

To allow order access, update it to include read_orders:


access_scopes = "write_products,read_products,read_orders"

After saving the file, follow these steps:

  1. Stop the dev server

  2. Deploy the updated app configuration


npm run deploy
  1. Restart the development server


npm run dev
  1. Reinstall the app or update permissions in the Shopify admin
    Click Update data accessUpdate

Once the new scopes are applied, rerun the GraphQL query, and it will execute successfully.


Why This Matters for Admin API Shopify Development

Permissions are one of the most common issues developers face when working with:

  • Shopify APIs

  • Admin API Shopify

  • Shopify REST API to GraphQL migrations

Using the GraphQL preview tool ensures:

  • Your queries match your app’s permissions

  • You avoid runtime errors in production

  • You stay compliant with Shopify’s security model

Even though we didn’t change anything in the app’s user interface, everything still looks the same on the surface. However, if we open GraphQL Preview again and rerun the same query, we should now be able to execute it without errors.

And yes — it works.

In this development store, there are no orders yet, so the response comes back as an empty array. That’s totally expected. The important part is that:

  • The query executes successfully

  • There are no access denied or scope errors

  • The permissions are correctly applied

This is why the GraphQL preview tool is so powerful when working with the Admin API Shopify. You can:

  • Test queries safely

  • Validate syntax

  • Confirm access scopes

  • Understand what the response structure looks like

In this case, it also reveals something important: the store doesn’t have meaningful test data yet. That insight alone can save a lot of confusion later.


Why GraphQL Preview Is Essential for Shopify App Development

This tool is one of the easiest ways to:

  • Build GraphQL queries step by step

  • Validate permissions before shipping

  • Catch missing scopes early

  • Experiment with Shopify APIs without touching production code

If you’re serious about working with the Shopify Developer API, this is a tool you’ll end up using a lot.


Making GraphQL Requests from Code (Final Missing Piece)

The last piece of the puzzle is understanding how GraphQL queries and mutations are executed from your app code.

how GraphQL queries and mutations are executed from your app code

Conveniently, the Remix app starter template already includes a working example.

On the home screen, you’ll notice a button labeled Generate a Product. When you click it, a random product—like a snowboard in a random color—is added to your development store.

Behind the scenes, this is done using a GraphQL mutation through the Admin API Shopify.

Headless Shopify Tutorial 2026: Complete Step-by-Step Guide to Build a Faster, Scalable Store

Exploring the Example in the Codebase

Let’s take a look at how this works.

Open your project in VS Code, then navigate to:


app/routes/app._index.jsx

This file corresponds directly to the home screen UI you see in the app.


Finding the “Generate a Product” Button

Scroll down to the JSX markup. You’ll find a button that looks something like this:


<Button onClick={generateProduct}> Generate a product </Button>

This confirms we’re looking at the correct component.

Below the button, there’s also a conditional block that checks whether a product was created successfully. If data is returned, it renders the JSON response on the screen—just like what you saw in the UI after clicking the button.

For now, the important part is the onClick handler.


Understanding the generateProduct Function

When the button is clicked, the generateProduct function is triggered.
You’ll find its definition near the top of the same file.

This function submits a form. That part isn’t related to GraphQL—it’s a Remix-specific pattern for handling actions.

Once the form is submitted, Remix automatically calls the action handler for this route.


The Action Handler and Shopify Authentication

Scroll down until you find something like this:


export const action = async ({ request }) => { // authentication logic };

Inside this action function:

  • Shopify authentication is handled first

  • This is done using helper utilities provided out of the box

  • You don’t need to manually manage tokens or sessions

This setup ensures that any GraphQL request sent from here is:

  • Authenticated

  • Scoped correctly

  • Executed securely against the Admin API Shopify

From here, the app performs a GraphQL mutation to create a product and then returns the response back to the UI.

Inside the app code, the next thing happening is fairly straightforward.
The example picks a random color for the snowboard product that’s about to be created. This color is later used to generate the product title, such as Blue Snowboard or Red Snowboard.Just below that logic, you’ll find the actual GraphQL request, which is executed using a helper package provided by the app template.This is where everything we’ve learned so far comes together.


The GraphQL Mutation Behind “Generate a Product”

The app uses a GraphQL mutation—specifically one named populateProduct.
Along with the mutation, it passes structured data, including:

  • The product title, built from the random color plus the word Snowboard

  • A randomized price for the product variant

Here’s a simplified version of what that mutation looks like conceptually:

GraphQL Mutation create product

mutation populateProduct($input: ProductInput!) { productCreate(input: $input) { product { id title variants(first: 1) { nodes { price } } } } }

The variables passed into the mutation include the dynamic values:

  • Product title

  • Variant price

  • Any other required product fields


Handling the GraphQL Response

After the mutation runs successfully, the response is handled immediately.

In this example:

  • The returned data is not transformed

  • The entire response is returned as JSON

  • That JSON is rendered directly on the app’s home screen

This makes it very easy to:

  • See what Shopify returns

  • Understand the response structure

  • Debug mutations during development


Full Flow Recap (End-to-End)

From the app dashboard, the full flow looks like this:

  1. Click Generate a Product

  2. generateProduct function is triggered

  3. A GraphQL mutation is sent to the Admin API Shopify

  4. Shopify creates the product

  5. The response is returned

  6. The JSON output is displayed on screen

This is a clean, production-ready example of how Shopify apps interact with Shopify APIs using GraphQL.


Why This Example Is Worth Studying

If you’re building a Remix-based Shopify app, this example is gold. It shows:

  • How to authenticate API requests

  • How to structure GraphQL mutations

  • How to pass variables safely

  • How to handle responses cleanly

If you’re using a different tech stack, the same principles apply.The Shopify GraphQL Admin API reference includes examples for:

  • Node.js

  • cURL

  • Python

  • PHP

No matter your preferred language, the Shopify API docs  provide ready-to-use examples for making GraphQL requests.


Highlights and Latest GraphQL Admin API Updates

Before wrapping up, let’s quickly review some important highlights and recent updates to the GraphQL Admin API.One of the biggest updates is the introduction of support for up to 2,000 variants per product using the new GraphQL Product API.This is currently in developer preview and will roll out gradually.

Latest GraphQL Admin API Updates

Previously, products were limited to 100 variants, which became a major pain point for merchants offering multiple sizes, colors, or configurations. Since variants multiply quickly, many stores hit that limit fast. Moving to 2,000 variants is a massive improvement.


Ongoing GraphQL API Expansion

The GraphQL API continues to expand rapidly. Recent improvements include:

  • Ability to cancel orders via GraphQL

  • Support for combined listings

  • Expanded coverage across admin features

Shopify is consistently moving functionality from REST to GraphQL, making the GraphQL Admin API the future-proof choice.


Increased Rate Limits

As covered earlier, Shopify recently increased GraphQL rate limits, giving developers:

  • More bandwidth

  • Higher throughput

  • Better performance for complex apps

This is especially valuable when working with large stores or high-volume operations.


Improved Developer Experience

Shopify also introduced:

  • A hotkey to launch the GraphQL interface

  • Better tooling for query exploration

  • Faster iteration when testing queries and permissions

Together, these improvements significantly enhance the day-to-day developer experience.


Final Thoughts

At this point, you’ve seen the full picture:

  • What the Admin API Shopify is

  • How GraphQL fits into Shopify’s architecture

  • The basics of queries and mutations

  • How to test queries safely

  • How to run GraphQL requests from production code

  • How Shopify is evolving the GraphQL API

What you build next depends entirely on your goals—but you now have the right tools and mental model to move forward confidently.If you want deeper coverage, official resources and updates are always available in the Shopify API docs and release notes.Thanks for reading, and if you need help or want to go deeper into a specific topic, feel free to explore further or reach out. Have an amazing day

Share:

Join the Discussion (0)