#lec1892_api
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/1293656804047192136
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- lec1892_api, 3 hours ago, 12 messages
Hello
Proration does not take into account the state of previous invoices.
This is expected.
If you don't want proration to occur, then you need to disable it.
So if a subscription is unpaid, and then it is canceled, the customer will receive credits even though he has not performed the payment just because the proration is enabled?
Yes that is the expected behavior. The API was designed with the concept of you controlling this via designating proration and you collecting payment for any previously unpaid Invoices while you granted access to your Subscription if you so desire.
When a cancellation or an update of a Subscription occurs, the state of any previous Invoices is never taken into account for proration.
In case I need to keep prorations enabled, but if the customer has an unpaid invoice he should not receive credits, what should I do? Flag the invoice as paid even though it was not?
No nothing you do to the Invoice will affect proration
So in that case you would delete the Invoice item that was generated from the proration using https://docs.stripe.com/api/invoiceitems/delete
So, after the subscription is canceled and the proration invoice is generated to grant credits to the customer (-99,99), then I should delete the invoice item, so the customer won't receive credits. Is that what you mean?
How are you canceling the Subscription here?
You are using the Cancel endpoint: https://docs.stripe.com/api/subscriptions/cancel ?
the customer cancels from the customer portal
Ah
Okay in that case you need to remove the Credit Balance from the Customer
So what will happen is the Invoice Item will immediately be added to a new Invoice and finalized.
That will then add a credit to the Customer to be applied to the next Invoice
You can see the Customer balance via: https://docs.stripe.com/api/customers/object#customer_object-balance
And you can update that to set it to 0 to remove that credit balance: https://docs.stripe.com/api/customers/update#update_customer-balance
ok, so that's an option = remove the customer credit balance
and the most simple option is to disable proration, right?
You can't actually disable proration for Customer Portal cancellations.
That isn't a feature that has been added yet for Customer Portal.
So this is your only option right now.
I believe there is an outstanding feature request that will hopefully be worked on soon for controlling proration with Customer Portal Cancellations
are you sure that when the customer cancels the subscription from the customer portal the proration behavior will always be enabled?
This is the customer portal settings screen
Doh
Thanks for checking
We haven't enabled this as an API parameter yet
But you can set it in the Dashboard for your default config
what about customer portal configuration api?
when creating a customer portal session I can specify the configuration id
Yeah not available via the API yet: https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_cancel-enabled
That's what I was referencing above
Wait
Ugh sorry
lol sorry
So yes, you can control it via the API as well