#jcu1012-checkout-session
1 messages · Page 1 of 1 (latest)
// Create Checkout Session const session = await stripe.checkout.sessions.create({ payment_method_types: ['card'], //customer_email: customerEmail, line_items: [{ price: stripePlan, quantity: 1, }], customer: { metadata:{'name': 'JK Rowling'}, email: customerEmail }, discounts: [{ coupon: 'CYXUqEo4' }], mode: 'subscription', tax_id_collection: { enabled: true, // Business VAT },
customer: {
metadata:{'name': 'JK Rowling'},
email: customerEmail
},
this is the part that's throwing the error
@outer nacelle the customer parameter only accepts an id [0], you would want to create the customer before creating the Checkout Session
[0] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer