#Eranga
1 messages ยท Page 1 of 1 (latest)
Hi! 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.
This is just a GET request to retrieve a subscription. You should use this API (https://stripe.com/docs/api/invoices/upcoming?lang=node#upcoming_invoice) to retrieve upcoming invoice.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Wait, I might have taken the wrong request ID then
req_ZOwp5WI0vk4NVW
It is this one
this subscription is still on trial, you might want to set a subscription_trial_end (https://stripe.com/docs/api/invoices/upcoming?lang=node#upcoming_invoice-subscription_trial_end`) when previewing a upcoming invoice.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks. But even while trialing, I can see the future amounts properly if I update only quantity
I don't need to specifically set subscription_trial_end
Also, how can I know the billing period? (If I use subscription_trial_end, wouldn't it change my billing cycle?)
By billing period do you mean the billing_cycle_anchor? (https://stripe.com/docs/api/invoices/upcoming_invoice_lines?lang=node#upcoming_invoice_lines-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.
I meant the period_end and period_start of the upcoming invoice response root
If I set subscription_trial_end=now, then the above two period values become the same
And the invoice item inside the invoice items array has period: {start, end }
end and start has only a few seconds of duration between them
Stripe doesn't log GET responses, can you share with me the upcoming invoice response in this chat?
Sure
And this is my request:
stripe invoices upcoming \
--customer=cus_MSsFMlw7Yd8TG8 \
--subscription=sub_1LjwaMC8JGuaUdU6I4jBwSRZ \
--coupon=LFWWZUMh \
--subscription-trial-end=now \
--subscription-proration-behavior="create_prorations" \
--data "subscription_items[0][id]"=si_MSsLo50T9gSWML \
--data "subscription_items[0][quantity]"=4 \
--data "subscription_items[0][price]"=price_1K7BEwC8JGuaUdU6DUNs8JTW
Sorry wait, I might have sent you the wrong response
Just want to make sure we are looking at the same data
"period": {
"end": 1666249314, //Thursday, 20 October 2022 07:01:54
"start": 1663657314 //Tuesday, 20 September 2022 07:01:54
},
The start and end are one month apart.
Yeah, you're correct. Sorry, I was a bit confused with another scenario
In here the problem is that the dates we see have changed from the original dates
that's because subscription-trial-end is set to now
Yep, true
I'm trying to use one API call to Stripe, and know both the future amount, and the period of the future invoice
Busy day, right? ๐
Yeah, so with subscription-trial-end set to now, I get the amount I wanted
But the period is different
Do you know a way I can get both the duration and the amount in one go
If you just change the plan, the generated invoice amount is still 0 because the subscription is still in trial, and you will only see the new plan reflected in the next invoice (the invoice after the upcoming invoice).
However, There's no way retrieve the invoice after the upcoming invoice.