#lec1892_api

1 messages ¡ Page 1 of 1 (latest)

ivory oracleBOT
#

👋 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.

brave kraken
#

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.

warm mist
#

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?

brave kraken
#

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.

warm mist
#

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?

brave kraken
#

No nothing you do to the Invoice will affect proration

warm mist
#

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?

brave kraken
#

How are you canceling the Subscription here?

warm mist
#

the customer cancels from the customer portal

brave kraken
#

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

warm mist
#

ok, so that's an option = remove the customer credit balance
and the most simple option is to disable proration, right?

brave kraken
#

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

warm mist
#

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

brave kraken
#

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

warm mist
#

what about customer portal configuration api?

#

when creating a customer portal session I can specify the configuration id

brave kraken
#

That's what I was referencing above

#

Wait

#

Ugh sorry

#

lol sorry

#

So yes, you can control it via the API as well

warm mist
#

let me check my configuration

#

I remembered about it just now

#

one sec please

brave kraken
#

Sure

#

If you aren't specifying anything then it defaults to create_prorations

#

So you want to set it to none

warm mist
#

ok let me check

#

my customer portal configuration is not correct.
"proration_behavior": "create_prorations"

#

I will fix that

#

thank you for helping me to troubleshoot that