I am creating a subscription payment checkout session using this code:
const prices = await stripe.prices.list({
lookup_keys: [body.lookupKey],
expand: ['data.product'],
});
const session = await stripe.checkout.sessions.create({
billing_address_collection: 'auto',
customer: body.customerId,
line_items: [
{
price: prices.data[0].id,
quantity: 1,
},
],
mode: 'subscription',
success_url: body.successUrl,
cancel_url: body.cancelUrl,
});
I get this error message:
Error: The provided key 'rk_test_***' does not have the required permissions for this endpoint on account 'acct_xxxxxxx'. Having the 'rak_plan_read' permission would allow this request to continue.
I can't see how to grant the "plan_read" permission to my restricted key from the stripe dashboard. The docs suggest "plans" have been superseded by prices. How do I grant this permission?
Edit #1: My restricted key has these permissions configured in the dashboard:
Customers - Write
PaymentIntents - Write
Products - Read
Checkout Sessions - Write
Yep, Plans are generally deprecated in favour of Price objects. In this instance, you should configure your restricted API key to have read/write permissions on the Prices resource which is listed in the creation UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With