#Mikolaj

1 messages · Page 1 of 1 (latest)

toxic foxBOT
raw jasper
#

Hi, I assume you're using collection_method: charge_automatically , is that correct?

wintry reef
#

Yes

raw jasper
#

So what you're seeing is expected. The first invoice for this type of subscription is immediately finalized and charged. So, here is no one hour period in which a user can update the invoice before finalization. On the recurring invoices, as you pointed you would have an hour window. There are a couple of ways to solve for this.

1/ You can create a subscription with trial_end set a couple of seconds into the future. The subscription will first generate a $0 invoice, and once the trial is over a non-zero invoice will be created with a one hour draft period. The initial status of this subscription will be trialing and will transition to either active or past_due depending on the payment outcome.

2/ You can create the subscription through a subscription schedule, https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#start-subscription-future. When the schedule starts, the subscription’s initial status will be active with an initial draft invoice that is scheduled to finalize in an hour. Depending on whether payment of the initial invoice is successful or not, the subscription will either stay active or transition to past_due.

The second recommendation is a bit complex so I'd recommend the first one.

wintry reef
#

Okay thanks for very detailed answer.

I've also came up with one more idea - instead of modifying invoices prices directly, I could create a single-use coupon code every time I need to apply credits.

If I am not mistaken, I could then apply these coupons to both created subscriptions and drafted invoices.

Are there any potential issues with this approach?

raw jasper
#

Alternatively, you just add a bigger credit on the second invoice but that might not be ideal as customer want to see the lower price on the first invoice.

#

Yeap! I think we had the same idea at the same time. As always, I highly recommend that you test this to make sure that it's exactly the behavior you want.

wintry reef
#

Cool, I will try that then. Thanks for your time and answers!

raw jasper
#

Happy to help!

wintry reef
#

And have a nice day!