#Tejesh
1 messages · Page 1 of 1 (latest)
@tropic leaf since both plans has the same billing period (annual), the next invoice date remains the same unless you change the billing_cycle_anchor https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_cycle_anchor
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes but that's after upgrading subscription
I need to get the next billing date and I need to show the user
So if you upgrade then the next billing date will be blabla
You can just refer to the peroid_start property https://stripe.com/docs/api/invoices/object#invoice_object-period_start
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_f0ru82Efxfy0ue
OK. You should refer to the created property. This is the timestamp of the invoice creation time.
I want next billing date
The created property of the upcoming invoice is the next invoice date.
That's giving me next billing date but it's not prorated date
Whenever an user changing his subscription from basic to pro
Obviously he the next billing date should not be the same
No. the invoice date stays the same, and the prorated charge will be included in the upcoming invoice.
We can't let user use all the professional sercvices withohut paying for it.
We should be either reducing the current subscription period on prorated basis or let user do payment for next subscription period.
i'm not entirely sure what's the ask here now. if you want to show the user the changes assuming they upgrade, then use the upcoming invoice and pass in the relevant parameters like the new price, whether you want to prorate etc
const invoice = await stripe.invoices.retrieveUpcoming({
customer: customer_id,
subscription: subscription_id,
subscription_items: items,
// subscription_proration_behavior: 'always_invoice',
subscription_proration_date: proration_date,
});
Fetching the upcoming invoice from this api
alright, what's the issue with this?