#issamdb-trialend
1 messages · Page 1 of 1 (latest)
hello, you do the latter
but it's not immediate, but rather drafts an invoice scheduled for after 60 min.
then manually finalize() and pay() the Invoice via the API.
I will have to implement this using webhook events as it takes the drafted invoice few minutes to be created, is there a way to finalize this process in the same methode?
no you have to finalize and pay as separate API requests
aha, I see
Okay thank you 🙂
is there a way to distinguish the first invoice created after trial period end from other invoices?
have some ideas but none super clean (yet)
what is the billing_reason on the first Invoice (one after trial)
subscription
my idea is to check if there was a an invoice prior with amount due = 0
hmm so https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
tells me that subscription_cycle would be "n"-th auto-recurring Invoice
so subscription would be the one after trial
and subscription_create on first Invoice no trial
give that a look and see if what I say adds up on the cases you'll have
Alright
this is correct, but subscription_create also applied to new subscriptions without trial
and subscription_create on first Invoice no trial
correct that is what I meant with ^
sorry didn't catch that