#patrick-subscription-trial
1 messages · Page 1 of 1 (latest)
I am not aware of a way to do this by directly creating invoices. I think you could do this witha subscription schedule that is scheduled to start at a certain time and then cancels after 1 cycle https://stripe.com/docs/billing/subscriptions/subscription-schedules
Though that would create a subscription as well so I am not sure if the UI around that would be confusing for your users
Ok. I was trying to avoid myself having to schedule this. We have a SaaS service with a subscription. The idea is that we collect the credit card, start the subscription with a 30-day trial, and then charge the setup fee when the sub starts. I suppose I could catch the subscription change event with a webhook and initiate the setup fee charge. That would work, right?
Can you give me a specific example of what a customer paying you through this one time invoice and then a subscription would look like? I think I am not clear on how they are intended to interact here
You can definitely have a free trial and an initial setup fee on our subscriptions, can find the docs on that in a moment
Ok. Our product is an automated referral mgmt service. SaaS. 89/mo. We have to spend a significant amount of time training. So we charge a one time setup fee to cover the training. At the moment, some balk at paying the training fee before seeing the svc work.
So we want to delay collection of everything for 30 days. It's easy to do this with the subscription portion. The one-time setup fee not so easy. I suppose we could also just refund the setup fee if unhappy customer.
Does that clear things up?
I'm learning stripe, which is an amazing product, but there is a LOT.
Yeah definitely a lot to learn up front. I feel you there. So to be clear, do you want to charge your users 178 the first month after a 30 day free trial, and then charge 89/mo after?
yes
Or are you just looking to charge 89/mo after an initial 30 day tria
Gotcha
So I think the easiest way to do this would be to create a normal subscription with a trial
And you can also specify an $89 one-time invoice item via the add_invoice_items paramter https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items
async function startSubscription(stripe, paymentMethodId, customerId, price) {
// We either need to store the stripe subscription id in our db or we need to
// store the camp_id in the stripe subscription metadata.
const subscription = await stripe.subscriptions.create({
currency: 'usd',
description: '(created by Stripe Shell)',
customer: customerId,
default_payment_method: paymentMethodId,
trial_period_days: 30,
items: [
{
price: price,
},
],
})
console.log('subscription:', JSON.stringify(subscription, null, 3))
}
So I can just add a one-time item to the items array?
And it would bill 30 days later?
items is for your recurring subscription items, add_invoice_items would be for your one-off charges on the initial invoice
So you would want an 89/mo recurring price in items and a one time 89 price in add_invoice_items
Trial periods for subscriptions can be combined with one time prices and add_invoice_items. This may happen if you want to charge a one time fee or add on at the same time as starting a trial. Note that doing this will cause an invoice to be cut immediately for the amount of the one time item at the beginning of the trial. -- Looks to me like the setup fee will be billed immediately.
My apologies, I forgot about that interaction. In that case, I think you would want to create the subscription without add_invoice_items and then after the subscription is created make a separate API call to add an invoice item to the Customer
https://stripe.com/docs/api/invoiceitems/create
patrick-subscription-trial
That would be one time on your next invoice after the trial and would not be immediately billed
Ok. Thx. I'm trying it.
let me know if it doesn't work
It charged the setup fee immediately.
Subscription still has trial period. I'm reading docs to see what I missed.
- Create the Subscription with a trial
- Update the Subscription to add
add_invoice_itemsfor the next Invoice.
Alternative: Use SubscriptionSchedules
yeah you need to do it in 2 steps otherwise the fee is added to the first Invoice for the trial period
It worked. Thanks. Quick question: What do I need to do to read what emails will be sent and when in test mode? I also need to setup a test clock, right?
👋 stepping in
We don't send emails in test mode really so as not to spam folks with fake emails.
Ok. I'm using a gmail address with name+key@gmail.com. Doesn't matter, I guess. Would like to see what would be sent.