1. Documentation
  2. Premium roles
  3. Sources

Connecting Stripe

Sell a subscription without writing a line of code.


Bao can read Stripe events directly. No API key is needed: everything comes from the event's content.

Setting up

  1. In the Bao dashboard, enable the Stripe source and copy the webhook URL it offers.
  2. In Stripe, create a webhook endpoint pointing at that URL.
  3. Copy the Stripe signing secret (whsec_...) and paste it into Bao. It is stored encrypted, never shown again in the clear.
  4. Choose a default tier.

What Bao does with the events

Stripe eventEffect
checkout.session.completedOpens the entitlement
customer.subscription.deletedRemoves the entitlement, after the grace period
customer.subscription.updated (non-active status)Same

Who receives the role

Stripe does not know Discord IDs. Two cases:

  • You put the Discord ID in metadata.discord_id at checkout: the role is granted immediately.
  • You do not: Bao creates a pending entitlement, attached to the buyer's email. They collect it through claiming in Discord.

Choosing the tier

Set metadata.tier to the tier's key. Failing that, Bao applies the default tier you chose.

One-off payment

A checkout in payment mode (rather than subscription) grants lifetime access: the role is never removed automatically.