Lyna
SupportBlog
IntroductionFeaturesIntegrationsTips & TricksChangelog
Shopify

How Lyna AI works with Shopify

When a store is connected, Lyna's AI agent manages it for you from chat by calling Shopify tools. You describe what you want ("create three candle products", "publish everything to the Online Store", "set up a 10% welcome code") and Lyna runs the matching tools against your store.

Lyna calling a Shopify tool in chat

Lyna works across two surfaces:

  • Admin (server side): catalog management (products, collections, discounts, orders). Lyna never holds your Admin token. Every Admin call is proxied through Lyna's server, which owns authentication and the permission gate.
  • Storefront (client side): the public read and cart API your shoppers' browser talks to, using the public Storefront token that is safe to embed.

The workflow

  1. Lyna checks the connection status first.
  2. If no store is connected, Lyna shows a setup card so you can create or connect a store, then waits for you.
  3. Once connected, Lyna runs read tools freely and asks for approval on write tools, based on your permissions.

Lyna returning a product list from the store

Read tools need no approval. Write tools are approval-gated: with the default "Ask each time" level, Lyna explains what it is about to do and waits for your confirmation. A tool set to "Never" returns a permission-denied result, and Lyna will not retry it.


Tools reference

The tables below list every Shopify tool, grouped by area, with its read or write classification. Write tools appear in the per-tool permission matrix and are approval-gated; read tools are available to any editor and are not individually gated.

Connection and setup

ToolTypeWhat it does
Check statusReadCheck whether a store is connected to the project.
Propose setupReadShow the create / connect setup card when no store is connected.
Get store create URLReadOpen Shopify's store-creation page for a new store.
Get storefront credentialsReadReturn the public Storefront token and shop domain for the app.
Disconnect storeWriteDisconnect the store from the project (owner only).

Products and variants

ToolTypeWhat it does
List productsReadList products in the store.
Get productReadFetch a single product with its variants and images.
Create productWriteAdd a product with variants, images, and pricing.
Update productWriteEdit a product's title, description, tags, status, or media.
Delete productWritePermanently remove a product.
Add product imageWriteAdd an image from a URL, an upload, or an AI-generated image.
Add product variantWriteAdd a variant such as a size or color.
Update product variantWriteEdit a variant's price, SKU, inventory, or options.
Delete product variantWriteRemove a variant from a product.

Collections

ToolTypeWhat it does
List collectionsReadList collections in the store.
Create collectionWriteGroup products into a new collection.
Update collectionWriteEdit a collection's title, description, or membership.
Delete collectionWriteRemove a collection.

Discounts and pricing

ToolTypeWhat it does
List discount codesReadList code-based discounts.
List price rulesReadList price rules.
Create discount codeWriteCreate a code with a percentage or fixed amount, dates, and limits.
Update discount codeWriteEdit a discount code's value, schedule, or limits.
Delete discount codeWriteRemove a discount code.
Create price ruleWriteCreate a price rule that defines how a discount applies.
Update price ruleWriteEdit a price rule's conditions or value.
Delete price ruleWriteRemove a price rule.
Create automatic discountWriteCreate a discount that applies automatically at checkout.

Inventory and content

ToolTypeWhat it does
List locationsReadList the store's inventory locations.
Get shopReadRead store name, currency, and plan.
List metaobjectsReadList entries of a custom content type.
Set inventoryWriteSet available inventory for a variant at a location.
Set metafieldWriteCreate or update a metafield on a product, collection, or other resource.
Create metaobject definitionWriteDefine a custom content type for structured content.
Create metaobjectWriteAdd an entry of a custom content type.
Upload fileWriteUpload an image or file to the store's content library.

Orders and customers

ToolTypeWhat it does
List ordersReadList recent orders.
Get orderReadRead a single order.
List fulfillmentsReadList an order's shipments and tracking.
List customersReadList customers.
Get customerReadRead a single customer.
Create draft orderWriteDraft an order for a customer before it is finalized.
Complete draft orderWriteTurn a draft order into a real order.

Reading orders and customers uses Shopify's Protected Customer Data scopes. Development stores are exempt, but production stores need Shopify's approval for those scopes. If a read reports missing scopes, add them in Shopify and reconnect the store.

Sales channels

ToolTypeWhat it does
List publicationsReadList the store's sales-channel publications.
Publish productWritePublish a product to a sales channel so it appears on your storefront.
Publish all productsWritePublish every product to a sales channel in one step.

Payments

ToolTypeWhat it does
Get payment settingsReadRead the store's currency and supported wallet configuration.
Create checkoutWriteMint a cart and return a hosted checkout URL to start a purchase.

Webhooks

ToolTypeWhat it does
List webhooksReadList the webhook subscriptions registered for the store.
Create webhookWriteSubscribe an endpoint to a webhook topic.
Delete webhookWriteRemove a webhook subscription.

Markets

ToolTypeWhat it does
List marketsReadList the store's international selling regions and base currency.
Create marketWriteAdd an international market (region and currency).

Storefront and functions

ToolTypeWhat it does
Set storefront variablesWriteWrite the Storefront API environment variables into your app.
Scaffold storefrontWriteAdd the Storefront client plus starter product and cart routes.
Scaffold Shopify FunctionWriteGenerate a Shopify Function extension for discounts, validation, or checkout logic.

Raw API access

ToolTypeWhat it does
Admin GraphQL queryReadRun any read query against the Admin GraphQL API.
Admin REST readReadSend a GET request to the Admin REST API.
Storefront GraphQLReadRun a query against the public Storefront API.
Admin GraphQL mutationWriteRun any write operation against the Admin GraphQL API.
Admin REST writeWriteSend POST, PUT, PATCH, or DELETE to the Admin REST API.

Example prompts

  • "Create three candle products with prices, descriptions, and images, then publish them to the Online Store."
  • "Add Small, Medium, and Large variants to the t-shirt, each at $24.99."
  • "Make a Summer Sale collection with the floral dresses."
  • "Create a discount code SUMMER15 for 15% off, valid through August."
  • "Set up an automatic 10% discount for orders over $100."
  • "Set inventory for the blue mug to 40 at my main location."
  • "Scaffold the storefront in my app with product listing and cart routes, then wire it to the connected store."
  • "Display the products from my store on the home page in a grid."
  • "Build a wishlist feature backed by the Storefront API."
  • "Create a test checkout so I can verify the purchase flow."

The storefront Lyna generates targets your project's stack (Vite, React, React Router). Cart and checkout use the Storefront cart mutations and redirect shoppers to Shopify's hosted checkout, so there is never a custom payment form holding card data.