#lubudubu_code

1 messages ¡ Page 1 of 1 (latest)

alpine hullBOT
#

👋 Welcome to your new thread!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

🔗 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/1212383016039620618

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

⏲️ 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. Thank you for your patience!

blissful yokeBOT
prisma seal
#

Hi, let me help you with this.

#

You can't add metadata to the Subscription object that will be propagated to the generated Invoices. However, you can always access Invoices.subscription.metadata property, that will give you the metadata of the parent Subscription. You will need to expand the subscription property when you query the Invoice: https://docs.stripe.com/api/invoices/object#invoice_object-subscription

shrewd sapphire
#

So I'd should update the invoice based on subscription.latest_invoice id by stripe.invoices.update(id, { metadata: { key: 'value' } }. When doing this update, will it remove all already existing metadata properties or will upsert new?

prisma seal
#

I didn't mention anything about updating. Depends on what you're actually trying to achieve with this.

#

It will append new properties on updating.