#Ramya
1 messages · Page 1 of 1 (latest)
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?
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!
Will this metadata differ between prices on the same product? It might make more sense to set this at the Product level
Ya, but the tax calculation tool that we are integrating with only checks for price metadata!
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
Thanks that would be of great help!
Is there any example's of how we can listen to these events?
Great, thanks.