#kevinfleri-subscription-metadata
1 messages · Page 1 of 1 (latest)
@spark harness there are multiple levels of metadata. Do you have a concrete example of the evt_ id and the subscription id and which metadata you are missing?
This was working earlier, I do recieve the metadata in event.paid webhook, it is just an empty object even on stripe dashbored but when I log the Stripe.subscription.create method, it contains these metadata. this started today.
Hello! There's no such thing as an "event.paid" event. Are you talking about invoice.paid?
Yes invoice.paid sorry
Can you give me the event ID (evt_) of the invoice.paid event where you expected to see the metadata?
Thanks! Taking a look, hang on...
This was made today on test stripe, we are planning to go live, just an unexpected stuff coming up
It looks like you set metadata on the Subscription, but not on the Invoice the Subscription generated. Subscription metadata and Invoice metadata are separate. Do you have an example of where this worked as expected before?
It is not from the dashbord
"metadata": {
"accountUUID": "97b3109d-58e9-489d-8add-a33ffc284e82",
"customer": "cus_KEZXxcXDObmMEq",
"type": "card",
"stripeProductID": "prod_KA4wHfoN2gSgDb",
"priceId": "price_1JagmYHcDZHqQZa04G6Xqa9R",
"planID": "6d1ed617-92fb-4989-aa73-4d5006b9bda7",
"productName": "Comprehensive Care Bronze",
"beneficiaryUUID": "1c010812-b637-4a65-8445-005dc12dbcc1",
"customerUUID": "b100763c-6767-44fb-8a22-952b05d740a4",
"wooId": "698",
"firstName": "kennedy",
"lastName": "kevin",
"email": "ejykken@gmail.com"
},
Where specifically are you seeing that?
Are you looking at the specific event you sent me here? https://dashboard.stripe.com/test/events/evt_1JwouPHcDZHqQZa0HkIUf1ou
Oh, you're talking about the metadata on the line items inside the Invoice, not on the Invoice itself. Gotcha.
Yes, I am talking about the metadata
We need to use the metadata info on our end when we receive webhook.
Investigating further now...
@spark harness that invoice.paid event without the metadata is special. If you look at the invoice, it has a line item for a proration. That's because you used billing_cycle_anchor when you created the Subscription so it did a proration for the remaining time until that date. Those invoice line items behave differently and don't reflect the subscription's metadata in that case.
Yes, for certain conditions we used billing_cycle_anchor if the plan will be active on the middle of the month. But user is charged at this point since we have invoice.paid event.
How do I recieve metatada on invoice.paid webhook on a subscription with billing_cycle_anchor
you don't really. You shouldn't even rely on the metadata of the subscription
if you want the metadata to appear on the line item for proration or not you should set it at the subscription item level
https://stripe.com/docs/api/subscriptions/create#create_subscription-items-metadata this is what I'd do. That or retrieving the subscription when you get invoice.paid to read the metadata you need
Will try this, thanks