#ilyoTheHorrid (Endstream)
1 messages ยท Page 1 of 1 (latest)
Hi ๐ can you share the IDs of requests where you were receiving those messages?
Actually, it was solved by adding recurring and not type:
const price = await stripe.prices.create({
unit_amount: stripePayments.allPayments * 100,
currency: 'usd',
recurring: {
interval: 'month',
usage_type: 'licensed'
},
product: process.env.SCRIPE_PRODUCT
})
Could this be a mistake in the docs?
I don't believe so, but I'm not entirely sure I understand what your concern is.
recurring is the correct parameter to use when creating a Price, and that is the field shown in the list of parameters for that endpoint:
https://stripe.com/docs/api/prices/create#create_price-recurring
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Because of how the error is written I assume it was the price parameter that was missing
type=recurring
Can you share the ID of the request that raised that error?
Sure, req_tXm7MPwhq7aEa9
Thank you. That request isn't trying to create a Price, which is why the error message doesn't contain advice on what parameters to provide to create a Price. Instead that function is trying to create a Subscription, but a one-time Price was provided while the function was expecting the ID of a recurring price to be provided in items[0].price.
Ah OK, thank you
Any time!