Skip to content

// e-commerce and billing

Via API

Lemon Squeezy email verification with pingutil

Lemon Squeezy sends license keys, download links and receipts to the email entered at checkout, so a typo means a customer who paid and got nothing, and a throwaway inbox often means a repeat trial. Handling the order_created webhook, verifying user_email with pingutil and flagging the result in your own app catches both without slowing the checkout.

Where it connects: Lemon Squeezy webhooks (order_created, subscription_created) signed with X-Signature

What goes wrong without it

  • Customers type their email wrong at checkout and then message us on social media asking for their license key.
  • Free-trial subscriptions keep getting started from temp-mail addresses.
  • We give a launch discount to "new customers" and the same person keeps coming back with a fresh inbox.

What you can do with Lemon Squeezy and pingutil

  • Flag orders with unreachable addresses

    On order_created, verify data.attributes.user_email and mark the order in your database so support can reach out another way.

  • Gate subscription trials

    On subscription_created, check the address. If it is disposable, your app can delay provisioning or require the user to confirm a real address.

  • Check before you create the checkout

    If your app creates checkouts through the API with a prefilled email, verify it first and show did_you_mean before sending the buyer to pay.

Set it up

  1. 1

    Create an API key in the pingutil dashboard and store it as PINGUTIL_KEY.

  2. 2

    In Lemon Squeezy, add a webhook for order_created (and subscription_created if you sell subscriptions) with a signing secret.

  3. 3

    Verify the X-Signature header, an HMAC-SHA256 hex digest of the raw body, and read the event from X-Event-Name.

  4. 4

    Respond 200, then call pingutil with data.attributes.user_email.

  5. 5

    Store the result next to the order or user in your own database and act on it in your app.

Webhook handler for order_created
import express from 'express';
import crypto from 'node:crypto';

const app = express();

app.post('/webhooks/lemonsqueezy', express.raw({ type: 'application/json' }), (req, res) => {
  const digest = crypto.createHmac('sha256', process.env.LS_SIGNING_SECRET).update(req.body).digest('hex');
  const signature = req.get('x-signature') || '';
  if (signature.length !== digest.length || !crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(digest))) {
    return res.sendStatus(401);
  }
  res.sendStatus(200);

  const payload = JSON.parse(req.body.toString('utf8'));
  if (req.get('x-event-name') === 'order_created') {
    checkOrder(payload.data.id, payload.data.attributes.user_email).catch(console.error);
  }
});

async function checkOrder(orderId, email) {
  let result;
  try {
    const res = await fetch('https://pingutil.com/v1/verify', {
      method: 'POST',
      headers: { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' },
      body: JSON.stringify({ email }),
      signal: AbortSignal.timeout(30000),
    });
    if (!res.ok) return; // fail open
    result = await res.json();
  } catch {
    return;
  }

  // Replace with your own persistence.
  await db.orders.update(orderId, {
    emailStatus: result.status,
    emailReason: result.reason,
    emailSuggestion: result.did_you_mean,
    disposable: result.checks.disposable,
  });
}

app.listen(3000);

What to do with each result

pingutil resultAction in Lemon Squeezy
status: "invalid"Flag the order and reach the buyer through another channel you have, such as the in-app account.
did_you_mean is setShow the suggestion to a signed-in user, or to support for a manual fix.
checks.disposable: trueHold trial provisioning or new-customer discounts for that user.
status: "risky" or "unknown"Record only.

Limits to plan for

  • Lemon Squeezy retries a webhook up to three more times when it does not get a 200, so respond before verifying and make the handler idempotent.
  • pingutil writes nothing back into Lemon Squeezy here. The result lives in your own app, which is where trial and license decisions usually happen anyway.
  • pingutil verifies up to 300 addresses a day (3,000 a month) per account, which covers most stores but not a launch-day spike. Queue the overflow. Those are Free plan limits; Enterprise has custom limits.

Lemon Squeezy documentation

Lemon Squeezy is a trademark of its owner. This integration uses Lemon Squeezy's documented extension points; it is not an official Lemon Squeezy app.

Common questions

Can I pass the pingutil result back to Lemon Squeezy?
Not through this flow. If you create checkouts through the API, you can verify first and attach your own custom data to the checkout, which then appears in meta.custom_data on the webhook.
Will this catch privacy relay addresses like Apple Hide My Email?
Relay addresses are real forwarding inboxes, but their random-looking local parts can be flagged as randomized. Treat that reason as a soft signal, not a block.

Stop bad addresses in Lemon Squeezy today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your Lemon Squeezy setup will receive.