#apolloengineer_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1309318922671231037
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Have you considered using Subscription Schedules?
https://docs.stripe.com/api/subscription_schedules
This would allow you to specify the first month as free by creating your first phase with the trail property set to "true". You would use the same Price ID in the trail phase so it would have the same billing period.
https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-phases-trial
You just specify iterations: 1 for the first phase and make a second phase this essentially the same but without the trail parameter.
This sounds promising
Subscription Schedules are another layer of complexity on top of Subscriptions so it can be easy to get into trouble. BUT, if you review the docs carefully and focus on your exact use case, they do allow for a higher degree of customization.
I strongly recommend building end-to-end testing scenarios so you can validate the behavior is what you expect.
ok this is my pseudo code, I'll try it out
items_parameter = items.reject { |item| item[:deleted] }.map do |item|
{
plan: item[:plan],
quantity: ZpStripe::ConversionUtils.get_stripe_quantity(
quantity: item[:quantity],
product: PM.plan_with_id(item[:plan]).product
),
metadata: item[:metadata] || {}
}
end
Stripe::SubscriptionSchedule.create({
customer: stripe_customer_id,
phases: [{
trial: true,
iterations: 1,
items: items_parameter
}, {
items: items_parameter
}]
}.merge(sub_options_temp))
Have you run it? What happens?
๐ taking over here and LMK if you have more questions
it creates a trial invoice
curious if we know if the use customer is emailed this invoice
You mean a trial Subscription? You can paste the Subscription Id to your Stripe Dashboard search and inspect its Invoice