#geo_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1316861229926715402
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- geo_api, 23 hours ago, 38 messages
Hello
You can look at period of the line items to find end of current period (which is likely when the new invoice is drafted)
https://docs.stripe.com/api/invoice-line-item/object#invoice_line_item_object-period
In your example, line items have
end: 1739388267,
start: 1736709867
},```
for some reason I'm seeing a different value on the payload when I advance the time
"period": {
"end": 1736709867,
"start": 1734031467
},
is that expected?
Hi there ๐ jumping in as my teammate needs to step away. It is a little tricky to tell when the next Invoice will be due based on the previous Invoice being paid. You'll likely want to retrieve the related Subscription object when you receive the invoice.payment_succeeded Event, and then check the current_period_end parameter.
What payload are you referring to? Are you looking at an Event or an object?
I advanced time on this membership sub_1QVHzrDY3BzcP9iqApQmXJJM and was looking at the payload for invoice.payment_succeeded it triggered
Can you share the ID of the Event you're looking at? That ID should have an evt_ prefix.
And to confirm, you aren't interested in knowing the dates of the Invoice that was just paid, you want to know when the next Invoice will be generated?
evt_1QVI05DY3BzcP9iqY58WSrxe
correct, but wanted to rely on the handler that I have for invoice.payment_succeeded if possible
The information about the next Invoice's date isn't contained in the Event for the previous Invoice being paid. Instead I'd suggest retrieving the related Subscription object using the ID provided in the subscription field of the Invoice object in the Event.
Then you can check the current_period_end property on the Subscription to see when the current billing period will end and the next Invoice will be generated.
https://docs.stripe.com/api/subscriptions/object#subscription_object-current_period_end
oh I see, I'm going to give that a try! Thank you!