44
55Draft -- generated from branch ` jdp/kiloclaw-billing ` on 2026-03-13.
66Updated 2026-03-19 -- pricing and trial duration changes.
7+ Updated 2026-03-20 -- promotional codes and introductory pricing.
78
89## Conventions
910
@@ -42,6 +43,22 @@ lapses, with email notifications at each stage.
42437 . The system MUST fail with an error at checkout time if a required
4344 plan price identifier is not configured.
4445
46+ ### Standard Plan Introductory Pricing
47+
48+ 1 . New standard plan subscribers who do not have a prior canceled paid
49+ subscription MUST receive an introductory price for their first
50+ billing period. A canceled trial does not count as a prior paid
51+ subscription. Returning subscribers with a previously canceled paid
52+ subscription MUST receive the regular standard price.
53+ 2 . The system MUST automatically transition introductory-price
54+ subscribers to the regular standard price at the end of the
55+ introductory billing period.
56+ 3 . The automatic price transition MUST be transparent to the user: it
57+ MUST NOT appear as a pending plan switch in billing status and MUST
58+ NOT prevent the user from initiating a plan switch or canceling.
59+ 4 . Failure to set up the automatic price transition during subscription
60+ creation MUST NOT block checkout completion.
61+
4562### Trial Eligibility and Creation
4663
47641 . A trial MUST only be created automatically when a user provisions an
@@ -81,21 +98,18 @@ lapses, with email notifications at each stage.
81982 . The system MUST allow checkout when the existing subscription status
8299 is trialing or canceled.
831003 . The system MUST verify with the payment provider that no subscription
84- in active or trialing (delayed-billing) status already exists for the
85- customer before creating a new checkout session, to guard against
86- concurrent checkouts. This check does not cover provider-side
87- subscriptions in past-due status.
88- 4 . The system MUST NOT allow promotional codes for either plan.
89- 5 . The system MUST apply a provider-configured first-month discount
90- coupon when creating a standard plan checkout session.
91- 6 . When a configurable billing start date is set and is in the future,
92- the system MUST create the subscription with a delayed billing period
93- that begins on that date.
94- 7 . When the billing start date is unset or is in the past, the system
95- MUST start billing immediately with no delayed period.
96- 8 . The system SHOULD include referral tracking data in checkout sessions
101+ in active or trialing status already exists for the customer before
102+ creating a new checkout session, to guard against concurrent
103+ checkouts. This check does not cover provider-side subscriptions in
104+ past-due status.
105+ 4 . The system MUST allow promotional codes on checkout for both plans.
106+ 5 . For standard plan checkout, the system MUST use the introductory
107+ price when the user has no prior canceled paid subscription, and the
108+ regular price when the user has a previously canceled paid
109+ subscription (see Standard Plan Introductory Pricing).
110+ 6 . The system SHOULD include referral tracking data in checkout sessions
97111 when a referral cookie is present.
98- 9 . The system SHOULD attempt to expire open checkout sessions tagged as
112+ 7 . The system SHOULD attempt to expire open checkout sessions tagged as
99113 KiloClaw before creating a new checkout session, so users who
100114 abandoned a previous checkout can start fresh. Expiration is
101115 best-effort: errors from the payment provider (e.g. the session was
@@ -111,9 +125,8 @@ lapses, with email notifications at each stage.
111125 the subscription to the standard plan.
1121262 . When a commit subscription is created, the system MUST record a
113127 commit-period end date six calendar months from the billing start.
114- When a delayed-billing period is configured, the six months MUST
115- start from the delayed-billing end date, not from subscription
116- creation.
128+ For pre-launch subscriptions that had a delayed-billing trial_end,
129+ the six months starts from that trial boundary.
1171303 . When a subscription update is received and the commit-period end
118131 date is in the past, the system MUST extend it by six calendar
119132 months from the previous boundary, keeping the subscription on the
@@ -145,21 +158,35 @@ lapses, with email notifications at each stage.
145158 the commit-period end date to six calendar months from the
146159 transition date.
1471608 . The system MUST allow cancellation of user-initiated plan switches.
161+ 9 . The system MUST reject a plan switch if a user-initiated plan switch
162+ is already pending.
163+ 10 . If an automatic price transition is pending when the user requests a
164+ plan switch, the system MUST replace the automatic transition with
165+ the user's requested switch.
166+ 11 . After canceling a user-initiated plan switch, if the subscription is
167+ still on the introductory price, the system MUST restore the
168+ automatic price transition. Failure to restore the transition MUST
169+ NOT prevent the switch cancellation from succeeding.
148170
149171### Cancellation and Reactivation
150172
1511731 . The system MUST reject a cancellation request if no active
152174 subscription with a payment provider ID exists.
1531752 . The system MUST reject a cancellation request if cancellation is
154176 already pending.
155- 3 . When canceling a subscription that has a pending schedule, the system
156- MUST release the schedule before setting the cancel-at-period-end
157- flag.
177+ 3 . When canceling a subscription that has a pending schedule — whether
178+ a user-initiated plan switch or an automatic price transition — the
179+ system MUST release the schedule before setting the
180+ cancel-at-period-end flag.
1581814 . Cancellation MUST NOT terminate access immediately; access MUST
159182 continue until the current billing period ends.
1601835 . The system MUST allow reactivation of a subscription that is pending
161184 cancellation.
1621856 . On reactivation, the system MUST clear the cancel-at-period-end flag.
186+ 7 . On reactivation, if the subscription is still on the introductory
187+ price, the system MUST restore the automatic price transition.
188+ Failure to restore the transition MUST NOT prevent the reactivation
189+ from succeeding.
163190
164191### Billing Lifecycle Background Job
165192
@@ -169,6 +196,9 @@ lapses, with email notifications at each stage.
1691962 . Each sweep in the background job MUST process users independently;
170197 a failure for one user MUST NOT prevent processing of other users.
1711983 . All errors during sweep processing MUST be captured for monitoring.
199+ 4 . The background job MUST detect active subscriptions on the
200+ introductory price that have no automatic price transition pending
201+ and MUST set up the missing transition.
172202
173203### Trial Expiry Warnings
174204
@@ -258,8 +288,9 @@ lapses, with email notifications at each stage.
258288### Payment Provider Status Mapping
259289
2602901 . When the payment provider reports a subscription as "trialing"
261- (delayed billing), the system MUST map this to active status
262- internally, since delayed billing is not a product-level trial.
291+ (e.g. pre-launch delayed billing), the system MUST map this to
292+ active status internally, since delayed billing is not a
293+ product-level trial.
2632942 . When the payment provider reports "incomplete" or "paused" status,
264295 the system MUST map these to terminal statuses (unpaid or canceled
265296 respectively).
@@ -299,6 +330,28 @@ lapses, with email notifications at each stage.
299330
300331### Changelog
301332
333+ #### 2026-03-21 -- Remove delayed-billing start date
334+
335+ - Removed configurable billing start date (` STRIPE_KILOCLAW_BILLING_START ` )
336+ and associated checkout rules (former rules 6–7). New subscriptions now
337+ always bill immediately.
338+ - Pre-launch subscriptions created with a delayed ` trial_end ` are still
339+ handled correctly; the trialing→active status mapping remains until those
340+ subscriptions transition.
341+
342+ #### 2026-03-20 -- Promotional codes and introductory pricing
343+
344+ Previous values:
345+
346+ - Standard plan first-month discount: coupon applied at checkout
347+ - Promotional codes: not allowed on either plan
348+
349+ New values:
350+
351+ - Standard plan first-month discount: introductory price with automatic
352+ transition to regular price at period end
353+ - Promotional codes: allowed on both plans at checkout
354+
302355#### 2026-03-19 -- Pricing and trial changes
303356
304357Previous values:
0 commit comments