commercepackages/commerce/contracts
contracts package
Cross-package event, identity, billing, and notification type contracts. The shared TypeScript boundary that lets commerce talk to iam, queue, webhooks.
- Stability
- Stable
- Scope
- Tenant-scoped
- Boundary
- packages/commerce/contracts
contractspackages/commerce/contracts
System of recordTyped event contracts
| Event type | Payload schema | Status |
|---|---|---|
| invoice.paid | InvoicePaidV2 | Stable |
| subscription.created | SubscriptionV3 | Stable |
| subscription.canceled | SubscriptionV3 | Stable |
| checkout.expired | CheckoutV1 | Beta |
Total volume
$1.24M
Active records
8,472
MoM growth
+8.4%
Success rate
99.6%
packages/commerce/contracts·commercial record
Usagecontracts.ts
typescriptcontracts.ts
1import type { BillingEvent, IdentityEvent } from "@nebutra/contracts";
2
3// Cross-package contracts — TypeScript-validated event shapes.
4function onBilling(event: BillingEvent) {
5 if (event.type === "subscription.canceled") {
6 revokeAccess(event.payload.tenantId);
7 }
8}