Skip to content

Lock a feature to a plan

Say "lock export to the paid plan" and only customers on that plan can export; the rest meet an upgrade prompt, or a 402 that names the plan.

An Entitlement on an Offer says which Verb its customers may call. Every screen, API call and agent call checks it, so the lock holds everywhere at once.

Needs Charge monthly · Open a bank account

What you get

  • 1Entitlement on the Pro Offer for exportEntitlement
  • 1upgrade prompt where a customer without it tries to exportPage
  • 1refusal for an API or agent call without it, naming the plan that covers itOffer
  • 1row on the pricing page comparisonOffer

Your agent does

Offer.grant
You, to your agent

Lock export to Pro.

Only Pro customers can export.

Make CSV export a paid feature.

# Offer.grant
curl -X POST https://api.sb/leaseline.app/offers/offer_pro_monthly/grant \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"verb":"Collection.export"}'
import { $ } from 'startup-builder'

await $.Offer.grant({ offer: 'offer_pro_monthly', verb: 'Collection.export' })
npx startup-builder do Offer.grant --json '{"offer":"offer_pro_monthly","verb":"Collection.export"}'
{
  "name": "do",
  "arguments": {
    "code": "return await $.Offer.grant({ offer: 'offer_pro_monthly', verb: 'Collection.export' })"
  }
}

Change it

  • Give Starter export too, ten a day.
  • Let trial customers export once.
  • Show the upgrade button where export is locked.

Under the hood

Systems
Billing, Matchmaking
Nouns
Entitlement, Offer, Customer
Events
Offer.granted, Entitlement.checked