#tymm-Invoice

1 messages ยท Page 1 of 1 (latest)

marble sphinx
#

Hi there, so you want to add some metadata to an invoice when customer.subscription.updated event is fired?

potent flax
#

preferably i would want to add the metadata during creation/ before customer.subscription.updated callback to facilitate the checking

#

anyway if i were to add metadata to invoice i should do it in customer.subscription.updated?

marble sphinx
#

It's up to you, you can always update the invoice with metadata before it's finalized.

potent flax
#

so i'll have to query the invoice using Invoice.search? or is there other way that i can get the invoice object using the subscription object?

marble sphinx
#

Can you tell me a bit more about the use case? so I can advise the best possible solution.

potent flax
#

im trying to facilitate data extraction on the event object i get in invoice.payment_succeeded after a customer has paid. so i was trying to put the information i need upon creation of the subscription update

marble sphinx
#

And where is the metadata coming from?

potent flax
#

i have them when i call subscriptionItem.update

marble sphinx
#

OK, the problem is that the invoice may not even be created when your subscription item is updated. Can I suggest you to update the metadata to the subscription item instead?

potent flax
#

yeah ive tried that, but i cant seem to find it in the event object of invoice.payment_succeeded callback

marble sphinx
potent flax
#

ok, got it, thanks ๐Ÿ™‚