#でんでんAIO-subscriptions

1 messages · Page 1 of 1 (latest)

wind vine
#

Which object in the webhook event invoice.paid represents the time of payment?

you can use created of the invoice.paid event as the time of payment. Can you share more on why you require the time of payment though?

Also, is there one that represents the next billing date?

The period_end would also refer to the next billing cycle. https://stripe.com/docs/api/invoices/object#invoice_object-period_end
Or if the first payment attempt failed, you can see the next automatic retry here : https://stripe.com/docs/api/invoices/object#invoice_object-next_payment_attempt

Is there any way to distinguish between initial payment and recurring payment in the billing_reason of the invoice.paid object in the webhhook event?
https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason

subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription.

is there an event that is fired when a billing fails?
You can look at invoice.payment_failed : https://stripe.com/docs/api/events/types#event_types-invoice.payment_failed

echo hull
#

Can you share more on why you require the time of payment though?

When the next billing date cannot be obtained from the object, the next billing date was going to be calculated from the settlement date

analog plover
#

Hi @echo hull I'm taking over this thread, give me a sec to catch up

#

Hi @echo hull can you elaborate more on your question? what do you mean by the time of payment ?