#vlad_api
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/1409491596491231274
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
I've tried to listen for invoice.created webhook, and update invoice, but seems it doesn't work for initial payments
it should be possible. what didn't work exactly? did you get an error message? if so, can you share the failed Request ID (req_xxx)?
also note that:
When a Subscription creates an Invoice, the metadata copies to the Invoice object’s parent.subscription_details.metadata attribute
https://docs.stripe.com/metadata#exceptions
So, for my webhook listening attempt
I've listened to invoice.created and send invoice update call inside that webhook processing
But as I'm seeing on the events logs - my update request was accomplished after invoice was paid
So invoice.paid webhook doesn't have that metadata
req_9szVeBL0KkXCQM - request id
👋 taking over for my colleague. Let me catch up.
yes sorry I'm looking at it as we speak
there are multiple things that you can do in order to avoid this issue
so basically one thing would be to listen to invoice.updated events (e.g. evt_1Rzxu8KbHTyAU2ATzIK3BYmS) and receive the metadata you add it
another one is a general recommendation we ask users to do, is, instead of relying on the event object you're receiving, you could retrieve the latest version of the object from the API which will then have the missing metadata
the last one would be to create the invoice in a draft mode as explained here https://docs.stripe.com/invoicing/integration#create-invoice-code:~:text=If you set,API%3A