#hedjnik

1 messages · Page 1 of 1 (latest)

jade kindleBOT
cobalt fractal
#

Unfortunately the metadata from the line_items can't be automatically copied over to the subscription. The two main ways to do this would be to:

  1. Set the metadata for those items both on the line item and in subscription_data.metadata
  2. Listen for the checkout.session.completed event and copy the metadata from the line items to the subscription from there
clever kindle
#

Alright, thank you, just one other thing, when I get the subscription data back and I want to update the subscription items to add the metadata or change quantity or whatever else, is there any easier way to know what the items actually are or do I just need to loop over them and compare the price ids to the known ids for each product to know what the items were? This was the main reason I wanted the metadata added so I could include the item name, internal ids and such to it.

cobalt fractal
#

Thinking on this and will get back to you but nothing is immediately coming to mind. It can also help to cache these ID->name mappings on your side for easier lookup

clever kindle
#

Alright, thank you very much. Its fine if thats what I need to do, just wanted to make sure I wasn't missing something obvious and doing it wrong 🙂

cobalt fractal
#

Yeah it is looking like that would be the best way to assosciate them at the moment. Not finding a more automatic way to use metadata or something else