#Moichi - billing
1 messages · Page 1 of 1 (latest)
Hi there!
Maybe you can check the billing_reason of the invoice? https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
That works if the invoice already exists, but upcoming do not create an invoice. In this case I have to check if for the current subscription already an invoice exists that would indicate recurring...
Hum... Can you use the start_date of the subscription to guess if it's the first invoice or not?
Or better, check if latest_invoice is null: https://stripe.com/docs/api/subscriptions/object#subscription_object-latest_invoice
last thing sounds promising, I will try that , thank you
Approach fails, because a subscription always creates an invoice with 0,00€, so I will always have one... I guess then I have to make another API call to check invoice amount...
Well, it means that you are not looking for the first invoice, but the second invoice? Or the first non-zero invoice?
well I need to know if the charge of a customer is the first time or a follow up (second year). the subscription is charged once a year. So it seems I have to get the first invoice with amount > 0
That's an option. But you could also check the start_date of the subscription to know if it's a new subscription or an old one.
so you suggest to compare start_date.year against now.year ?
Yes
ok, i think this will work for my case. Will try this, thanks.
Moichi - billing