#mir_subscription-cancellation
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/1278813333109211136
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey @slender matrix
Hi, you can end the trial by passing: https://docs.stripe.com/api/subscriptions/update#update_subscription-trial_end. Can you try this when updating the subscription please?
Do you have billing settings on your account that specified to cancel the subscription? We document a bit more about subscription trials here: https://docs.stripe.com/billing/subscriptions/trials. Can you check the customer has a payment method saved? Can you share the request if where this happened? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
want to allow customers who are currently on a free trial for a subscription to end their trial early, start paying immediately, and continue their subscription with the same price plan. The goal is to charge the customer without canceling their subscription or affecting the recurring billing cycle.
req_oCcJpabyLTjYpt
And req_9vXAOQtMDIiob2
here it charge customer: req_9vXAOQtMDIiob2
here stripe cancel subscription : req_oCcJpabyLTjYpt
Taking a look
This might help you to understand
What i Want:
Customer Decides to Pay Early: The customer decides they want to start using the "Pro Plan" immediately without waiting for the trial to end. They want to pay the $10 right now and start the monthly billing.
End Trial and Charge Immediately:
i want to end their free trial immediately, charge them $10 for the current month, and start their subscription.
The customer should be billed immediately for the full $10, and their subscription should continue to bill $10 per month thereafter, as if the trial never existed.
Subscription Continuity:
After this charge, the customer's subscription should remain active with the same price_id (no changes to the plan), and they should continue to be billed $10 per month on the regular billing cycle.
I tested this on my end, and passing trial_end: 'now', does not immediately delete the subscription. I'm looking if a setting is at play here, hang tight
To be clear, the deletion is not from Stripe? Like that request you shared came from your code
mir_subscription-cancellation
https://dashboard.stripe.com/test/logs/req_oCcJpabyLTjYpt this is the request you shared. It's not our doing. It's a real API request sent by your code (or a third-party you use) in Node.js
This was the guidance i was looking for .
i figured it out.
I am using below code:
const updatedSubscription = await newStripe.subscriptions.update(
subscription.id,
{
trial_end: 'now',
billing_cycle_anchor: 'now',
proration_behavior: 'create_prorations',
}
);
sure thing!
What should be ideal:
proration_behavior
and billing_cycle_anchor
values for my case?
THis is my usecase:
What i Want:
Customer Decides to Pay Early: The customer decides they want to start using the "Pro Plan" immediately without waiting for the trial to end. They want to pay the $10 right now and start the monthly billing.
End Trial and Charge Immediately:
i want to end their free trial immediately, charge them $10 for the current month, and start their subscription.
The customer should be billed immediately for the full $10, and their subscription should continue to bill $10 per month thereafter, as if the trial never existed.
Subscription Continuity:
After this charge, the customer's subscription should remain active with the same price_id (no changes to the plan), and they should continue to be billed $10 per month on the regular billing cycle.
I mean what you have is totally fine? Just do not cancel that Subscription
If you hit another error though I am happy to look but what you mentioned is correct
in a way you technically only need trial_end: 'now'
Okay, one last question: How can I verify if the charge was successful? Should I rely on a webhook to check this, or will I receive any confirmation in the response when I update the subscription?
The Subscription has the latest_invoice property which is the id of the most recent Invoice. That Subscription is ending a trial so an Invoice would be issued.
It also has status which shows the current status of the Subscription such as trialing, active or past_due
So what you can do is look at status and also then look at the associated Invoice to see what happened.
And the Invoice itself has a PaymentIntent that would show succeeded or not in its own status.
https://docs.stripe.com/payments-api/tour is a good watch if you haven't already
I can do this:
expand: ['latest_invoice.payment_intent'],
right?
exactly!
payment_intent.payment_intent status is success means payment done.
right?
yes