#.eartharmy

1 messages · Page 1 of 1 (latest)

glacial atlasBOT
jade cape
#

👋 happy to help

#

would you mind sharing a failed request ID?

bold jetty
#

sure, will get back in a few moments

#

this is the latest test mode id: req_2gNr7fEmd1VjAK

glacial atlasBOT
prime bronze
#

Hi! I'm taking over this thread.

bold jetty
#

hi, anything I can provide you

prime bronze
#

The error message is pretty clear:

You passed an empty string for 'line_items[0][price]

#

You neet to set a price ID (price_xxx) to create a Checkout Session.

bold jetty
#

like this right priceIds: {
test: '',
production: 'price_1O310MEqR3aWmwoU4kQlKeQP',
},

prime bronze
bold jetty
#

while switching to test mode, I did update my priceID with the one for test mode, hence I would like to know if there's anything else despite priceID that might create this issue. Because I didn't get this error in production

#

do I need to reference it in stripe session like this: const stripeSession =
await stripe.checkout.sessions.create({
success_url: billingUrl,
cancel_url: billingUrl,
payment_method_types: ['card',],
mode: 'subscription',
billing_address_collection: 'auto',
line_items: [
{
price: PLANS.find(
(plan) => plan.name === 'Pro'
)?.price.priceIds.production,
quantity: 1,
PriceID:"........" //add this line?
},
],
metadata: {
userId: userId,
},
})

prime bronze
#

Can you retry your request with a price ID and see if it works or not?

bold jetty
prime bronze
#

updates it with test priceID, unfortunately no success
Can you share the request ID (req_xxx) that failed?

bold jetty
#

yes, same issue with line_items[0][price], here's the id:
req_9WE3yEc4NrsfBK

#

upated priceID as reference price: {
amount: 14.99,
priceIds: {
test: 'price_1O53TXEqR3aWmwoUh9ytdfZl',
production: '',
},
},

prime bronze
#

no you didn't set a price ID

#

It's empty, but it should be something like price: "price_xxxx"

bold jetty
# prime bronze Here:

apologize for the confusion, setting it manuelly solve this issue then. Originally stored in stripe.ts and I use function to get PriceID there.

#

Thanks a lot for your help and have a nice day!