stripe-node
stripe-node copied to clipboard
apiVersion set in new Stripe, but ephemeralKeys.create still ask for it
trafficstars
Describe the bug
const stripe = new Stripe(conf.key, { apiVersion: '2025-05-28.basil' });
const customer = await stripe.customers.create();
const ephemeralKey = await stripe.ephemeralKeys.create({
customer: customer.id
});
fails with "Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node"
To Reproduce
See the bug description. Just needs a stripe test key.
Expected behavior
stripe.ephemeralKeys.create(customer) should work without adding options { apiVersion }
Code snippets
OS
Linux
Node version
v20.19.2
Library version
18.2.1
API version
2025-05-28.basil
Additional context
I'm new to stripe, but it seems to me that once apiVersion is set, there is no need to set it again in each call ?