Block · Payments and billing
Stripe subscriptions
Adds plans (each linked to a Stripe price) and subscriptions. A Plans and billing page lets people pick a plan and pay on Stripe's secure checkout. Stripe then tells the app what happened through a signed webhook (checkout completed, invoice paid or failed, subscription changed or cancelled), and only the server marks a subscription active. Manage billing opens Stripe's customer portal to change card, switch plan or cancel. Rules stop anyone marking their own subscription paid. Staff manage plans and see every subscriber.
use_template { slug: "stripe-subscriptions" } adds
- Tables
- plan, subscription
- Components
- BillingPanel
- Pages
- /billing, /subscriptions-admin
- Workflows
- subscription-checkout, stripe-subscription-events, subscription-sync, subscription-apply-sync, billing-portal, subscription-active-notify
- Rules
- 2 on subscription
What it adds to your app
Tables plan and subscription (two starter plans). BillingPanel component on a Plans and billing page. A Stripe-signed webhook that applies checkout, invoice and subscription events. Server functions: checkout, billing settings and a manual check with Stripe. A staff page for plans and subscribers.
Tables
planname, description, price, currency, interval, stripe_price_id, features, active, …subscriptionsubscriber_id, plan_id, status, sync, stripe_session_id, stripe_subscription_id, stripe_customer_id, current_period_end
Pages
/billingPlans and billing (‹subscriber_role›)/subscriptions-adminSubscriptions (@staff)
Workflows
subscription-checkoutStart a Stripe Checkout for a plan. On server function (‹subscriber_role›)stripe-subscription-eventsApply Stripe's subscription events. On webhook stripe-subscription-eventssubscription-syncCheck a subscription with Stripe (fallback). On server function (‹subscriber_role›, @staff)subscription-apply-syncApply what Stripe said about a subscription. On subscription updatedbilling-portalOpen Stripe's billing settings for a subscriber. On server function (‹subscriber_role›)subscription-active-notifyTell the subscriber their plan is active. On subscription updated
Components
BillingPanelPlans to choose from, the current subscription and Stripe billing settings
Rules on every write
subscriptionA new subscription starts as pending until Stripe confirms it.subscriptionOnly Stripe can change a subscription.
Where it attaches
Params point the template at your own tables and roles. Leave out the ones with defaults; a wrong one is refused with the options your app has.
| Param | What it is | Example |
|---|---|---|
subscriber_role | The role whose people buy a plan (their own table is the subscriber). Optional. | member |
Use with your coding agent
- Connect the Appbricx MCP server to Claude Code, Cursor or any MCP client (quickstart).
- Paste the prompt. The agent reads the template, previews the merge with dry_run and shows you the diff.
- It applies to dev. Check it, then deploy when you are happy.
Needs the STRIPE_SECRET_KEY secret, the STRIPE_WEBHOOK_SECRET secret. A Stripe account with a recurring price for each plan (paste each price id into the plan).
Add the Stripe subscriptions template (slug "stripe-subscriptions") to my Appbricx project. Read it with get_template, run use_template with dry_run first and show me the diff, then apply it. Ask me where it attaches if you can't tell from my contract (subscriber_role: who subscribes).{
"tool": "use_template",
"arguments": {
"slug": "stripe-subscriptions",
"project_id": "<your project id>",
"params": {
"subscriber_role": "member"
},
"dry_run": true
}
}appbricx templates use stripe-subscriptions --param subscriber_role=member --dry-runGoes well with
One-off payments
Block. Take a card payment for any record (a booking, an order, an invoice) through Stripe Checkout, confirmed by the server.
paymentPayableListMyPaymentspayment-checkoutstripe-payment-eventsStripe payment received
Workflow. Records every paid Stripe Checkout session the moment Stripe reports it, once, and tells your team.
stripe_paymentStripePaymentsstripe-checkout-eventsstripe-sync-paymentsstripe-payment-receivedOrganisations and teams
Block. Let people create organisations, form teams, invite colleagues by email and give them owner, admin or member roles.
organisationteammembershipinvitation‹attach_to›.organisation_id