#tounka
1 messages · Page 1 of 1 (latest)
Hi there
The object will contain all the properties you see in our API ref: https://stripe.com/docs/api/checkout/sessions/object
So yes, you will see Sub ID and Invoice ID
thanks
and if i get the cutomer.subscription.deleted event, will there be an invoiceID?
So if you look at the API Ref you can look at the Event type. Ex: https://stripe.com/docs/api/events/types#event_types-customer.subscription.deleted
Then you will see in there the type of object it is. So for customer.subscription.deleted you can see it says "is a subscription" and you can click on "subscription" to go to that Object to see all the properties that will be returned in that Event
i know the invoiceID is a property on the object. i'm curious since the subscription is being deleted, if an invoice would even be prepared
You mean would a new invoice be generated when you delete a Subscription?
yea or would the subscription.InvoiceId have the last invoice that was created or would subscription.InvoiceId be null
There is no invoiceId property on a Subscription object. There is a latest_invoice property which will always show the most recent invoice for that Sub. In terms of deletion, it depends on whether invoice_now (https://stripe.com/docs/api/subscriptions/cancel#cancel_subscription-invoice_now) is passed when deleting a Subscription for whether an invoice is generated. The default is that a new invoice will not be generated.
yea my mad, i meant latest_invoice. i'll be using the customer portal. What is the behavior on deletion?
Pretty positive customer portal does not generate an invoice on Sub cancellation. I'd recommend testing this out to be 100% though
got you. thank you!