Example: Basic Premium Flow

One common pattern for granting premium access after payment.

circle-exclamation

Flow

  1. User enters email in funnel → Registration Webhook fires → Create account if new

  2. User pays → Stripe/Paddle Webhook fires → Set premium = true


Registration Webhook Handler

app.post('/webhooks/zellify-registration', (req, res) => {
  const { email, answers } = req.body;
  
  let user = await db.users.findByEmail(email);
  if (!user) {
    user = await db.users.create({ email, premium: false });
  }
  
  res.status(200).send('OK');
});

Payment Webhook Handler

Stripe (checkout.session.completed):

Paddle (transaction.completed):


Last updated