#krishna_subscription-setupfee
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/1230559799716872283
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- krishna-awate_api, 10 hours ago, 29 messages
Hey @bright depot I don't understand what you call a "normal transaction". Can you give me an example of what someone pays today versus in a month?
Normal transasction means one time transaction.
want to do one time transaction and at the same time start recurring from next month
I'm really sorry but I don't get what that could mean.
If you charge me $10 today and then $10 in one month, then really you are starting a $10/month recurring subscription right now
Suppose I want to charge user $10 as one time payment but from next month want to start recurring of $50 which will be for one year subscritpion
$10 will be one time payment not recurring.
Would this be kind of a "paid trial"? Like you pay $10 now for a trial of the $50/year subscription?
Kind of same.
Okay so what you want to do is start the Subscription and its trial really immediately and you can have a "one-off invoiceItem" for that $10 fee. How to do this depends how you integrate. Do you use Checkout or the Subscriptions API directly?
krishna_subscription-setupfee
Subscription API
waht to pass as PRICE_ID?
the id of a Price that represents that $10.
Do I need to crate price like same
const price = await stripe.prices.create(
{
unit_amount: intAmount,
currency: currency.toLowerCase(),
recurring: { interval: "month" },
product: product.id,
},
{
stripeAccount: stripeAcId,
}
);
yes
you are clearly charging for different things here so it's important to model them as their own Product and Price
Okay got it. But how long that $10 will be charged. How can I manage that?
I want to charge $10 for 1 month and $50 for remaining months
Please try it first, I can see you're confused and just seeing the subscription should help.
The $10 is charged once as a one-time fee, then the Subscription would be on a trial period until next month where it would charge $50 each month. That's exactly what you described I think
Yes I want same.
But as I read document:
Add an extra charge on a subscription’s first invoice
Include a one-time charge to the first subscription invoice using add_invoice_items:
yes but you're doing a trial period
Isn't it like first month $50 + $10 then remaining month only $50?
really just try it as a developer, this will be much faster
Trying
pi_3P6yYxDBfYojrB0W04qnBOE8
charged same $50
const product = await stripe.products.create(product_name, {
stripeAccount: bank_info.stripe_account_id,
});
const product_1 = await stripe.products.create(product_name, {
stripeAccount: bank_info.stripe_account_id,
});
// Create price
const price = await stripe.prices.create(
{
unit_amount: intAmount,
currency: currency.toLowerCase(),
recurring: { interval: "month" },
product: product.id,
},
{
stripeAccount: bank_info.stripe_account_id,
}
);
const price_1 = await stripe.prices.create(
{
unit_amount: '10',
currency: currency.toLowerCase(),
product: product_1.id,
},
{
stripeAccount: bank_info.stripe_account_id,
}
);
Hello! I'm taking over and catching up...
// Create subscription
const subscription = await stripe.subscriptions.create(
{
customer: customer.id,
items: [{ price: price.id }],
add_invoice_items: [
{
price: price_1.id,
},
],
payment_behavior: "default_incomplete",
payment_settings: {
save_default_payment_method: "on_subscription",
},
expand: ["latest_invoice.payment_intent"],
application_fee_percent: +service_fee,
cancel_at: sub_end_date,
description: title,
},
{
stripeAccount: bank_info.stripe_account_id,
}
);
you forgot to do the trial like I explained.
and really: try it on your own account with Connect first, look at the real Subscription and the resulting Invoice in the Dashboard to understand it.
(leaving to Rubeus, just nudging you to try things slowly to grasp them)
Where to add trial?
There are several parameters you can choose from to add a trial when creating a Subscription: https://docs.stripe.com/api/subscriptions/create#create_subscription-trial_end
pi_3P6yjxDBfYojrB0W1OtfMGc5
Sir, Can you please check will this trial run for 30 days and then regular payment of $50 will start
Yep, looks like it.
You can confirm the behavior over time by using a Test Clock: https://docs.stripe.com/billing/testing/test-clocks
And what's what you wanted, right?
We're happy to have helped you!