#Ramya

1 messages · Page 1 of 1 (latest)

steel lanceBOT
stoic aspen
#

InvoiceItems and Prices are separate entities so you need to set the metadata on them separately

#

Can you tell me more about what you are trying to do here? You want to set metadata on the overall price object that the invoice item is for? Not just the item itself?

woven relic
#

Yes, so we have a feature where we want custom pricing so we are creating an InvoiceItem with price_data, but for tax calculation we want all the prices to have some metadata present.

#

Can't set it in the item only!

stoic aspen
#

Will this metadata differ between prices on the same product? It might make more sense to set this at the Product level

woven relic
#

Ya, but the tax calculation tool that we are integrating with only checks for price metadata!

stoic aspen
#

Gotcha, in that case a workaround might be to set this metadata on the Product, listen for price.created events, and when those come in you copy the metadata down from the Product to the Price manually

#

I will put in a feature request to add metadata to that price_data parameter but I can't guarantee it will be added so in the meantime it will be best to have a workaround like that

woven relic
#

Thanks that would be of great help!

#

Is there any example's of how we can listen to these events?

stoic aspen
#

Those are good docs to start with

woven relic
#

Great, thanks.