License and Webhook Operations
Internal operations guide for webhook sync, subscription state, license repair, and entitlement verification.
π₯ What this guide is for
This guide is intended for internal operators and admins who need to understand how license state flows from our billing provider (Lemon Squeezy) into our backend, and how that ultimately affects paid feature access within the extension.
π Main Integration Flow
The entire lifecycle of a license follows this sequence:
- A user successfully activates or binds a license key in the UI.
- The backend stores normalized license fields locally.
- Lemon Squeezy sends real-time
subscriptionandlicense keywebhook events. - The backend updates local subscription and license states dynamically.
- Config endpoints convert those states into rigid feature gating constraints sent to the extension.
sequenceDiagram
participant User
participant Backend
participant LemonSqueezy
User->>Backend: Activate License
Backend->>LemonSqueezy: Validate
LemonSqueezy-->>Backend: Webhook Event (Update)
Backend-->>User: Refresh Entitlements
πͺ Important Webhook Route
The core production webhook endpoint should point exactly to:
/api/v1/webhooks/lemonsqueezy
[!WARNING] Method Delivery If the URL points at the wrong host or root path, Lemon Squeezy may show successful delivery failures such as
405 Method Not Allowed.
π How Feature Locking Works
Paid features are strictly controlled by the intersection of both:
- License Validity: Is the key structurally authentic and not revoked?
- Subscription Status: Is the billing cycle currently
activeorpast_due?
That means an active, mathematically valid key alone is not enough if the subscription payment state has become blocked or cancelled in the backend.
π Recovery and Repair
If a userβs local license snapshot becomes inconsistent with their actual payment, operators should:
- Confirm webhook delivery logs in Lemon Squeezy.
- Confirm the latest
subscriptionsandlicensesrows in the database. - Use repair tooling or explicitly replay the webhook event only when needed.
This internal operational layer drastically reduces support pressure. When operators deeply understand this state model, they can immediately distinguish between a setup problem, a webhook sync problem, or a genuine paid entitlement issue.