Skip to content

Subscription

Defined in: src/schema.ts:45

A subscription to a plan or add-on, from any provider (or "manual").

Property Type Description Defined in
cancelAtPeriodEnd? boolean - src/schema.ts:58
canceledAt? string - src/schema.ts:59
createdAt string - src/schema.ts:66
id string - src/schema.ts:46
kind "plan" | "addon" - src/schema.ts:51
metadata? JsonObject - src/schema.ts:68
periodEnd? string - src/schema.ts:56
periodStart? string ISO-8601. Current billing period. src/schema.ts:55
plan string Plan key, or add-on key when kind is "addon". src/schema.ts:48
provider string "manual", "stripe", "polar", … src/schema.ts:61
providerRef? string The provider’s subscription (or item) id. src/schema.ts:63
providerUpdatedAt? string Provider-side last-update time, for out-of-order webhook safety. src/schema.ts:65
quantity number - src/schema.ts:53
status SubscriptionStatus - src/schema.ts:52
trialEndsAt? string - src/schema.ts:57
updatedAt string - src/schema.ts:67
version number Pinned plan version (grandfathering — ADR 0012). Add-ons: always 1. src/schema.ts:50