#.eartharmy
1 messages · Page 1 of 1 (latest)
👋 happy to help
would you mind sharing a failed request ID?
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
sure, will get back in a few moments
this is the latest test mode id: req_2gNr7fEmd1VjAK
Hi! I'm taking over this thread.
hi, anything I can provide you
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.
like this right priceIds: {
test: '',
production: 'price_1O310MEqR3aWmwoU4kQlKeQP',
},
Yes. If you check the request you shared, there's no price ID set: https://dashboard.stripe.com/test/logs/req_2gNr7fEmd1VjAK
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,
},
})
Can you retry your request with a price ID and see if it works or not?
updates it with test priceID, unfortunately no success, it can't recognize it, but in the api requestID for production, it seems to be recognizing the priceid for production (lateste one as reference: req_XkWoLtvaPmrUtP ).
updates it with test priceID, unfortunately no success
Can you share the request ID (req_xxx) that failed?
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: '',
},
},
no you didn't set a price ID
Check the request in your dashboard: https://dashboard.stripe.com/test/logs/req_9WE3yEc4NrsfBK
Here:
It's empty, but it should be something like price: "price_xxxx"
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!