Skip to main content

POST /webhooks/clerk-billing

Receives subscription lifecycle events from kenbun's billing provider. This endpoint is called automatically by the billing system -- you do not need to call it yourself. It is documented here so that administrators understand what events drive subscription status changes in kenbun.

What This Endpoint Does

When your organization's subscription changes — a trial starts, a payment succeeds, a payment fails, or a subscription is canceled — the billing provider sends a webhook event to this endpoint. kenbun processes the event and updates your organization's subscription status accordingly.

This is what causes the status badge on Settings > Billing to update from Trial to Active, or from Active to Past Due.

Subscription Events Processed

EventWhat Triggers ItResult in kenbun
subscription.createdNew subscription started (including trial)Status set to Active or Trial
subscription.updatedPayment succeeded, plan changed, or status changedStatus updated to reflect new state
subscriptionItem.freeTrialEndingTrial is about to expireReminder notification sent
payment_attemptA payment was attempted (success or failure)Payment failures are reflected in the next subscription.updated event

Subscription Statuses

The following subscription statuses can be set by these events. See Billing and Subscription for a full explanation of what each status means for your access:

StatusMeaning
activeSubscription is in good standing
trialingOrganization is in the free trial period
past_dueA payment attempt failed
canceledSubscription was canceled
endedSubscription period has ended

Security

All webhook requests from the billing provider are authenticated using a signed payload. kenbun verifies the signature on every incoming request and rejects any request that fails verification or that arrives more than 5 minutes after it was sent (to prevent replay attacks). You do not need to configure anything for this to work.