#kmbro-metadata

1 messages · Page 1 of 1 (latest)

pastel vessel
#

hi there! which parameter are you using to set the metadata on an individual item?

paper sail
#

stripe.subscriptions.create > items.metadata

#
const sub = stripe.subscriptions.create({
  items: [{ metadata: {'key': 'value'}, ...otherParams}]
})
#

something like that ^

pastel vessel
paper sail
#

I tag individual line items for reporting in my system -- I am a platform account and use express accounts

#

Also -- I generate my own invoices -- and use the line item metadata on subscriptions to store text that can be displayed on my invoices.

But I am updating things now to use subscription schedules (they didn't exist when I first created my system) but not having the metadata there on the line items is going to throw things off unfortuantely

#

And yes -- i think I am going to have to do some thing with the metadata on the subscription for this one instead of the line items. Unfortunate extra logic I'll have to maintain

#

I have a followup question @pastel vessel

Is there a webhook that fires when a subscription schedule starts a subscription? Like when it transitions from schedule -> acutal subscription?

#

I don't see documentation on that actual "switch" happening (basically when the subscription becomes active -- which could be the subscription.created? webhook, but I am unsure if that will actually fire here or not)

pastel vessel
#

yes, you would get the usual subscription webhooks e.g. customer.subscription.created, customer.subscription.updated, etc. The event you receive would depend on the change you're making in that phase

paper sail
#

ok great. thanks. I think I'll just have a webhook handler then for customer.subscription.created/updated that updates the line items with the correct metadata -- which should handle the issue I am facing.
Thanks