Selling the first plan
Tutorial 5 of 12 defines Leaseline's $29 pro Offer in one file, publishes it in test and takes a test payment.
An Offer file is the Offer.create input, key for key. Leaseline sells pro at $29 a month, and one file puts it on sale everywhere.
What you build
You give the template's offers/ its terms and a 14-day trial, publish it in test, and subscribe a sample Customer. Stripe takes the payment and leads every money record it holds.
Steps
To define the plan, edit the file the template wrote:
offers/pro.mdx --- price: { amount: 29, currency: USD } interval: month terms: Monthly,billed in advance. Cancel any time from the billing portal. trial: { days: 14, card: true } atBound: upgrade --- To get the Offer's id, read it by its file name:
npx startup-builder show /offers/pro --fields '$id, price' $id priceoffer_2hzYe1ERo0 $29.00 USDTo put it on sale in test, publish it:
npx startup-builder do Offer.publish --json '{"offer":"offer_2hzYe1ERo0"}' To take a test payment, subscribe a sample Customer:
npx startup-builder do Offer.subscribe --json '{"offer":"offer_2hzYe1ERo0"}' To watch what the payment set off, stream its Events to your machine:
npx startup-builder listen Offer.subscribed --forward-to http://localhost: 3000/ hooks
Result
pro is a published Offer with checkout at /checkout/ on every Site, a Stripe Product and Price, a payment link and an MCP buy tool. The test payment wrote a Subscription, an Invoice and two ledger entries. Checkpoint leaseline@ch05 (status planned) holds the edited offers/.
Next steps
- Tutorial 6 gives
proa page to sell from. - Offers: every key, from
seatstoprivateTo. - Plans and tiers: how many plans to sell.