#Eranga

1 messages ยท Page 1 of 1 (latest)

exotic zealotBOT
dense kraken
sand moth
#

Give me a sec

#

req_vKLtOnEWKvSan8

dense kraken
sand moth
#

Wait, I might have taken the wrong request ID then

#

req_ZOwp5WI0vk4NVW

#

It is this one

dense kraken
sand moth
#

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?)

dense kraken
sand moth
#

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

dense kraken
#

Stripe doesn't log GET responses, can you share with me the upcoming invoice response in this chat?

sand moth
#

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

dense kraken
#

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.

sand moth
#

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

dense kraken
#

that's because subscription-trial-end is set to now

sand moth
#

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

sand moth
#

Busy day, right? ๐Ÿ˜…

dense kraken
#

Haha yes ๐Ÿ˜‚

#

Thanks for your patience in waiting

#

Is there a follow-up question?

sand moth
#

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

dense kraken
#

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.

sand moth
#

Cool, no worries. Thank you for your input @dense kraken

#

Hope you have a less busy day after now