#MetaMike

1 messages · Page 1 of 1 (latest)

hasty egretBOT
night river
#

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

uneven belfry
#

But this was working in previous dates, Not sure it stopped working from today morning(IST)

night river
#

Can you share an example where this worked before?

uneven belfry
#

Yep

#

where do i share it?

night river
#

You can share the IDs here

uneven belfry
#

You need invoice id right or subscription id?

night river
#

Yup the invoice ID should work where you see the metadata that was updated on the subscription

uneven belfry
#

sorry check this one in_1MvFzWHdO2c7e2jgVnYIalHX

night river
#

I don't see any metadata on the invoice

uneven belfry
#

Im able to see

#

can is send you the event ID

night river
#

Ah are you referring to metadata on the invoice line item instead?

#
            subscriptionId: "93",
            cycle: "year",
            isSubscriptionChange: "true",
            planId: "3"
          }```
This right?
uneven belfry
#

Yes

#

this one

#

You got it

night river
#

Its not on the invoice though. Its on the invoice line items which is a diff object

uneven belfry
#

Its but why it stopped coming from today atleast in line objects

night river
#

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?

uneven belfry
#

I have created subscription, Then upgraded subscription with new priceID but in subscription upgrade webhook we are not getting metadata in no where

night river
#

Can you share the subscription ID?

#

OR the invoice ID where you're not seeing the metadata in the line items?

uneven belfry
#

Sure

#

Here you go
invoiceID: in_1MvLbGHdO2c7e2jg94ZhlLv8

night river
#

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

uneven belfry
#

Can you provide the solution to get out of it please

night river
#

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.

uneven belfry
#

Thanks and i appreciate your skills, You are DP absolutely describes your work

#

You are incredible