#MetaMike
1 messages · Page 1 of 1 (latest)
Hello 👋
We don't implicitly copy the metadata over to invoice objects when you send it in with Subscription objects.
One option would be to retrieve the subscription when you receive invoice.* events and look at the object metadata
But this was working in previous dates, Not sure it stopped working from today morning(IST)
Can you share an example where this worked before?
You can share the IDs here
You need invoice id right or subscription id?
Yup the invoice ID should work where you see the metadata that was updated on the subscription
sorry check this one in_1MvFzWHdO2c7e2jgVnYIalHX
I don't see any metadata on the invoice
Ah are you referring to metadata on the invoice line item instead?
subscriptionId: "93",
cycle: "year",
isSubscriptionChange: "true",
planId: "3"
}```
This right?
Its not on the invoice though. Its on the invoice line items which is a diff object
Its but why it stopped coming from today atleast in line objects
The metadata of an Invoice’s line Items is pulled from the metadata of the Invoice’s Subscription whenever the Line Items are retrieved. This is only for Invoice Line Items where type: subscription
given that, can you share an example from today?
I have created subscription, Then upgraded subscription with new priceID but in subscription upgrade webhook we are not getting metadata in no where
Can you share the subscription ID?
OR the invoice ID where you're not seeing the metadata in the line items?
The type of line items on the invoice above is not subscription but invoiceitem instead
https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type
These are two different types.
If you look at the event where you saw the metadata for subscription, you can clearly see the line item being type subscription (in the screenshot)
https://dashboard.stripe.com/test/events/evt_1MvFzXHdO2c7e2jgFC44LRcL
vs the one where it didn't work
https://dashboard.stripe.com/test/events/evt_1MvLbIHdO2c7e2jg6y8VG3U9
Can you provide the solution to get out of it please
The easiest way would be to look at billing_reason on the invoice when you get invoice.* events and if the reason is subscription_update then you can retrieve the subscription and look at its metadata.