Skip to content

basalt / subscriptions/src / WebhookEvent

Interface: WebhookEvent ​

Defined in: subscriptions/src/gateway.ts:118

Gateway-agnostic webhook event, already translated to domain terms.

Properties ​

billableId ​

> billableId: string

Defined in: subscriptions/src/gateway.ts:122


gatewayRef? ​

> optional gatewayRef?: string

Defined in: subscriptions/src/gateway.ts:124

Gateway subscription id, when the event carries one (e.g. after Checkout).


id ​

> id: string

Defined in: subscriptions/src/gateway.ts:120

Unique id at the gateway — used for idempotent processing.


period? ​

> optional period?: BillingPeriod

Defined in: subscriptions/src/gateway.ts:135

Billing period that was paid for — same provenance as plan.


plan? ​

> optional plan?: string

Defined in: subscriptions/src/gateway.ts:133

Plan that was actually PAID for, as attested by the gateway — read from the signed metadata the driver attached when it created the checkout / subscription (next to the price it charged). handleWebhook only changes the local plan on a checkout confirmation when this is present and matches the recorded intent, so interleaved checkouts cannot swap a cheap payment for an expensive plan. Custom drivers should set it.


type ​

> type: "subscription.canceled" | "payment.failed" | "payment.succeeded"

Defined in: subscriptions/src/gateway.ts:121

Released under the MIT License.