#julien_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/1324656839681376257
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! how can I help?
Hello!
I am writing to you because i work in insurance and each year, our subscriptions prices change due to inflation and risk reviews
as of now, i tried using the following code
Stripe::SubscriptionItem.update(
subscription_item_id,
price: new_price.id
)
Which updates the price on my subscription
But, then i have problems with prorations
The problem that i encountered is that the prices changes on my annual plan on january 1st, but we didnt manage to change them on January 1st.
For example, i have this customer that had a price of 100€ for 2024 and the price is now 104€. I already know for sure that on january 1st, 2026, the price will change agait, but i don't know yet what the price will be.
Now, we failed to update the customer's price on january 1st, the atttempt was to do
(this is ruby code)
new_price = Stripe::Price.create({ unit_amount: i.fee(anchor_date: anchor_date).fractional, currency: i.fee(anchor_date: anchor_date).currency, recurring: { interval: i.payment_frequency }, product: i.stripe_subscription_product })
and then
subscription_item_id = stripe_subscription.items&.first&.id Stripe::SubscriptionItem.update( subscription_item_id, price: new_price.id )
But that didnt work
And when i did it again yesterday (January 2nd)
This prorata was added on my next invoice.
Description
Qté
Prix unitaire
Montant
2 janv. 2025 - 1 janv. 2026
Temps d'utilisation de PNOD - Prime restant après le 02 Jan 2025
1
103,50 €
Temps d'utilisation de PNOD - Prime inutilisé après le 02 Jan 2025
1
-99,52 €
1 janv. 2026 - 1 janv. 2027
PNOD - Prime
1
104,00 €
104,00 €
Sous-total
107,98 €
Total hors taxes
107,98 €
Taxe
Total
107,98 €
Montant dĂ»
107,98 €
This system doesnt work for me, what i would need is a reliable way to tell the stripe subscription that the price changes for the next invoice (without prorating) before the invoice is sent to the customer and the debit is initiated
How can I do this with the subscription / subscription_schedule / subscription_item APIs?
Thanks!
why didn't the first update work? Can you share the request id that failed?
This system doesnt work for me, what i would need is a reliable way to tell the stripe subscription that the price changes for the next invoice (without prorating) before the invoice is sent to the customer and the debit is initiated
If I understand correctly, what you want to do is to be able to update the price without proration?
yes!
i see, can you share why the first update failed? The request id for the first update that failed would be helpful. It'd look like req_xxx
[0] https://support.stripe.com/questions/finding-the-id-for-an-api-request
when you update the price, you will need to set proration_behavior="none" to disable prorations. Maybe give that a try and see if that works as expected for you? I'm assuming that the new price is also the same billing interval as the old price e.g. both are yearly
the requests didnt fail technically, but let me see
We tried to do it on december 31st and let me find one that failed
I will send you what happened
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
We tried to change the price on december 31st, customers were billed with the new price (prorated because that day was already started), and then they were re-billed automatically on january 1st, of the former price
We tried to do it on december 31st and let me find one that failed
Were you able to find the failure requestId ?
basically what "failed" is that clients were billed on december 31st and on january 1st
it didnt technically fail
Now my problem is the following :
- Clients were billed the 2024 price for 2025. So I need to fix this
- I don't want this problem to happen again for 2026, so I need to configure my subscriptions properly using the API
OK, let's start from the beginign, could you please create a simulation using Stripe Test clock and share with me:
- What happened with Ids (like Subscription, requestId)
- What are you expecting
https://stripe.com/docs/billing/testing/test-clocks