Skip to content

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/pro.mdx 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

Terminal5 steps
  1. 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
    ---
  2. 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 USD
  3. To put it on sale in test, publish it:

    npx startup-builder do Offer.publish --json '{"offer":"offer_2hzYe1ERo0"}'
  4. To take a test payment, subscribe a sample Customer:

    npx startup-builder do Offer.subscribe --json '{"offer":"offer_2hzYe1ERo0"}'
  5. 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/pro 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/pro.mdx.

Next steps