#josephmaxim

1 messages · Page 1 of 1 (latest)

lyric mantleBOT
delicate minnow
#

Hello

spring moon
#

hi

delicate minnow
#

There are a few places to set metadata for your Checkout Session. You can either set it top-level (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata) which will pass it to checkout.session.completed or you could set it within payment_intent_data (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata) or subscription_data (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata) which passes it to the underlying objects that are created due to the Checkout Session.

spring moon
#

const session = await stripe.checkout.sessions.create({ mode: "subscription", payment_method_types: ["card"], line_items: [ { price: priceId, // For metered billing, do not pass quantity quantity: 1, }, ], customer: stripeCustomerId, metadata: { userId: _id, }, success_url: ${appUrl}?notify=subSuccess, cancel_url: ${appUrl}/, });

delicate minnow
#

Yep that looks fine. Do you have an example Checkout Session that you can share that I can look at? And have you logged out _id to ensure that is set?

spring moon
#

this code returns an empty metadata on checkout.session.completed

delicate minnow
#

Can I see an example Event ID or Checkout Session ID?

spring moon
#

okay give me one sec

#

evt_1NpFMSFrA9OQgg2I4huEuO4y

#

[1] 2023-09-11 15:01:28 --> checkout.session.completed [evt_1NpFMSFrA9OQgg2I4huEuO4y]

delicate minnow