#0xTypedef

1 messages · Page 1 of 1 (latest)

keen ermineBOT
upbeat nebula
#

price_data works as well as if you pre-define a Price and use its Id only in the Checkout Session Creation API

zenith zenith
#

To avoid that, I should just use price_data right?

upbeat nebula
#

If you make the price in dashboard then you can just use its Id here

#

And yes to avoid creating price on Dashboard you can use price_data here. It will create a price on-the-fly

zenith zenith
#

Thanks

#

if I change the quantity, does that multiply the price

#

or the number of subscriptions?

upbeat nebula
#

it will multiply the price

zenith zenith
#

Should I pass the full amount or just change the number of quantity?

upbeat nebula
#

It's up to you. Either way works but I would put quantity for clarity to your customer

zenith zenith
#

Thanks

zenith zenith
#

How do I get the metadata from checkout session from

 const subscriptions = await ctx.stripe.subscriptions.list({
      customer: customerId,
      status: "active",
    });
#

doesnt seem to be in the response

#

@upbeat nebula

upbeat nebula
#

Let's include expand: ['metadata']

zenith zenith
#

It says This property cannot be expanded, you may try data.metadata instead.

#

tried it still says This property cannot be expanded

upbeat nebula
#

okie let me try

#

Um I do get the metadata on my response

#

metadata needs to be a dictionary. I am seeing units here is not key-value

zenith zenith
#

that shouldnt matter with javascript if it has the same key no?

#

this is the response im getting

upbeat nebula
#

okie do you have the request id (req_xxx)?

zenith zenith
#

req_VxGD14yjIWXgbN

upbeat nebula
#

This is the request when you created it

#

And I see the metadata on response

zenith zenith
#

Its not possible to get the session metadata from the subscription that was created by the session?

#

from this

const subscriptions = await ctx.stripe.subscriptions.list({
      customer: customerId,
      status: "active",
    });
upbeat nebula
#

No, because the metadata belongs to the Checkout Session, not the associated Subscription