#Madelyn - HIP
1 messages · Page 1 of 1 (latest)
Okay so metadata shows up as a unique column for each key. Here's an example from my test account:
do you not see this?
Also can you share an Invoice ID for me to inspect?
Yeah I don't see that section. Here is an invoice ID:
in_1LBJzkAYs7f27xQZFqi4GGd8
How are these invoices created?
API
Directly or part of a subscription?
I'm not sure - how would I find out?
Oh wait! Directly, this isn't a subscription product
Okay so the issue is that the metadata doesn't propagate down to the related Payment Intent. Payment Intent metadata is what is available in the Balance report.
However, you can programmatically add Invoice metadata to the related payment intents to apply it for reporting
and set up a webhook listener function to automatically copy metadata for all invoices created going forward
Programmatically you could loop through all existing invoices using the Invoice List API.
https://stripe.com/docs/api/invoices/list
And update the related payment_intent to set the metadata equal to the Invoice.metadata.
https://stripe.com/docs/api/payment_intents/update#update_payment_intent-metadata
For the webhook approach, you could listen to invoice.finalized and use the invoice object included in that event to copy the metadata to the related payment intent.
https://stripe.com/docs/api/events/types#event_types-invoice.finalized