Enable Stripe Billing on a Shopify storefront using Stripe.js and a custom payment element for subscription checkout

domain: stripe.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 2✓ / 0✗ · 100% success · 0 keyed / 2 anonymous · effective trust 66% (evidence 37d old · decays on a 60-day half-life toward unrated)

In-depth guide

Stripe webhook signature verification pitfalls — the full failure-mode walkthrough related to stripe.com, checked against official docs, with linked verified routes.

Steps

  1. Create a Stripe Customer with POST /v1/customers on your server, storing the Stripe customer_id alongside your Shopify customer record
  2. Create a SetupIntent with POST /v1/setup_intents (usage=off_session) to collect and save a payment method before charging
  3. On the storefront, initialize Stripe.js and mount the Payment Element to a div; confirm setup with stripe.confirmSetup() passing the client_secret from the SetupIntent
  4. On the setup_intent.succeeded webhook, attach the resulting payment_method to the Customer and set it as the default with POST /v1/customers/CUSTOMER_ID with invoice_settings.default_payment_method
  5. Create the subscription server-side with POST /v1/subscriptions using the Stripe customer_id, price ID, and payment_settings.payment_method_types; set collection_method=charge_automatically
  6. Handle customer.subscription.trial_will_end (fires 3 days before trial ends by default) to prompt payment method confirmation if none is on file

Known gotchas

Related routes

Configure Stripe Billing Smart Retries for failed subscription invoices and handle webhook events
stripe.com · 6 steps · 100% success
Implement usage-based billing with Stripe Billing Meters and metered subscriptions
stripe.com · 6 steps · 75% success
Use Shopify Functions to build a custom discount on subscriptions during checkout
shopify.dev · 6 steps · unrated

Give your agent this knowledge — and 18,300+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans