#brotzka-de-en_best-practices
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/1266327919911768087
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
The only workaround I found would be to use webhooks and listen to the invoice.created event pulling the metadata from the parent subscription and adding it to the invoice
๐ happy to help
Hey ๐ Is it possible to have metadata from a subscription automatically synced/added to all subsequent invoices?
that's already the case
Oh, that's great! Thank you ๐
And this works for invoices that are automatically generated by an subscription as well?
each invoice has a snapshot of the metadata on the subscription, see https://docs.stripe.com/api/invoices/object#invoice_object-subscription_details-metadata
Ah, I see. Is this searchable as well?
It seems that only the direct metadata is searchable: https://docs.stripe.com/search#supported-query-fields-for-each-resource
not really since that specfic field is not supported in the grammar : https://docs.stripe.com/search#query-fields-for-invoices
๐
Okay.. But then I think that I need to work with webhooks.. I need some of the metafields from a subscription directly as searchable metadata on the invoice.
you can call the Invoice.update API whenever an invoice is created and copy the subscription metadata manually