#emd

1 messages · Page 1 of 1 (latest)

green sorrelBOT
karmic umbra
#

Hello! So your goal is to have different metadata for each line item in a Checkout Session?

stone silo
#

yes

#

I know I can pass meta via the subscription_data field

#

but I want diff meta for EACH subscription in the checkoutsession

karmic umbra
#

Checkout line items do not have their own metadata, so that's not possible. Can you tell me why you want metadata on the line items?

#

Maybe I can recommend another approach.

stone silo
#

sure, we have built a system that allows folks to sponsor orphans. And it allows them to choose some preferences (like country etc).

#

we want to add the ability to sponsor multiple orphans in one checkout session now, but allow them to have different preferences

karmic umbra
#

How many different preferences are there?

stone silo
#

we made it work before by attaching their preferences to the meta data of the subscription, so when the sub created event comes in, I can read that and assign the appropriate orphan

#

right now there are two preferences

karmic umbra
#

Two preferences per line item, or two for the whole Checkout Session?

stone silo
#

2 per line item. note though at the moment we only have one line item

karmic umbra
#

Are you using a single Price for this, or multiple Prices?

stone silo
#

ideally we'd actually like 2 subscriptions, each with one price (though that price would be the same)

#

one price

#

well we have two, one monthly and one annually, but that's no relevant here

karmic umbra
#

It won't be directly associated with each line item, but it will be associated with the Checkout Session as a whole, and you can add a key/value pair for each line item.

stone silo
#

I guess, I was trying not to respond to the checkoutsession created, I prefer to do the orphan stuff in sub created cuz then I have all the info I need

#

but I'll take a look at that, thanks

#

since I have you here, can I create TWO subs in a checkout session?

karmic umbra
#

No, a Checkout Session can only create a single Subscription.

stone silo
#

kk thanks

#

appreciate you and your guidance