Why this works well
No Stripe integration to build
Shoppex already orchestrates PSPs. You get card, PayPal, and crypto without wiring each one.
Real subscription lifecycle events
Trial started, trial ended, renewed, cancelled, upcoming renewal โ Shoppex emits them all as webhooks.
Flow
- The user signs up in your app.
- Your backend creates a payment for the subscription product.
- The user completes payment in hosted checkout.
- Shoppex emits subscription lifecycle webhooks.
- Your app updates entitlements from those events.
Shape
| Piece | Responsibility |
|---|---|
| Your SaaS app | Signup, user record, feature flags, cancellation UI |
| Webhook handler | Toggle feature flags based on subscription lifecycle events |
| Shoppex | Plan pricing, trial logic, renewal billing, dunning, crypto support |
Feature-flag pattern
Link your user record to the Shoppex customer on signup, then toggle entitlements on subscription events:Treat
planActiveUntil as the source of truth in your feature-flag middleware. subscription:cancelled means โwill not renewโ โ the user still has access until current_period_end.Subscription management
Expose plan changes inside your own UI by calling the Dev API from your backend:POST /dev/v1/subscriptions/{id}/change-planโ upgrade / downgradePOST /dev/v1/subscriptions/{id}/pause//resumePOST /dev/v1/subscriptions/{id}/cancelGET /dev/v1/subscriptions/{id}/billing-history
Pitfalls
- Idempotency on signups โ if your signup and checkout are two clicks apart, send the same
Idempotency-Keyon retry or you will create duplicate subscriptions. subscription:upcomingis your churn signal โ sent before the next renewal, good trigger for โupgrade your planโ emails or feature-usage reminders.- Dunning is automatic โ Shoppex retries failed payments on its own schedule. Do not build your own retry loop on top.
Related
Architecture Reference
Setup B (Next.js SSR) is the typical SaaS shape.
Dev API Subscriptions
Full subscription endpoint surface.