MeridianPricingPage renders your whole plan grid from the plans you built in the plan builder: prices, trials, features, events, discounts, and the subscribe flow.
MeridianProvider ancestor, and it renders Polaris web components, so it must run inside an embedded Shopify app with App Bridge loaded, which every Shopify app template provides. Outside the embedded admin the elements are unregistered and render as unstyled text, with a console warning.
The returnUrl
returnUrl is where Shopify sends the merchant after they approve or decline the charge. It must be an https URL on the shop’s own admin:
Props
What a merchant sees
Active plans appear as offers. A draft appears only when it is the shop’s current plan, with a No longer offered badge. Other drafts stay hidden. Prices are converted to the shop’s currency before they reach the browser. Each card carries the plan name, its price for the selected cycle, its trial badge, and one line per feature and per metered event included in it. The card for the shop’s current plan is outlined, and its button is disabled. For a shop on a plan, the trial badge shows the trial the merchant would actually get by picking that card: none on a change that waits for the end of the paid period, what is left of a running trial (see Changing plan during a trial), and none once the store has used its trial. A shop with no current plan sees the plan’s configured trial only if it has not used its one trial. The current plan’s card shows no trial badge, including during a running trial. When you save a new version of an active plan, the previous version switches to draft and its subscribers stay on it. Those stores can see two cards with the same plan name: their previous version as Current plan with No longer offered, and the active new version as an offer. New stores see the active offer alone. The SDK identifies the current version byentitlements.planId.
A metered event’s line says what usage costs, so a merchant knows it before reaching Shopify’s approval screen:
Amounts are in the shop’s currency, and the rate is the one Meridian states in the usage terms Shopify asks the merchant to approve for the same plan (see What the merchant approves). It is converted exactly and never rounded to the cent: 0.10 USD in a euro store at an FX rate of 0.92 reads 0,092 €, not 0,09 €. A rate under one cent is stated per ten times the units until it reaches a cent, so 0.005 per translation reads “$0.05 per 10 translations" and 0.0004 reads "$0.04 per 100 translations”. The cap is in cents, the spending limit sent to Shopify.
The words come from the event’s Unit in the catalog, pluralized for any count other than one (“per translation” for a rate on a single unit). An abbreviation such as
GB and a unit that already ends in “s” are left as you typed them. An event with no unit uses its name instead, as written.
A priced usage view states its allowance and its cap but not its rate, because a view’s rate can be a share of money (0.02 is 2% of GMV) rather than a price per unit: “Gross merchandise value: 1,000 included, then billed on usage, up to $200.00 per month”.
The button label reads the shop’s current plan rather than saying “Subscribe” to everyone:
Meridian works out the direction and sends it with each plan, so the page never applies a pricing rule of its own. The comparison uses the monthly list price (the yearly one when either plan has no monthly price), so the label holds when the merchant toggles to yearly. It still uses the current plan when that plan is no longer offered. Its Current plan button stays disabled and never starts a subscription or calls
onPlanSelected, and so does the Scheduled one. On an older API, which sends no direction, the page compares the monthly prices itself.
Starts on
A card whose change would wait for the end of the paid period shows Starts on under its button, with the day the current period ends. Downgrades, moves from annual to monthly billing and moves to a free plan wait. Upgrades start at once. See Plan changes for the full rules. The timing depends on the billing interval, so the same plan can start at once on its yearly card and on a later date on its monthly one. From an annual plan, a monthly plan reads Upgrade when its monthly price is higher and still shows Starts on, with the end of the paid year. Its yearly card starts at once when the yearly price is higher as well. After the merchant picks a plan, the page follows the timing and the date Meridian answered, not the card it showed: a trial can end between loading the page and the click.A scheduled change
While a downgrade or a cancellation waits for the end of the paid period, a banner at the top of the page says what will happen:
Dates are written in English, like the rest of the page, in the merchant’s browser time zone, so near midnight the day can differ by one from the UTC
effective_date an automation prints.
Once the date has passed and Meridian has applied the change, usually within a few minutes, the page updates by itself: the banner goes and the cards show the store’s new plan, with no reload.
Under it, Keep Pro undoes the change, for as long as it can still be undone (see Keeping the current plan). When keeping the plan needs a new approval, the banner adds “You will approve Pro again on Shopify.” and the button sends the merchant there, back to your returnUrl afterwards. The page then confirms the charge like any other return from Shopify, and the banner disappears once Meridian reports nothing scheduled.
The banner ends with “Choosing another plan replaces this change.” The other plan buttons stay enabled: the merchant’s latest choice replaces the scheduled one. Only the card of the plan already scheduled reads Scheduled and is disabled. See Choosing again while a change is scheduled.
While a subscribe or a Keep is going through, every other plan button and Keep are disabled, so two billing actions never overlap. After Keep, the page waits for Meridian to report nothing scheduled, with the same one-minute limit and Refresh account details button as the account page, and the same messages when the change has already taken effect or a cancellation is past its last 24 hours.
The banner, the Keep button and Starts on need SDK 3.2.0 or later. An older SDK shows none of them: after a downgrade, the merchant still sees their current plan until the date, with no sign of the change.
Monthly and yearly
The Monthly / Yearly toggle appears only when at least one of your plans has a yearly price. A plan without one renders and bills monthly even while the toggle is on yearly; a plan with one shows a badge for the amount saved against twelve monthly payments. A plan priced at zero renders as Free, with no billing period and no trial badge.Discounts
The page handles both kinds of discount without any wiring from you. Automatic discounts are previewed per plan for the selected cycle, so the price shown is the price charged. Codes are entered behind an Add promo code control: the page validates a code against every plan at once and shows the discounted price on the cards it applies to. A typed code takes precedence over an automatic one, and the backend re-validates at subscribe time. Saving a new plan version automatically extends codes restricted to the previous version to cover the new version too. An invalid code reports on the field alone, never revealing whether another code exists. Shopify bakes a discount into a subscription when it is created, so one cannot be added to a subscription the shop is already on. On the current plan’s card, a preview is labelled either applied to your subscription or for new subscriptions, so a merchant is never shown an offer they cannot take.Subscribing
Picking a plan callssubscribe, which returns the Shopify confirmation URL the merchant has to approve. The page opens it in the top frame. A downgrade is approved the same way, and Shopify starts billing it at the end of the paid period.
A free plan has no approval step: it activates immediately, returns no confirmation URL, and the page refreshes so the new plan shows at once. onSubscribed fires then. From a paid plan outside a trial, a free plan is a cancellation: it is scheduled for the end of the paid period with no approval, the page refreshes to show the scheduled change, and onSubscribed fires with timing: "end_of_period".
If another plan change for the store is still going through, the subscribe is refused with “Another plan change for this store is still going through. Try again in a moment.” The buttons come back, and the merchant can pick the plan again.
Coming back from Shopify
After the merchant approves the charge, Shopify sends them back to yourreturnUrl with a charge_id in the URL. The page reads it and asks Meridian to confirm the charge with Shopify directly, rather than waiting for Shopify’s subscription webhook, which can land a minute or more later. The merchant sees no new message at any point:
- The plan cards stay on screen. The button of the plan the merchant approved shows its loading state, and every other plan button is disabled, so a second subscribe cannot start. When the page cannot tell which plan was approved yet, all plan buttons are disabled and none shows the loading state.
- As soon as the charge is active, the page refreshes in place and the card reads Current plan. This usually takes a second or two. For a downgrade, the card reads Scheduled instead, and the scheduled change banner appears.
- If the merchant declined the charge, or it expired, the buttons come back as they were.
- If nothing is settled after 60 seconds, the buttons are enabled again. The page keeps checking in the background every 15 seconds, still without a message, until 5 minutes after the return, and turns to Current plan by itself if the charge settles meanwhile.
charge_id from the URL, so a reload does not start the check again. Confirming records the subscription exactly as Shopify’s webhook would, so your automations fire once, whichever arrives first.
This only works when your returnUrl points at the route that renders MeridianPricingPage, as in the examples above. Before sending the merchant to Shopify, the page also remembers the chosen plan in the browser’s session storage: that is how it knows which button to show as loading, and it lets the page run one silent check even if the return URL carries no charge_id.
Meridian records the subscription and holds the Shopify billing handshake, so your app never implements the recurring-charge or usage-charge APIs. Once the subscription is active, feature gates and usage allowances resolve against the new plan.
Building your own instead
PassonPlanSelected to intercept the click, or skip the component: read plans from useMeridian and call subscribe yourself. The plan objects carry everything the built-in page renders, including each plan’s features and its events’ included quantity, overage rate and cap.
Each plan’s changePreview gives the label’s direction, the timing and the trial days of a move to it, per billing interval, and entitlements.subscription carries the date and the scheduled change. Render from those rather than comparing prices yourself, and after a subscribe follow the timing and effectiveAt it answers. See Data types.
The fallback trialDays also depends on the shop: it is zero once the shop has used its trial, even without a current plan, and zero on the current plan’s card. Otherwise it keeps the plan’s configured trial length. A request without a shop keeps the configured value.
Both /public/plans and the plans returned by /public/me include offered: true for active plans, false for the shop’s current plan when it is a draft. Match the current plan by entitlements.planId. If you build your own grid, show a plan with offered === false only as the current plan, and never offer a subscribe action on it. Treat an absent offered field from an older API as true.