> ## Documentation Index
> Fetch the complete documentation index at: https://help.the-meridian.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publishing to Shopify

Building a plan is local to Meridian. **Activating** one publishes it to the Shopify Billing API, which is what lets a merchant actually subscribe, and that step has prerequisites, because Meridian has to bill on your app's behalf.

## Why hosting matters

To create a subscription, Meridian needs an **offline access token** for the shop. Your app stores those tokens in its own Shopify session store, so Meridian reads them from the app's managed database, which is why publishing requires the app to be **hosted on Meridian**.

You can build, edit and delete plans regardless. It's only publishing that's gated.

## The four things that block activation

The Plan Builder tells you which one applies rather than failing at the Shopify call:

| Blocked because | What it means | What to do |
| - | - | - |
| **No managed database** | The app isn't hosted on Meridian, so there's no session store to read | Host the app on Meridian, or keep the plans as drafts |
| **No Session table** | Meridian reached the database but found no session table, so there's no token to bill with | Point Prisma at the injected `DATABASE_URL` and deploy again |
| **No offline session** | The table exists but is empty. Shopify only writes a session when a merchant installs the app | Install the app on a development store once |
| **The check couldn't complete** | Meridian couldn't reach the session store right now | If a deploy is in flight, wait for it to finish and retry |

The third one catches most people: a brand-new app has nothing to bill with until somebody installs it.

## What activating does

Activating publishes the plan's line items to Shopify Billing and moves it to **active**, so it appears on the [pricing page](/plans) and can be subscribed to. Switching back to draft hides it from new subscribers; existing subscribers keep what they have.

## Deleting a plan

A plan that stores still subscribe to can't be deleted. Deleting it would take their features and usage billing away while Shopify keeps charging them the recurring price, so the Plan Builder refuses while any subscription to the plan is:

* **Active**, including a store on a [free trial](/free-trial)
* **Frozen**, because Shopify resumes it once the store pays again
* **Pending**, because the merchant can still approve it on Shopify's screen. Shopify expires an unapproved subscription after two days, so an older one no longer counts.

The delete modal lists those subscriptions before you confirm. Switch the plan to draft instead: existing subscribers keep it, new stores can't pick it. Once only cancelled, declined or expired subscriptions remain, the plan can be deleted.

The modal also names any [discount](/discounts) limited to the plan. The delete still goes through, but the code stops applying to this plan, and a code limited to this plan alone can no longer be redeemed.

## What the merchant sees

Subscribing is a Shopify handshake, not a Meridian checkout:

1. Your app asks Meridian to subscribe the shop to a plan.
2. Meridian creates the subscription through Shopify's Billing API (with the plan's price, its [trial days](/free-trial), any [usage line item](/introduction-6), and any [discount](/discounts)) and gets back a **confirmation URL**.
3. Your app sends the merchant to that URL. Shopify shows its own approval screen, where the charge is authorised.
4. Shopify redirects the merchant back to your app and notifies Meridian, which records the subscription and fires the [subscription triggers](/subscription-activated).

Because Shopify owns the approval screen, the merchant is charged by Shopify and paid out to you through Shopify. Meridian never touches the money.

## Trying it without money moving

A subscription created on a **development store** is a Shopify test charge. Before it creates the charge, Meridian asks Shopify whether the store is a development store, so the whole flow runs (approval screen with Shopify's test charge notice, redirect, subscription recorded, [triggers](/subscription-activated) fired) with nothing billed, on your deployed app as well as in local development. Every other store gets a real charge. Meridian has no separate test mode to switch on: installing your app on a development store and subscribing is the end-to-end rehearsal.

If Shopify can't answer that question when you subscribe, Meridian creates a real charge rather than risk a free one, and a development store has no payment method to approve it with. Subscribe again.

<Note>
  A free plan (monthly price 0) needs no Shopify charge, so a merchant subscribes to it without an approval screen at all.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.