RevClamp Enterprise B2B REVENUE ASSURANCE Start Free
INTEGRATION GUIDE | STRIPE & POSTHOG SETUP

Stripe App & PostHog Integration Reference

Connect your product usage stream from PostHog or your backend so RevGuard can automatically stop unpaid usage and prepare Stripe dispute evidence.

STRIPE DASHBOARD DRAWER & API INTEGRATION
// 1. Check Customer Protection Status (stripe.dashboard.customer.detail)
const cusRes = await fetch(
  "https://api.revclamp.com/v1/stripe/customer-drawer?customer_id=" + encodeURIComponent(customerId),
  { headers: { "X-RevGuard-Tenant-Key": "<YOUR_TENANT_KEY>" } }
);
const { ok: cusOk, drawer: customerDrawer } = await cusRes.json();

// 2. Stage Chargeback Evidence Draft (stripe.dashboard.dispute.detail)
const dispRes = await fetch("https://api.revclamp.com/v1/stripe/dispute-drawer", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-RevGuard-Tenant-Key": "<YOUR_TENANT_KEY>"
  },
  body: JSON.stringify({ existingDispute, expectedCustomerId: customerId, usageEvents })
});
const { ok: dispOk, drawer: disputeDrawer } = await dispRes.json();

PostHog Webhook Settings (Zero-Code)

SettingValue to Enter
Webhook Destination URLhttps://api.revclamp.com/v1/events/ingest
HTTP MethodPOST
Authentication HeaderX-RevGuard-Tenant-Key: <YOUR_TENANT_KEY>
Customer MatchingMatches stripe_customer_id first, or falls back to verified customer email
EU Cookieless Privacy ModeFully compatible with PostHog $ip: null (no cookies required)

Automatic Stripe Events Handled by RevGuard

Stripe Webhook EventHow RevGuard Protects You
customer.subscription.updatedSyncs plan upgrades, renewals, and status changes in real time
customer.subscription.deletedMonitors post-cancellation usage and locks unpaid accounts after your grace period
invoice.payment_failedStarts your custom payment-retry grace window before restricting access
charge.dispute.createdAutomatically compiles 90 days of customer usage proof into a Stripe Dispute draft