# API Explorer

Run live Admin GraphQL, Admin REST and Storefront requests against your connected store, and manage its webhooks.

The **API Explorer** tab of the Shopify connector runs live requests against your store. It has three request surfaces, plus a separate **Webhooks** tab.

The Shopify API Explorer on Admin GraphQL with a query and its response.

## What you can do

- Query and change store data with Admin GraphQL, with autocomplete and the schema docs.
- Send Admin REST requests, starting from a list of common endpoints.
- Read the public catalog with the Storefront API, as your published storefront does.
- See the tokens and scopes of the connection.
- Create and delete webhook subscriptions.
- Send a query and its response to the chat with **Send to AI**.

The **Storefront** surface works at either connection level. **Admin GraphQL**, **Admin REST** and **Webhooks** need a [full access connection](/integrations/shopify#two-ways-to-connect), because they run against the Admin API through your own app.

> [!NOTE]
>
> **Your credentials stay on the server**
>
> The explorer sends your query to Lyna, which adds the access token on its server and returns only the response. Admin requests use short-lived Admin API tokens that Lyna gets from your app's Client ID and Client secret and renews on its own. Your Client secret and Admin tokens never reach the browser.

The explorer uses Shopify API version **2025-10**. It opens inside Shopify's page in Connectors and can expand to full screen.

## Admin GraphQL

Needs full access. Read and change store data with the Admin GraphQL API. Lyna's server sends a short-lived Admin API token in the `X-Shopify-Access-Token` header.

The Admin GraphQL surface is a full GraphQL workspace:

- An **editor** with autocomplete, plus variables and headers panels.
- A **schema and docs explorer** to browse every type and field of the Admin API.
- **History and tabs** that stay across sessions.
- The **query cost** in the response `extensions` (requested cost, actual cost and throttle status), so you see how each query uses Shopify's rate limit.
- **Send to AI**, which puts the last query and its response in the chat, so Lyna can explain it or use it in your app.

> [!NOTE]
>
> The GraphQL workspace is built for wide screens. Open the project on a desktop to explore the schema.

## Admin REST

Needs full access. Read and change store resources with the Admin REST API, with the same short-lived Admin API token added on Lyna's server.

The REST surface is a request builder:

- Pick a **method** (GET, POST, PUT, PATCH, DELETE) and a **Path** (for example `products.json`).
- Add query parameters as key and value pairs.
- Use the **Curated endpoints** menu for common resources: Products, Single product, Orders, Customers, Price rules, Inventory levels, Collects, Smart collections, Custom collections, Webhooks and Shop.

Prefer GraphQL when it has the same request. Use REST for endpoints with no GraphQL equivalent.

> [!WARNING]
>
> **Protected customer data**
>
> Requests that read customer or order data go through your own app. On a production store, Shopify may need to approve protected customer data on that app first. Development stores are exempt. If these reads report missing access, request the protected customer data permissions in your app's settings on Shopify.

## Storefront

Read public catalog data with the Storefront API. The storefront access token is public and safe to embed in your app, so this is the surface your published storefront uses.

The token comes from the Headless storefront you created in your Shopify admin during [Storefront connect](/integrations/shopify#connect-your-store). If the connection has no storefront token yet, choose **Provision Storefront token** in **Settings > Connectors > Shopify**. You manage the storefront's read permissions from the Headless channel in your Shopify admin.

The Storefront endpoint is `https://{shop-domain}/api/{version}/graphql.json`, called with the `X-Shopify-Storefront-Access-Token` header.

## Tokens and scopes

The connector's **Overview** tab shows what the connection can do:

| Item                         | What it is                                                                                                                                                                 |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Storefront access token**  | The public token your app uses to read the catalog and the cart. It comes from the Headless storefront of your store.                                                      |
| **Granted Admin API scopes** | On full access, the scopes your app was released with (for example `write_products`, `read_inventory`, `write_discounts`): the ones you pasted from Lyna's connect window. |

To change the Admin scopes, edit the app version in the Shopify [Dev Dashboard](https://dev.shopify.com/dashboard/), release it, and update the installation on your store. Lyna picks up the new scopes the next time it renews the token.

> [!WARNING]
>
> **Revoke access from Shopify**
>
> Your app's Client secret is stored encrypted on Lyna's servers and never shown in the browser. The Admin API tokens Lyna uses are short-lived and renew on their own. To revoke access, rotate the Client secret in your app's settings in the Dev Dashboard.

## Webhooks

Needs full access. The **Webhooks** tab lists the webhook subscriptions of your store, and lets you create or delete them. Shopify sends events to these endpoints when store data changes.

- **Create webhook**: choose a **Topic** and a **Callback URL**. Topics include `APP_UNINSTALLED`, `APP_SCOPES_UPDATE`, `SHOP_UPDATE`, `PRODUCTS_CREATE`, `PRODUCTS_UPDATE`, `ORDERS_CREATE` and `ORDERS_PAID`. The callback URL defaults to Lyna's own Shopify webhook route on the current site (`/webhook/shopify`).
- **Delete webhook**: stops Shopify from sending that topic to the endpoint.

You can manage the same subscriptions from the chat: ask Lyna to list, create or delete webhooks.

## Related

- [Shopify](/integrations/shopify): Connect a store and build your storefront.
- [AI Tools](/integrations/shopify/ai-tools): Let Lyna run these APIs for you from the chat.
- [Permissions](/integrations/shopify/permissions): Control who can change the store.
