Payments (b77.payments)
Accept one-time payments and subscriptions with your own Stripe or Whop account.
Let your app take one-time payments and subscriptions, paid straight into your own Stripe or Whop account. builder77 takes no platform fee. Available on Starter and above.
1. Connect Stripe or Whop
In the builder, open Settings → Payments (in Advanced settings) and connect one provider or both. Keys are stored encrypted.
- Stripe: paste your secret key (Developers → API keys). Use a
sk_test_…key while testing. - Whop: in the Whop dashboard, open Developer and create a company API key with payment, plan, product and checkout permissions. Enter it together with your company ID, which starts with
biz_and is shown in the dashboard's address bar. Turn on Sandbox to test payments without real money.
With both connected, choose which one your checkouts use. Your app's code stays the same either way.
2. Start a checkout
// b77.config.json: { "rules": { "classes": "readonly" } }
// a 'classes' record: { name: 'Yoga drop-in class', price: 15, currency: 'usd' }
await b77.payments.checkout({
items: [{ collection: 'classes', id: classId, qty: 1 }], // the price is read on the server
metadata: { note: 'Bring a mat' },
});
// or a price made at your provider:
// items: [{ price: 'price_123', qty: 1 }] (Stripe) / items: [{ price: 'plan_123' }] (Whop)Prices are always read on the server, from a record in a collection with the readonly rule (with name and price). Instead of a record you can pass a Stripe Price ID (price_…, Stripe only) or a Whop plan ID (plan_…, Whop only, one per checkout).
The visitor is redirected to your provider's secure checkout page and comes back to the same screen afterwards. Or just ask builder77: "add a Buy button that charges $15 per class".
3. Check the result
const r = await b77.payments.result; // null | { canceled: true } | { paid, payment }
if (r?.paid) b77.toast('Payment received — see you in class!');Subscriptions
// b77.config.json: { "rules": { "plans": "readonly", "lessons": "members" } }
// a 'plans' record: { name: 'Pro', price: 9, currency: 'usd', interval: 'month' }
await b77.payments.subscribe({ items: [{ collection: 'plans', id: planId, qty: 1 }] });
const { active } = await b77.payments.subscription(); // show or hide paywall UI
await b77.payments.manage(); // Stripe billing portal or the buyer's Whop membership pageSubscriptions work with both providers; the buyer must be signed in. b77.payments.manage() opens the Stripe billing portal or the buyer's Whop membership page. To keep paid content locked on the server, put it in a collection with the members or members-private rule.
Payment records
Every checkout is saved in your app's payments collection with status (pending, paid, expired), amount, currency, items and metadata, and you can see it in the Data tab. Each checkout uses 1 integration credit.