Home / Insights / Web and SaaS Development

Web and SaaS Development

Building a Shopify App with AI: Review, Billing, Embedded UI and the Lessons from Our AI Shopper Simulation

A Shopify app is a product inside someone else’s product. Review rules, billing, embedded UI and privacy webhooks are non-negotiable, and AI features add their own cost and trust questions. Here is how we approached all of it when we built the AI Shopper Simulation app, and what we would tell a founder planning something similar.

TopicsWeb and SaaS DevelopmentGenerative AI and LLMs

Key takeaways

  • Treat Shopify App Store requirements as part of the specification from day one: OAuth first, no essential pop-ups, minimal scopes, session-token authentication and the three mandatory compliance webhooks are all checked at review.
  • Public apps must bill through a Shopify-provided billing solution. Decide early between Shopify-hosted App Pricing and the Billing API, and design trials, upgrades and downgrades so merchants never need to contact you.
  • Embedded apps live in an iframe inside the Shopify admin. Use App Bridge for navigation and authentication, follow the design guidelines, and never rely on third-party cookies or local storage for sessions.
  • AI features need an evaluation plan, a cost model per merchant action and honest framing in the UI. Simulated shoppers are a decision aid, not a replacement for real customer evidence.
  • Plan the operational side (webhook reliability, data retention, uninstall clean-up, support documentation) before submission: these are the areas where review rejections and merchant churn usually come from.

Building for Shopify is attractive for a simple reason: distribution. A merchant can find, install and pay for your product without leaving the admin they already use every day. The trade is that Shopify sets the rules, and those rules cover far more than code quality. Installation flow, billing, user interface, data handling and support all have published requirements, and an app that misses any of them does not get listed.

We learned this properly when we designed and built the AI Shopper Simulation app for an international e-commerce client. The product lets a store owner test a proposed change to a price, photo, claim, description or offer against simulated shopper panels built from the store’s own customer data, and returns a verdict with the reasoning behind it, before anything goes live and without contacting real customers. It ships as a Shopify app with subscription plans and trial onboarding, which means it had to pass every one of the hurdles above while also carrying an AI workload with its own cost and trust problems.

This article is for founders, product leads and CTOs planning a Shopify app, especially one with an AI feature at its core. We cover the review requirements that shape architecture, the billing choices, the embedded user interface, the privacy webhooks, the AI-specific engineering, and the lessons we took from our own build. Where we give figures, they are illustrative assumptions rather than measured results from the project, because the public case page does not disclose metrics and we respect that.

What Shopify’s App Store review actually checks

The first mistake teams make is treating App Store review as a final gate rather than a design input. Shopify publishes a requirements checklist and a companion best-practices guide, and several items in it dictate how the application must be built, not merely how it is presented.

Installation and permissions

Shopify’s guidance is that the app should authorise through OAuth immediately, before any other step, including for merchants who reinstall. Essential actions such as OAuth or approving a charge must not happen in pop-up windows. Access scopes appear on the grant page, where the merchant can approve or decline them, so the app should request only what it needs. For a product like ours, that meant a deliberate conversation about which customer and product scopes the simulation genuinely required, and designing graceful behaviour if a merchant declined an optional scope.

Functionality, performance and listing

Apps must follow Shopify’s App Design Guidelines, and an app that drifts from the core functionality it was submitted with can be sent back for a full re-review. Performance is measured too: Shopify states that an app should not lower a store’s Lighthouse performance score by more than 10 points, weighted across home, product and collection pages. An app that only lives in the admin, as ours does, has little storefront footprint, but any theme app extension or script you inject will be measured.

The listing itself has firm limits: a 30-character name identical in your configuration file and the listing, a 1200 by 1200 pixel icon without text, three to six desktop screenshots including one of the real UI, and a 100-character introduction. Review readiness also requires clear instructions, screencasts in English or with English subtitles, and valid test credentials for any third-party platform the app depends on. For an AI app, that last point matters: the reviewer must be able to run a simulation end to end on a development store, so you need seeded data and a reviewer account that produces meaningful results quickly.

Security and data

The checklist requires a privacy policy in the listing, the use of supported APIs only (apps using an API deprecated within 90 days cannot be submitted), and server-side storage of client secrets and access tokens. The three mandatory compliance webhooks, covered in a later section, are checked explicitly, and apps that do not respond correctly are rejected.

Our advice: convert the checklist into acceptance criteria in your backlog before the first sprint. Every item that affects architecture (OAuth flow, scopes, session tokens, webhooks, billing) should be a ticket with a test, not a line in a pre-launch document.

Billing: Shopify App Pricing or the Billing API?

Shopify’s billing documentation is unambiguous: all apps published on the Shopify App Store are required to use a Shopify-provided billing solution. Merchants pay through their Shopify subscription, Shopify collects the charge, pays out the developer’s share and handles chargebacks. You cannot bolt on Stripe for a public app.

At the time of writing there are two routes.

OptionHow it worksBest forLimits to note
Shopify App Pricing (Shopify-hosted)You define plans in the app submission form; Shopify hosts the plan selection page and manages trials, proration, upgrades and downgrades. Usage events are sent through the App Events API.New public apps with standard free, monthly, annual or usage-based plans.No one-time purchases; less control over the pricing page experience.
Manual pricing with the Billing APIYou build your own pricing page and create recurring, usage or one-time charges through the API.Apps needing one-time purchases, unusual plan logic or an existing integration.You own proration, plan changes and the pricing UI, and the review requires upgrades and downgrades to work without contacting support.

Shopify also notes that prices are set in USD but can be billed in the merchant’s local billing currency, with Shopify converting each charge, and recommends keeping pricing simple with few plans and offering a free trial.

What we did and why

The AI Shopper Simulation app ships with subscription plans and trial onboarding. The trial is the important design decision, not the plan grid. A merchant who installs an AI app wants to see one credible result within minutes; if the first simulation needs an hour of setup, the trial expires unused. We therefore treated onboarding as a product in its own right: connect the store, let the app build its first shopper panel from existing customer data, and guide the merchant to run one test on a real product straight away.

Pricing an AI app without losing money

AI inference is a marginal cost that most SaaS billing models ignore. A simulation that queries a language model across a panel of synthetic shoppers can cost materially more per run than a conventional feature. Three patterns work:

  • Tiered allowances: each plan includes a number of simulations per month, with the allowance sized so the top of each tier still carries a margin at your measured inference cost.
  • Usage-based top-ups: Shopify App Pricing supports usage-based plan types, so additional runs can be metered rather than forcing an upgrade.
  • Cost caps in code: panel size, model choice and prompt length should be bounded per plan so that a single merchant cannot run an unbounded workload.

For example, a team might assume an illustrative inference cost of a few cents per simulated shopper and a panel of a few dozen shoppers per test. That makes each test cost well under a dollar, which is comfortable inside a monthly plan, but only if the allowance is enforced. Measure the real figure in your first weeks and revisit the tiers; do not guess it from a pricing page.

The embedded UI: App Bridge, Polaris and session tokens

Most Shopify apps are embedded, which means the app’s pages render inside an iframe in the Shopify admin, in a space Shopify calls App Home. According to the App Bridge documentation, App Bridge is the JavaScript SDK that lets your app talk to the admin: it exposes a global shopify object, handles authentication, and renders elements such as title bars and navigation menus outside your frame so they look native.

Authentication inside the iframe

The review best practices are explicit that embedded apps must authenticate with session tokens and must not rely on third-party cookies or local storage, which fail in some browsers, and that the app must work in Chrome incognito mode. In practice this means your front end calls shopify.idToken() and passes the result to your backend as a bearer credential, and your backend verifies it on every request. Direct Admin GraphQL requests from the front end can be authenticated automatically if you enable direct API access in the app configuration, but anything that touches your own database still goes through your server with a verified token.

Our approach for an app like this is to treat the session token as the only identity signal. There is no cookie session, no “remember me” and no state in the browser that review could reject. This also simplifies multi-store Plus organisations, where one user may switch between shops: the token carries the shop, so the backend never has to guess.

Design system

Polaris is Shopify’s design system. App Bridge now provides page templates for landing and settings pages and compositions for data tables, empty states and setup flows, with Polaris delivered as web components that work in any framework. Using them is the quickest way to pass the design review and, more importantly, to feel native to a merchant who spends hours a day in the admin. Our rule: custom UI only where the product genuinely needs it. For the simulation app that meant a custom results view, where a verdict and its reasoning are laid out for a non-technical store owner, while settings, plan selection and lists used standard patterns.

Max modals and navigation

Shopify allows a full-screen “max modal” only when launched from a merchant action, not from the navigation menu, and only for complex workflows. Running and reviewing a simulation is such a workflow, so a focused full-screen experience triggered from a “Run test” button is acceptable; putting the whole app in one is not.

Stack note

The public case page lists React Native, Astro and PostHog among the technologies used, alongside the Shopify app itself. In general terms, that reflects a split between the embedded app, a lightweight public-facing site, and product analytics to see where merchants stall in onboarding. Whatever your choice, keep the embedded front end thin and move anything expensive, including every model call, to the server.

Compliance webhooks, customer data and the uninstall path

Shopify’s privacy law compliance documentation requires every App Store app to subscribe to three webhook topics, even if the app does not collect personal data:

  • customers/data_request: a request to view the customer data your app stores.
  • customers/redact: a request to delete a customer’s data. Shopify sends the payload 10 days after the deletion request.
  • shop/redact: a request to delete the shop’s data, sent 48 hours after the store owner uninstalls the app.

The rules are concrete: respond with a 200-series status to acknowledge, complete the action within 30 days (unless you are legally required to retain the data), return 401 for an invalid HMAC header, and register an HTTPS endpoint with a valid certificate (Google Pub/Sub and AWS EventBridge are also supported). Subscriptions are configured in the shopify.app.toml file before publishing, and Shopify states that apps without webhook URLs, or that do not respond as required, are rejected in review.

Why this matters more for an AI app

An app that builds simulated shopper panels from a store’s customer data has, by definition, derived artefacts: embeddings, segment summaries, cached model outputs. A naive implementation deletes the customer row and leaves the derived data behind. We design data lineage so that every derived artefact carries the shop identifier and, where it is customer-specific, the customer identifier, and the redaction handlers walk that lineage. Our recommendation for any team:

  1. Map every table and object store that can contain shop or customer data, including caches, queues and logs.
  2. Write the shop/redact handler first and test it against a development store you uninstall on purpose.
  3. Make webhook handling idempotent and queue-backed, so a retry or a burst does not lose a request.
  4. Log the completion of each redaction with a timestamp, because the 30-day window is an obligation you may need to evidence.
  5. Decide retention for model inputs and outputs explicitly. Prompts that include customer attributes should be short-lived; aggregate results can live longer.

Beyond Shopify’s own rules, your merchants in the EU, UK and Australia will have obligations under their local privacy law, and your privacy policy must reflect what the app really does with the data, including whether a third-party model provider processes it. We are not giving legal advice here; involve counsel for your specific markets, but build the technical capability first because it is far harder to retrofit.

The AI part: simulated shoppers, evaluation and honest framing

The idea of using language models as stand-ins for people has research behind it. Horton’s 2023 paper Large Language Models as Simulated Economic Agents argues that LLMs can be treated as implicit computational models of humans, given endowments, information and preferences, and reports that experiments run this way produce results qualitatively similar to the original human studies, while noting that the results sometimes diverge. Park and colleagues’ Generative Agents work showed that agents with memory, reflection and planning produce believable individual and social behaviour, and that each of those components matters to believability.

That literature is both the opportunity and the warning. Simulated shoppers can give a merchant a fast, cheap read on how a change might land. They are not customers, and the UI must never pretend otherwise.

How a simulation pipeline is structured

  1. Panel construction. Customer data from the store is summarised into a set of shopper profiles that reflect the store’s real mix (for example, repeat buyers versus first-time visitors, price-sensitive versus brand-led). The panel is generated for each test rather than being a static list.
  2. Stimulus framing. The proposed change (a new price, image, claim, description or offer) is presented to each profile alongside the current version in a structured prompt.
  3. Response collection. Each simulated shopper returns a structured judgement and a reason. Structured output matters here; free text is hard to aggregate and easy to misread.
  4. Aggregation and verdict. The responses are combined into a verdict with the reasoning behind it, which is what the merchant sees.
  5. Apply and undo. A winning change can be applied to the store with one click and reversed just as easily, which keeps the merchant in control.

Evaluation before launch

You cannot ship this on vibes. Build a regression set of past changes where the real outcome is known (a price change whose conversion effect the merchant remembers, a photo swap that clearly helped) and check whether the simulation’s direction agrees. Track agreement rate over time and per category; a tool that is reliable for apparel copy and unreliable for electronics pricing should say so. Keep a fixed prompt-and-model version per release so that results are reproducible and a model upgrade is a deliberate, tested event. We cover this discipline in more depth in our article on building a catalogue content workflow with brand control and approval, which faces the same problem from the content side.

Honest framing in the product

  • Call the output a verdict with reasons, not a prediction with a percentage lift. Invented precision is the quickest way to lose a merchant’s trust.
  • Show the reasoning. A store owner who can read why the panel disliked a claim can act on it even when they disagree with the verdict.
  • Encourage confirmation. The best use of the tool is to filter ideas before a real test, not to replace measurement after launch.
  • Bound the cost. Fix panel size and model choice per plan, cache panel profiles between tests where the underlying data has not changed, and time out gracefully.

Architecture and operations for a Shopify app at scale

A public app is multi-tenant by nature: every install is a tenant, and tenants arrive and leave without warning. The architecture that has served us well, in general terms, is:

ConcernApproachWhy
Identity and tenancyShop domain as the tenant key; session token verified on every requestMatches Shopify’s model and the review requirement
Data accessServer-side Admin API calls with stored, encrypted tokens; minimal scopesTokens never reach the browser
Long-running workQueue plus workers for simulations and webhook processingModel calls are slow; webhooks must be acknowledged fast
Model accessA thin gateway with per-tenant quotas, retries and cost loggingEnforces plan limits and gives you a real cost per merchant
AnalyticsProduct analytics on onboarding and feature useShows where trials stall
ObservabilityStructured logs keyed by shop and request, alerting on webhook failuresReview and merchants both notice silent failures

Operational checklist before submission

  1. OAuth and reinstall flows tested on a fresh development store and on a store that previously uninstalled.
  2. All three compliance webhooks registered, responding and completing within the window.
  3. Plan selection, upgrade, downgrade and cancellation tested end to end without support involvement.
  4. App runs correctly in Chrome incognito with no third-party cookies.
  5. Lighthouse impact measured on a test storefront if any storefront code is injected.
  6. Reviewer instructions, screencast and seeded test store prepared so a reviewer can complete a simulation in minutes.
  7. Help documentation and emergency developer contact details in place.
  8. Deprecated API usage audited against Shopify’s versioning calendar.

Hosting is flexible; Shopify’s own guidance mentions services such as Google Cloud Run, Fly.io and Render, and the configuration is synchronised with shopify app deploy. Our broader approach to connecting store, order and helpdesk data for retailers is described on our e-commerce support automation page, and much of the same plumbing (Shopify integration, policy-aware AI, escalation to humans) carries across.

Lessons learned and when a Shopify app is the right vehicle

Looking back at the AI Shopper Simulation build, these are the lessons we would pass on.

Five lessons

  • Onboarding is the product. The first simulation must happen inside the trial with minimal setup. Everything in the first screen should move the merchant towards one real result.
  • Review requirements are architecture. Session tokens, scopes, webhooks and billing shape the backend. Teams that discover them at submission rebuild core pieces.
  • Cost per action is a product metric. Log the model cost of every simulation per shop from day one, because plan design depends on it.
  • Explain, do not just predict. The reasons are what make a verdict actionable, and an apply-and-undo control gives merchants the confidence to act on it.
  • Design deletion early. Derived AI artefacts are the data most often forgotten in redaction handlers.

When a Shopify app is the right choice

SituationShopify public appCustom app for one merchantStandalone SaaS with an integration
Target customersMany Shopify merchantsOne store or one Plus organisationMerchants across several platforms
BillingMust use Shopify billingAgreed directly with the merchantYour own billing
ReviewFull App Store reviewNo listing review; install link generated by youStill subject to API terms, not listing review
DistributionApp Store discoveryNone neededYour own marketing
AI cost controlPlan allowances and metering via ShopifyContractualYour own metering

Shopify’s distribution documentation notes that the method cannot be changed after you select it, so decide deliberately. If you are a single merchant wanting this capability for your own store, a custom distribution app avoids review entirely. If you are building a product, the public app is the route, and the review discipline above is the price of distribution. If you also serve WooCommerce or Magento merchants, consider a standalone product with a Shopify integration, as we discussed for marketplace integrations across Shopee, Lazada and Amazon. And whichever vehicle you choose, plan tenancy, billing and operations together rather than one at a time.

Next step for a team at the planning stage: write the review checklist into your backlog, estimate your inference cost per merchant action with a quick prototype, and design the trial so that a reviewer, and a merchant, sees a real result in the first session.

Frequently asked questions

How long does Shopify App Store review take?

Shopify does not publish a fixed timeline on the pages we reference, and it varies with the app’s complexity and how complete the submission is. The fastest path is a submission that already meets the requirements checklist, includes a screencast and reviewer instructions, and has the compliance webhooks and billing working on a development store.

Can we use our own payment provider for a public Shopify app?

No. Shopify’s billing documentation states that all apps published on the App Store must use a Shopify-provided billing solution. You choose between Shopify-hosted App Pricing and manual pricing through the Billing API. A custom app distributed to a single merchant can be billed by direct agreement.

Do we need the compliance webhooks if the app stores no customer data?

Yes. Shopify requires all three topics (customers/data_request, customers/redact and shop/redact) to be implemented even if the app does not collect personal data, and apps that do not respond correctly are rejected in review.

How do we keep AI costs under control in a Shopify app?

Log model cost per shop and per action from the first day, size plan allowances from the measured figure, bound panel size and model choice per plan, cache intermediate artefacts where data has not changed, and use usage-based plan types for top-ups rather than unbounded fair use.

Are simulated shoppers accurate enough to replace A/B tests?

They are a filter, not a replacement. Research on LLMs as simulated agents reports results that are often qualitatively similar to human studies but sometimes diverge. Use the simulation to prioritise which ideas deserve a real test, show the reasoning so merchants can judge it, and keep measuring real outcomes.

Should we build a Shopify app or a standalone SaaS with a Shopify integration?

If your customers are mostly Shopify merchants and you want App Store distribution, build the app and accept the review and billing rules. If you need to serve several platforms or need billing flexibility Shopify does not allow, build a standalone product with a Shopify integration. The distribution method cannot be changed later, so decide before you start.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. Shopify Developers: App requirements checklist and best practices — accessed 10 November 2026. Installation and OAuth rules, scope guidance, no essential pop-ups, Lighthouse 10-point limit, listing limits, session-token and incognito requirements, deprecated-API rule and review readiness items.
  2. Shopify Developers: Billing for apps — accessed 10 November 2026. Requirement that App Store apps use a Shopify-provided billing solution; Shopify App Pricing versus Billing API; usage-based plans; local-currency billing; trial and simplicity recommendations.
  3. Shopify Developers: App Bridge reference — accessed 10 November 2026. What App Bridge is, App Home and iframe rendering, shopify.idToken() session tokens, direct API access, Polaris web components, hosting and deployment guidance.
  4. Shopify Developers: Privacy law compliance (mandatory webhooks) — accessed 10 November 2026. The three mandatory compliance webhooks, the 10-day and 48-hour send timings, the 30-day completion window, HMAC handling and rejection of apps without working endpoints.
  5. Horton, Filippas and Manning: Large Language Models as Simulated Economic Agents (arXiv, 2023) — accessed 10 November 2026. The research basis and caveats for using LLMs as simulated people: results often qualitatively similar to human studies, with divergences.
  6. Park et al.: Generative Agents: Interactive Simulacra of Human Behavior (arXiv, 2023) — accessed 10 November 2026. Evidence that memory, reflection and planning components each contribute to believable simulated behaviour.

Planning a Shopify app with an AI feature at its core?

Tell us what the app should do for merchants and we will help you map the review, billing and data requirements, estimate the inference cost per action and scope a trial experience that converts.