#apax3058

1 messages ยท Page 1 of 1 (latest)

left sealBOT
snow quarry
#

๐Ÿ‘‹ happy to help

sharp brook
#

I have seen that, but I need to include subscription_data metadata when creating the subscription, so therefore i chose not to use that one.

Maybe it's possible to add subscription_data when using pricing table?

const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  locale: "auto",
  payment_method_types: ["card"],
  line_items: [
    {
      price: "price_1OWRo7Dit1MkL9lioNAdQCxP",
      quantity: 1,
    },
    {
      price: "price_1OWRopDit1MkL9lisSuU2eAt",
      quantity: 1,
    },
  ],
  subscription_data: {
    description: `ID: "${device?.device_id}"`,
    metadata: {
      supabase_device_id: supabaseDeviceId,
      internal_device_id: internalDeviceId,
      supabase_user_id: user.id,
    },
  },
  customer: profile.stripe_customer_id,
  success_url: successUrl,
  cancel_url: cancelUrl,
});

Here's the full snippet of my current code.

snow quarry
#

I see you're passing the customer Object here

#

if that's a requirement maybe Pricing Tables aren't the best option here

#

let me ask you this, is the second price an upsell of the first one?

sharp brook
#

Yes, the second price is an upgrade to the first price. Thank you. I'll look into this!

snow quarry
#

let me know if you need any more help

sharp brook
#

Thanks ๐Ÿ™‚