Start a 14-day trial that converts to a paid plan on day 15
Create the subscription with the customer, the price, and a trial end date in one API call. Billing moves the subscription from trial to active when the first payment succeeds. If that payment and its retries fail, Billing moves the subscription to canceled under the rules that you configure.
Impact
In the sample, Ashglen Networks starts Jia on the Pro plan with a trial that ends 14 days after the call and with auto_renew turned on. The server action returns the trial end date that Billing sets, which the page passes to the account route.
Prompt for a coding agent: Start new customers on a 14-day Pro trial that renews automatically.
Select a file to view its contents