#kun_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1386755488208781333
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Received unknown parameter: subscription_data[billing_thresholds]. Did you mean billing_mode?"
I am getting this error
any help?
Hi there
Billing thresholds are not supported when starting a Subscription with Stripe Checkout. You can see the supported billing-specific parameters at https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-05-28.preview#create_checkout_session-subscription_data
You would need to use a custom integration if you want Billing Thresholds where you create Subscriptions directly via the API: https://docs.stripe.com/api/subscriptions/create?api-version=2025-05-28.preview#create_subscription-billing_thresholds
Hi there, I'll be taking over for bismarck here, who needed to step away
Do you have additional context beyond what you described above?
I've read the summary there and bismarck's comments so far
sure
I have one product with three price id
1 SUB for 200 usd per month
2 PAYG for 1 QTy charge 10usd
3 Overage for extra QTY
These will be connected to subscription
so I am trying to create the subscription with three prices id
and here is my implementation
const params: Stripe.Checkout.SessionCreateParams | any = {
mode: 'subscription',
line_items: [{ price: process.env.VALITRON_PAY_AS_YOU_GO_PRICE_ID }],
subscription_data: {
billing_thresholds: { amount_gte: 1000 },
},
success_url: `http://localhost:3000/recruiter/credits/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `http://localhost:3000/recruiter/credits/cancel`,
metadata: recruiterEmail ? { recruiter_email: recruiterEmail } : undefined,
};
else if (plan === "SUB") {
const subParams: Stripe.Checkout.SessionCreateParams | any = {
mode: 'subscription',
line_items: [
{ price: process.env.VALITRON_SUBSCRIPTION_PRICE_ID, quantity: 1 },
{ price: process.env.VALITRON_OVERAGE_PRICE_ID },
],
subscription_data: {
items: [
{ price: process.env.VALITRON_SUBSCRIPTION_PRICE_ID, quantity: 1 },
{ price: process.env.VALITRON_OVERAGE_PRICE_ID, billing_thresholds: { amount_gte: 10000 } }, // $100
],
},
success_url: `http://localhost:3000/recruiter/credits/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `http://localhost:3000/recruiter/credits/cancel`,
metadata: recruiterEmail ? { recruiter_email: recruiterEmail } : undefined,
};
okay, and what issue are you having?
Yeah, as bismarck mentioend above, billing thresholds are not supported for Subscriptions created by Checkout. The specific Subscription features that you can use with Checkout are enumerated in the API reference here: https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-05-28.preview#create_checkout_session-subscription_data
If you want to use the billing_thresholds parameter, you would need to create Subscriptions directly via the Subscriptions API and then collect payment method details on your own page using Stripe Elements
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
So I cannot use the checkout directly with this way?
Not if you want to use the billing thresholds feature
Okay let me ask you a quick question
if my subscription incrementing the QTY
how can I trigger the invoice and charge the customer on every 1 QTY increment
You mean you want to update the Subscription mid-cycle, change the quantity of a price from n to n+1, and then cut an Invoice immediately?
yes
You could achieve that using the parameter proration_behavior: 'always_invoice'
Are you aware of our test clocks feature? With Subscriptions, fine tuning the exact behavior you want can be difficult. Test clocks allow you to create a simulation and advance the time for the Subscription so you can see the effects that your changes have and review the Subscription's Invoices, etc. I highly recommend using test clocks when developing a Subscriptions integration
Is it possible that I create the subscription with session stripe checkout page
and then update the subscription with threshold value?
It seems to be possible based on a quick test, but again, I would highly recommend testing with Test Clocks to observe the behavior and ensure that it aligns with your desired effect