#kostas-sioupoulis_code

1 messages · Page 1 of 1 (latest)

ripe adderBOT
granite pecanBOT
#

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.

ripe adderBOT
#

👋 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/1226847269207412806

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

granite pecanBOT
willow rivet
#

Hi! Can you elaborate more on what you mean by:

Does the current_period change when I cancel the renewal of the subcription and re-enable it?

fair laurel
#

I mean that for some reason the current_period_end seems to change when I modify a stripe subscription

willow rivet
#

Modify how? Specifically what are you modifying?

#

An example API request would help (req_xxx)

fair laurel
#

modify like this for example if request:
subscription = stripe.Subscription.modify(
stripe_subscription.subscription_id,
payment_behavior = 'pending_if_incomplete',
items=[{
'id': subscription['items']['data'][0].id,
'price': stripe_price.id,
}],
proration_behavior= proration_behavior,
proration_date=request.session['proration_date'],
)
else:
subscription = stripe.Subscription.modify(
stripe_subscription.subscription_id,
payment_behavior = 'pending_if_incomplete',
items=[{
'id': subscription['items']['data'][0].id,
'price': stripe_price.id,
}],
proration_behavior=proration_behavior,

        )
willow rivet
#

So you're downgrading/upgrading the items, yes? What is the value of proration_behavior?

fair laurel
#

it is set dynamically if renewal:
proration_behavior = 'none'

    else:
        proration_behavior = 'always_invoice'
#

subscription = stripe.Subscription.modify(
stripe_subscription.subscription_id,
cancel_at_period_end=cancel_at_period_end,
)

willow rivet
#

Seems expected then as if you prorate then we will reset the billing anchor and start a new period

fair laurel
#

Is there a way to not do that?

willow rivet
#

Can you share an example request ID (req_xxx) where the period reset unexpectedly

fair laurel
#

Yes give me one second to find one.

#

It should be the last request on this subcription sub_1P3FydIqJXTh2k1UQHDTq0ZZ

willow rivet
fair laurel
#

What I want to acheive is re-enable the renewal of a customer's subcription without updating the billing period

willow rivet
#

I don't understand what you mean by 're-enable'? That request there updates the item from a free plan to a paid plan

fair laurel
#

Okey I see, there is no way to overrule that?

#

Because in my implementation a stripe subscription is linked to multiple products in my site , for which the user can cancel the renewal of them

willow rivet
fair laurel
willow rivet
#

No, not without additional parameters (linked above)

fair laurel
#

Okay, is there a way to not invoice when changing from a 0 amount price to a 10$ (for example) price subcription??

willow rivet
#

The issue is that the billing cycle resets immediately and we send an invoice for the new plan. If you want to persist the current billing cycle, then you need to trick it by including a trial period in your update that ends at the current billing cycle

fair laurel
#

Okayy, I think I get it.

willow rivet
fair laurel
#

Thank you very much for your help.

#

Something that is related to this in consideration to my implementation

#

Is there a way to set the amount of the subcription that I want to be renewed at the end of the billing cycle? Instead of changing the subcription price

ripe adderBOT
willow rivet
#

What do you mean by 'amount of the subscription'?

#

You can't apply a fixed cost to renew though. It's a sum of all the items etc

#

You can of course apply a discount to reduce the amount

fair laurel
#

I mean my subscription price is actually a sum of the vms my customer buys.

#

Say for example 50 X 5 but if he chooses that he wants to renew only 4 of them then I change the price of the subscription to 50 X 4

willow rivet
#

Then you'd set the items[][quantity] to be 4 in your update

narrow meteor
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

fair laurel
#

How can I cancel the trial period earlier?

#

I mean stop the trial period earlier