Skip to content

Charge per use

Say "charge per use" and get a Meter that counts each use, a metered Offer on Stripe, and one invoice a month for what each customer used.

Charge for what each customer uses: a Meter counts every use, and Stripe bills the total once a month. Set the rate so your heaviest customer still makes you money.

Needs Startup

What you get

  • 1Meter that counts each lookup onceMeter
  • 1Offer at one cent per lookupOffer
  • 1product, metered price and meter on StripeStripe's Product, Price and Billing Meter
  • 1usage sent to Stripe each hourStripe's Meter Event
  • 1Invoice each month for that month’s useInvoice, on Stripe's Invoice
  • 1usage page in the customer PortalPortal
  • 2ledger entries per Invoice: receivable and revenueEntry

Your agent does

Meter.create → Offer.create → Offer.publish
You, to your agent

Charge per use.

Bill by usage.

Charge a cent per API call.

# 1. Meter.create
curl -X POST https://api.sb/leaseline.app/meters \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"unit":"lookups","of":"Lease.read","aggregation":"count","window":"month"}'

# 2. Offer.create
OFFER=$(curl -X POST https://api.sb/leaseline.app/offers \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"price":{"amount":0.01,"currency":"USD"},"terms":"One cent per renewal lookup, billed monthly for the month before.","interval":"month"}' | jq -r '.offer["$id"] | split("/") | last')

# 3. Offer.publish
curl -X POST https://api.sb/leaseline.app/offers/$OFFER/publish \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
import { $ } from 'startup-builder'

await $.Meter.create({ unit: 'lookups', of: 'Lease.read', aggregation: 'count', window: 'month' })
const offer = await $.Offer.create({ price: { amount: 0.01, currency: 'USD' }, terms: 'One cent per renewal lookup, billed monthly for the month before.', interval: 'month' })
await $.Offer.publish({ offer: offer.$id })
npx startup-builder do Meter.create --json '{"unit":"lookups","of":"Lease.read","aggregation":"count","window":"month"}'
OFFER=$(npx startup-builder do Offer.create --json '{"price":{"amount":0.01,"currency":"USD"},"terms":"One cent per renewal lookup, billed monthly for the month before.","interval":"month"}' | jq -r '.offer["$id"] | split("/") | last')
npx startup-builder do Offer.publish --json '{"offer":"'"$OFFER"'"}'
{
  "name": "do",
  "arguments": {
    "code": "await $.Meter.create({ unit: 'lookups', of: 'Lease.read', aggregation: 'count', window: 'month' })\nconst offer = await $.Offer.create({ price: { amount: 0.01, currency: 'USD' }, terms: 'One cent per renewal lookup, billed monthly for the month before.', interval: 'month' })\nreturn await $.Offer.publish({ offer: offer.$id })"
  }
}

The same sentence does more as the business grows:

StateCallsAsks first
IdeaOffer.create, Offer.publishSell a prepaid pack of 1,000 lookups first?
LiveMeter.create, Offer.create, Offer.publish
RepeatableMeter.create, Offer.create, Offer.publish, Subscription.switchMove current customers to it at their next renewal?

Change it

  • Give every customer 1,000 free lookups a month.
  • Add a $49 plan with 10,000 lookups included.
  • Email me when a customer passes $500 in a month.

Under the hood

Systems
Billing, Ledger, Tax
Nouns
Meter, Offer, Price, Invoice, Entry
Events
Offer.published, Invoice.billed
Stripe objects
Product, Price, Billing Meter, Meter Event, Invoice

The Meter counts each Lease.read Event once, even when a call retries. Each month closes into one Invoice per Customer, paid by the card on file.