#jimmy-sandoval

1 messages ยท Page 1 of 1 (latest)

scarlet oarBOT
willow stirrup
#

Hello! How can I help?

hybrid sable
#

Hi @willow stirrup

#

I have a customer that has a subscription, but this customer cancels their subscription at the end of cycle

#

I using this process for cancelt at the end of cycle

#

so far do you understand me?

#

In conclusion, I have a user whose subscription will be canceled at the end of the cycle

#

I have a UI to simulate how much the user will pay if the amount of his subscription increases or decreases, and for that I consult the upcoming invoice api to show the user how much he will pay

So, when the user enabled his subscription to be canceled at the end of the period, I can no longer retrieve the next invoice, I get an error: No upcoming invoices for customer: cus_NcK54lHWSGoHca

#

@willow stirrup ๐Ÿ‘€

willow stirrup
#

๐Ÿ‘‹ hey there - give me a minute to dig in

hybrid sable
#

For help you

#

i have this error own my console

willow stirrup
#

Yeah that error makes sense - if a subscription were to cancel at the end of the current period there would be no additional invoices

#

What behavior were you expecting instead?

hybrid sable
#

How can I tell you again, in my business if a client cancels their subscription at the end of the period

#

we want to renew

#

but if you only want to lower or raise the amount that has the same subscription

#

give me a minute

#

we want to enable the subscription to tell us about the prorate again

#

We want that if, for example, your current subscription that is going to be canceled at the end of the cycle, has 10 quantity of a $10 Kuelpa plan

#

What happens if I want to reduce the quantity to 5, or increase the quantity to 15 and apply a proration

willow stirrup
#

So you want to preview what the next Invoice would look like if they made a change to the quantity AND didn't cancel at the end of the period. Right?

hybrid sable
#

I mean, I want to get a preview of what the next invoice would look like if they made a change in the amount, knowing that the subscription will be canceled at the end of the cycle

willow stirrup
#

When you make the changes to amount if your goal to Invoice for those changes immediately?

hybrid sable
#

yes

#

one option is to disable cancel_at_period_end

#

and so I can recover the preview of the invoice

#

but I wanted to know if there is another way

willow stirrup
#

Gotcha - that's the important piece you were missing. If you want to preview the Invoice from making changes and prorating immediately you need to pass in subscription_proration_behavior: always_invoice with the changes (https://stripe.com/docs/api/invoices/upcoming_invoice_lines#upcoming_invoice_lines-subscription_proration_behavior)

hybrid sable
#

give me a minute please

#

i will probe

#

No, i have the same error

#

I doing this for retrieve upconming invoice

willow stirrup
#

It's because you're not actually passing in any of the change you're trying to "preview"

#

If you want to preview updating the Subscription you need to pass in things like subscription_items with the request that reflects all the changed items

hybrid sable
#

ohhh

#

the error is mine

#

okey thanks i will be prove

willow stirrup
#

๐Ÿ‘