What this prompt does
This prompt makes the AI implement a complete subscription-billing system with Laravel Cashier on [payment_provider], for a [app_description] with [plan_count] plans serving [customer_count] customers on Laravel [laravel_version]. It adds the Billable trait to [billable_model], configures credentials, sets up the webhook at [webhook_route], and builds the subscription flow with [checkout_method] and a [trial_duration]-day trial. Billing is unforgiving, so the prompt front-loads the pieces that quietly lose revenue.
The structure works because it covers the full billing surface. Plan management uses swap() with [proration_behavior], grace periods, and add-ons for [addon_features]; metered billing reports [metered_features] at [usage_reporting_frequency] with caps; webhook handling for [webhook_events] is idempotent and signature-validated, including the [dunning_sequence] on failed payments; a customer billing dashboard manages payment methods and invoices; and admin tooling surfaces MRR, churn, and the failed-payment queue. The [trial_without_payment] setting decides whether you collect a card up front or at trial end, and the [cap_behavior] controls what happens when metered usage exceeds the plan allowance. Because billing is unforgiving, the prompt insists on reconciling local subscription state against [payment_provider] rather than trusting the database alone, and styles the customer-facing pages with [ui_framework] so the billing dashboard matches the rest of your product.
When to use it
- You are building SaaS subscription billing and cannot afford to get it wrong
- You need trials, upgrades, downgrades with proration, and add-on subscriptions
- You have usage-based metered billing on top of a flat plan fee
- You need idempotent, signature-validated webhook handling
- You want a dunning sequence that retries and escalates failed payments
- You need admin billing views for MRR, churn, and failed payments
Example output
The AI returns Cashier setup on [billable_model], products and prices matching [plan_details], a SubscriptionController driving [checkout_method] and a [trial_duration]-day trial, upgrade/downgrade logic with [proration_behavior], metered billing reporting [metered_features] at [usage_reporting_frequency], a WebhookController handling [webhook_events] with idempotency and signature validation plus the [dunning_sequence], a customer billing dashboard styled with [ui_framework], and admin tooling for MRR, churn analytics, and the failed-payment queue.
Pro tips
- Make webhook handling idempotent — skip already-processed events so a duplicate delivery never double-charges or double-cancels
- Always validate the webhook signature before trusting the payload; unsigned events are an attack surface
- Implement the full
[dunning_sequence](retry, warn, final notice, cancel); silent payment failures are pure lost revenue - Reconcile local subscription state against
[payment_provider]rather than trusting your database alone - Set
[proration_behavior]intentionally per direction — always_invoice on upgrades, prorations on downgrades, behave differently - Use the real
[billable_model](often Team, not User) so billing maps to the organization that actually pays - Decide
[trial_without_payment]deliberately; collecting a card at trial end lifts signups but raises involuntary churn at conversion - Build the admin failed-payment queue early so you can intervene on recoverable accounts before the
[dunning_sequence]cancels them